diff --git a/go.mod b/go.mod index aef92311e8..a106613397 100644 --- a/go.mod +++ b/go.mod @@ -108,7 +108,7 @@ require ( k8s.io/cri-api v0.28.15 k8s.io/klog/v2 v2.90.1 moul.io/http2curl/v2 v2.3.0 - yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20260616113326-e130123e964b + yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20260618060034-0b9a6a785a09 yunion.io/x/executor v0.0.0-20260312022053-f538abd2b005 yunion.io/x/jsonutils v1.0.1-0.20250507052344-1abcf4f443b1 yunion.io/x/log v1.0.1-0.20240305175729-7cf2d6cd5a91 @@ -129,14 +129,6 @@ require ( github.com/AdaLogics/go-fuzz-headers v0.0.0-20230811130428-ced1acdcaa24 // indirect github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0 // indirect github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 // indirect - github.com/Azure/go-autorest v14.2.0+incompatible // indirect - github.com/Azure/go-autorest/autorest v0.11.28 // indirect - github.com/Azure/go-autorest/autorest/adal v0.9.18 // indirect - github.com/Azure/go-autorest/autorest/azure/auth v0.5.12 // indirect - github.com/Azure/go-autorest/autorest/azure/cli v0.4.5 // indirect - github.com/Azure/go-autorest/autorest/date v0.3.0 // indirect - github.com/Azure/go-autorest/logger v0.2.1 // indirect - github.com/Azure/go-autorest/tracing v0.6.0 // indirect github.com/ClickHouse/clickhouse-go v1.5.4 // indirect github.com/DataDog/datadog-agent/pkg/obfuscate v0.0.0-20211129110424-6491aa3bf583 // indirect github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.42.0-rc.1 // indirect @@ -178,12 +170,10 @@ require ( github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.21 // indirect github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 // indirect github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.9 // indirect - github.com/aws/aws-sdk-go-v2/service/costexplorer v1.63.5 // indirect github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1 // indirect github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.0 // indirect github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.9 // indirect github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.9 // indirect - github.com/aws/aws-sdk-go-v2/service/organizations v1.51.1-0.20260401181752-9074b3ddace9 // indirect github.com/aws/aws-sdk-go-v2/service/s3 v1.88.4 // indirect github.com/aws/aws-sdk-go-v2/service/sso v1.29.6 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.1 // indirect @@ -217,7 +207,6 @@ require ( github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.0-20210816181553-5444fa50b93d // indirect github.com/dgraph-io/ristretto v0.1.0 // indirect - github.com/dimchansky/utfbom v1.1.1 // indirect github.com/dnstap/golang-dnstap v0.4.0 // indirect github.com/docker/go-events v0.0.0-20250114142523-c867878c5e32 // indirect github.com/dustin/go-humanize v1.0.0 // indirect @@ -246,7 +235,6 @@ require ( github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/gofrs/uuid v4.1.0+incompatible // indirect github.com/gogo/protobuf v1.3.2 // indirect - github.com/golang-jwt/jwt/v4 v4.2.0 // indirect github.com/golang/glog v1.2.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/snappy v0.0.4 // indirect diff --git a/go.sum b/go.sum index a72ca0d0c6..ee9c13f062 100644 --- a/go.sum +++ b/go.sum @@ -58,26 +58,6 @@ github.com/AdamKorcz/go-118-fuzz-build v0.0.0-20230306123547-8075edf89bb0/go.mod github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0= github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= -github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs= -github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= -github.com/Azure/go-autorest/autorest v0.11.24/go.mod h1:G6kyRlFnTuSbEYkQGawPfsCswgme4iYf6rfSKUDzbCc= -github.com/Azure/go-autorest/autorest v0.11.28 h1:ndAExarwr5Y+GaHE6VCaY1kyS/HwwGGyuimVhWsHOEM= -github.com/Azure/go-autorest/autorest v0.11.28/go.mod h1:MrkzG3Y3AH668QyF9KRk5neJnGgmhQ6krbhR8Q5eMvA= -github.com/Azure/go-autorest/autorest/adal v0.9.18 h1:kLnPsRjzZZUF3K5REu/Kc+qMQrvuza2bwSnNdhmzLfQ= -github.com/Azure/go-autorest/autorest/adal v0.9.18/go.mod h1:XVVeme+LZwABT8K5Lc3hA4nAe8LDBVle26gTrguhhPQ= -github.com/Azure/go-autorest/autorest/azure/auth v0.5.12 h1:wkAZRgT/pn8HhFyzfe9UnqOjJYqlembgCTi72Bm/xKk= -github.com/Azure/go-autorest/autorest/azure/auth v0.5.12/go.mod h1:84w/uV8E37feW2NCJ08uT9VBfjfUHpgLVnG2InYD6cg= -github.com/Azure/go-autorest/autorest/azure/cli v0.4.5 h1:0W/yGmFdTIT77fvdlGZ0LMISoLHFJ7Tx4U0yeB+uFs4= -github.com/Azure/go-autorest/autorest/azure/cli v0.4.5/go.mod h1:ADQAXrkgm7acgWVUNamOgh8YNrv4p27l3Wc55oVfpzg= -github.com/Azure/go-autorest/autorest/date v0.3.0 h1:7gUk1U5M/CQbp9WoqinNzJar+8KY+LPI6wiWrP/myHw= -github.com/Azure/go-autorest/autorest/date v0.3.0/go.mod h1:BI0uouVdmngYNUzGWeSYnokU+TrmwEsOqdt8Y6sso74= -github.com/Azure/go-autorest/autorest/mocks v0.4.1/go.mod h1:LTp+uSrOhSkaKrUy935gNZuuIPPVsHlr9DSOxSayd+k= -github.com/Azure/go-autorest/autorest/mocks v0.4.2 h1:PGN4EDXnuQbojHbU0UWoNvmu9AGVwYHG9/fkDYhtAfw= -github.com/Azure/go-autorest/autorest/mocks v0.4.2/go.mod h1:Vy7OitM9Kei0i1Oj+LvyAWMXJHeKH1MVlzFugfVrmyU= -github.com/Azure/go-autorest/logger v0.2.1 h1:IG7i4p/mDa2Ce4TRyAO8IHnVhAVF3RFU+ZtXWSmf4Tg= -github.com/Azure/go-autorest/logger v0.2.1/go.mod h1:T9E3cAhj2VqvPOtCYAvby9aBXkZmbF5NWuPV8+WeEW8= -github.com/Azure/go-autorest/tracing v0.6.0 h1:TYi4+3m5t6K48TGI9AUdb+IzbnSxvnvUMfuitfgcfuo= -github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBpUA79WCAKPPZVC2DeU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ClickHouse/clickhouse-go v1.5.4 h1:cKjXeYLNWVJIx2J1K6H2CqyRmfwVJVY1OV1coaaFcI0= @@ -222,8 +202,6 @@ github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3 h1:bIqFDwgGXXN1Kpp99pDOdKMTTb5d github.com/aws/aws-sdk-go-v2/internal/ini v1.8.3/go.mod h1:H5O/EsxDWyU+LP/V8i5sm8cxoZgc2fdNR9bxlOFrQTo= github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.9 h1:w9LnHqTq8MEdlnyhV4Bwfizd65lfNCNgdlNC6mM5paE= github.com/aws/aws-sdk-go-v2/internal/v4a v1.4.9/go.mod h1:LGEP6EK4nj+bwWNdrvX/FnDTFowdBNwcSPuZu/ouFys= -github.com/aws/aws-sdk-go-v2/service/costexplorer v1.63.5 h1:iNNJ6ZrQO37Xh12XjNncS3fq/11l1TzyZwBWcZMHWkY= -github.com/aws/aws-sdk-go-v2/service/costexplorer v1.63.5/go.mod h1:auLb1gCiI54TM7iUxSYu5MYSimWr0fL6t5/PgxkJOr0= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1 h1:oegbebPEMA/1Jny7kvwejowCaHz1FWZAQ94WXFNCyTM= github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.1/go.mod h1:kemo5Myr9ac0U9JfSjMo9yHLtw+pECEHsFtJ9tqCEI8= github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.9.0 h1:X0FveUndcZ3lKbSpIC6rMYGRiQTcUVRNH6X4yYtIrlU= @@ -232,8 +210,6 @@ github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.9 h1:5r34CgVOD github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.9/go.mod h1:dB12CEbNWPbzO2uC6QSWHteqOg4JfBVJOojbAoAUb5I= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.9 h1:wuZ5uW2uhJR63zwNlqWH2W4aL4ZjeJP3o92/W+odDY4= github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.19.9/go.mod h1:/G58M2fGszCrOzvJUkDdY8O9kycodunH4VdT5oBAqls= -github.com/aws/aws-sdk-go-v2/service/organizations v1.51.1-0.20260401181752-9074b3ddace9 h1:qi11riT4zVjV41Nh74zbBgK0EQbkbZG8rPm4shDFlJk= -github.com/aws/aws-sdk-go-v2/service/organizations v1.51.1-0.20260401181752-9074b3ddace9/go.mod h1:urLFj1twuR/h5T0wN/2/kmY1gxBFa1tTKr+c60lZ2fA= github.com/aws/aws-sdk-go-v2/service/s3 v1.88.4 h1:mUI3b885qJgfqKDUSj6RgbRqLdX0wGmg8ruM03zNfQA= github.com/aws/aws-sdk-go-v2/service/s3 v1.88.4/go.mod h1:6v8ukAxc7z4x4oBjGUsLnH7KGLY9Uhcgij19UJNkiMg= github.com/aws/aws-sdk-go-v2/service/sso v1.29.6 h1:A1oRkiSQOWstGh61y4Wc/yQ04sqrQZr1Si/oAXj20/s= @@ -358,8 +334,6 @@ github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/Lu github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= -github.com/dimchansky/utfbom v1.1.1 h1:vV6w1AhK4VMnhBno/TPVCoK9U/LP0PkLCS9tbxHdi/U= -github.com/dimchansky/utfbom v1.1.1/go.mod h1:SxdoEBH5qIqFocHMyGOXVAybYJdr71b1Q/j0mACtrfE= github.com/dnstap/golang-dnstap v0.4.0 h1:KRHBoURygdGtBjDI2w4HifJfMAhhOqDuktAokaSa234= github.com/dnstap/golang-dnstap v0.4.0/go.mod h1:FqsSdH58NAmkAvKcpyxht7i4FoBjKu8E4JUPt8ipSUs= github.com/docker/distribution v2.8.1+incompatible h1:Q50tZOPR6T/hjNsyc9g8/syEs6bk8XXApsHjKukMl68= @@ -511,9 +485,6 @@ github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXP github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/goji/httpauth v0.0.0-20160601135302-2da839ab0f4d/go.mod h1:nnjvkQ9ptGaCkuDUx6wNykzzlUixGxvkme+H/lnzb+A= -github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-plus/errors v1.0.0 h1:9Rh4itnph6OYO7wm9u3FUTLMFMKCoL07+bLiYKELxWw= github.com/golang-plus/errors v1.0.0/go.mod h1:YTFZjOTBcUFieeZe4q+7Umfu/sceSr3XQyBIkTkzpd8= github.com/golang-plus/testing v1.0.0 h1:azmFWFV44LHK/j/jAkNTbzB2G2b6HdmqF358r73m8kg= @@ -1262,11 +1233,9 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211117183948-ae814b36b871/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220131195533-30dcbda58838/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220427172511-eb4f295cb31f/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.0.0-20220516162934-403b01795ae8/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= -golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw= golang.org/x/crypto v0.5.0/go.mod h1:NK/OQwhpMQP3MwtdjgLlYHnH9ebylxKWv3e0fK+mkQU= golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE= @@ -1785,8 +1754,8 @@ sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc= sigs.k8s.io/yaml v1.3.0 h1:a2VclLzOGrwOHDiV8EfBGhvjHvP46CtW5j6POvhYGGo= sigs.k8s.io/yaml v1.3.0/go.mod h1:GeOyir5tyXNByN85N/dRIT9es5UQNerPYEKK56eTBm8= -yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20260616113326-e130123e964b h1:terywNguK9X7lL7ixvZH66luCEC4o1pcRCxaaVCtKMQ= -yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20260616113326-e130123e964b/go.mod h1:TbMuTWxcTdyL2Usn+WQdIw0jdlBYO66SzPRY8LZ3Wj0= +yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20260618060034-0b9a6a785a09 h1:LBYa85RLPvoUWd32iEvEobjPgwIefASR0JnKZTHP5ug= +yunion.io/x/cloudmux v0.3.10-0-alpha.1.0.20260618060034-0b9a6a785a09/go.mod h1:U1jrD5DeEbNCKx4JMZ6m1oZB/d1ya6xcAcD3HDKrAw8= yunion.io/x/executor v0.0.0-20260312022053-f538abd2b005 h1:3sWwcjGXGjG9mLBWa7AyLq+QSi0udTAx21pfVQRFMBE= yunion.io/x/executor v0.0.0-20260312022053-f538abd2b005/go.mod h1:Uxuou9WQIeJXNpy7t2fPLL0BYLvLiMvGQwY7Qc6aSws= yunion.io/x/jsonutils v0.0.0-20190625054549-a964e1e8a051/go.mod h1:4N0/RVzsYL3kH3WE/H1BjUQdFiWu50JGCFQuuy+Z634= diff --git a/vendor/github.com/Azure/go-autorest/.gitignore b/vendor/github.com/Azure/go-autorest/.gitignore deleted file mode 100644 index 3350aaf706..0000000000 --- a/vendor/github.com/Azure/go-autorest/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -# The standard Go .gitignore file follows. (Sourced from: github.com/github/gitignore/master/Go.gitignore) -# Compiled Object files, Static and Dynamic libs (Shared Objects) -*.o -*.a -*.so - -# Folders -_obj -_test -.DS_Store -.idea/ -.vscode/ - -# Architecture specific extensions/prefixes -*.[568vq] -[568vq].out - -*.cgo1.go -*.cgo2.c -_cgo_defun.c -_cgo_gotypes.go -_cgo_export.* - -_testmain.go - -*.exe -*.test -*.prof - -# go-autorest specific -vendor/ -autorest/azure/example/example diff --git a/vendor/github.com/Azure/go-autorest/CHANGELOG.md b/vendor/github.com/Azure/go-autorest/CHANGELOG.md deleted file mode 100644 index d1f596bfc9..0000000000 --- a/vendor/github.com/Azure/go-autorest/CHANGELOG.md +++ /dev/null @@ -1,1004 +0,0 @@ -# CHANGELOG - -## v14.2.0 - -- Added package comment to make `github.com/Azure/go-autorest` importable. - -## v14.1.1 - -### Bug Fixes - -- Change `x-ms-authorization-auxiliary` header value separator to comma. - -## v14.1.0 - -### New Features - -- Added `azure.SetEnvironment()` that will update the global environments map with the specified values. - -## v14.0.1 - -### Bug Fixes - -- Fix race condition when refreshing token. -- Fixed some tests to work with Go 1.14. - -## v14.0.0 - -## Breaking Changes - -- By default, the `DoRetryForStatusCodes` functions will no longer infinitely retry a request when the response returns an HTTP status code of 429 (StatusTooManyRequests). To opt in to the old behavior set `autorest.Count429AsRetry` to `false`. - -## New Features - -- Variable `autorest.Max429Delay` can be used to control the maximum delay between retries when a 429 is received with no `Retry-After` header. The default is zero which means there is no cap. - -## v13.4.0 - -## New Features - -- Added field `SendDecorators` to the `Client` type. This can be used to specify a custom chain of SendDecorators per client. -- Added method `Client.Send()` which includes logic for selecting the preferred chain of SendDecorators. - -## v13.3.3 - -### Bug Fixes - -- Fixed connection leak when retrying requests. -- Enabled exponential back-off with a 2-minute cap when retrying on 429. -- Fixed some cases where errors were inadvertently dropped. - -## v13.3.2 - -### Bug Fixes - -- Updated `autorest.AsStringSlice()` to convert slice elements to their string representation. - -## v13.3.1 - -- Updated external dependencies. - -### Bug Fixes - -## v13.3.0 - -### New Features - -- Added support for shared key and shared access signature token authorization. - - `autorest.NewSharedKeyAuthorizer()` and dependent types. - - `autorest.NewSASTokenAuthorizer()` and dependent types. -- Added `ServicePrincipalToken.SetCustomRefresh()` so a custom refresh function can be invoked when a token has expired. - -### Bug Fixes - -- Fixed `cli.AccessTokensPath()` to respect `AZURE_CONFIG_DIR` when set. -- Support parsing error messages in XML responses. - -## v13.2.0 - -### New Features - -- Added the following functions to replace their versions that don't take a context. - - `adal.InitiateDeviceAuthWithContext()` - - `adal.CheckForUserCompletionWithContext()` - - `adal.WaitForUserCompletionWithContext()` - -## v13.1.0 - -### New Features - -- Added support for MSI authentication on Azure App Service and Azure Functions. - -## v13.0.2 - -### Bug Fixes - -- Always retry a request even if the sender returns a non-nil error. - -## v13.0.1 - -## Bug Fixes - -- Fixed `autorest.WithQueryParameters()` so that it properly encodes multi-value query parameters. - -## v13.0.0 - -## Breaking Changes - -The `tracing` package has been rewritten to provide a common interface for consumers to wire in the tracing package of their choice. -What this means is that by default no tracing provider will be compiled into your program and setting the `AZURE_SDK_TRACING_ENABLED` -environment variable will have no effect. To enable this previous behavior you must now add the following import to your source file. -```go - import _ "github.com/Azure/go-autorest/tracing/opencensus" -``` -The APIs required by autorest-generated code have remained but some APIs have been removed and new ones added. -The following APIs and variables have been removed (the majority of them were moved to the `opencensus` package). -- tracing.Transport -- tracing.Enable() -- tracing.EnableWithAIForwarding() -- tracing.Disable() - -The following APIs and types have been added -- tracing.Tracer -- tracing.Register() - -To hook up a tracer simply call `tracing.Register()` passing in a type that satisfies the `tracing.Tracer` interface. - -## v12.4.3 - -### Bug Fixes - -- `autorest.MultiTenantServicePrincipalTokenAuthorizer` will now properly add its auxiliary bearer tokens. - -## v12.4.2 - -### Bug Fixes - -- Improvements to the fixes made in v12.4.1. - - Remove `override` stanza from Gopkg.toml and `replace` directive from go.mod as they don't apply when being consumed as a dependency. - - Switched to latest version of `ocagent` that still depends on protobuf v1.2. - - Add indirect dependencies to the `required` clause with matching `constraint` stanzas so that `dep` dependencies match go.sum. - -## v12.4.1 - -### Bug Fixes - -- Updated OpenCensus and OCAgent versions to versions that don't depend on v1.3+ of protobuf as it was breaking kubernetes. -- Pinned opencensus-proto to a version that's compatible with our versions of OpenCensus and OCAgent. - -## v12.4.0 - -### New Features - -- Added `autorest.WithPrepareDecorators` and `autorest.GetPrepareDecorators` for adding and retrieving a custom chain of PrepareDecorators to the provided context. - -## v12.3.0 - -### New Features - -- Support for multi-tenant via x-ms-authorization-auxiliary header has been added for client credentials with - secret scenario; this basically bundles multiple OAuthConfig and ServicePrincipalToken types into corresponding - MultiTenant* types along with a new authorizer that adds the primary and auxiliary token headers to the reqest. - The authenticaion helpers have been updated to support this scenario; if environment var AZURE_AUXILIARY_TENANT_IDS - is set with a semicolon delimited list of tenants the multi-tenant codepath will kick in to create the appropriate authorizer. - See `adal.NewMultiTenantOAuthConfig`, `adal.NewMultiTenantServicePrincipalToken` and `autorest.NewMultiTenantServicePrincipalTokenAuthorizer` - along with their supporting types and methods. -- Added `autorest.WithSendDecorators` and `autorest.GetSendDecorators` for adding and retrieving a custom chain of SendDecorators to the provided context. -- Added `autorest.DoRetryForStatusCodesWithCap` and `autorest.DelayForBackoffWithCap` to enforce an upper bound on the duration between retries. - -## v12.2.0 - -### New Features - -- Added `autorest.WithXML`, `autorest.AsMerge`, `autorest.WithBytes` preparer decorators. -- Added `autorest.ByUnmarshallingBytes` response decorator. -- Added `Response.IsHTTPStatus` and `Response.HasHTTPStatus` helper methods for inspecting HTTP status code in `autorest.Response` types. - -### Bug Fixes - -- `autorest.DelayWithRetryAfter` now supports HTTP-Dates in the `Retry-After` header and is not limited to just 429 status codes. - -## v12.1.0 - -### New Features - -- Added `to.ByteSlicePtr()`. -- Added blob/queue storage resource ID to `azure.ResourceIdentifier`. - -## v12.0.0 - -### Breaking Changes - -In preparation for modules the following deprecated content has been removed. - - - async.NewFuture() - - async.Future.Done() - - async.Future.WaitForCompletion() - - async.DoPollForAsynchronous() - - The `utils` package - - validation.NewErrorWithValidationError() - - The `version` package - -## v11.9.0 - -### New Features - -- Add `ResourceIdentifiers` field to `azure.Environment` containing resource IDs for public and sovereign clouds. - -## v11.8.0 - -### New Features - -- Added `autorest.NewClientWithOptions()` to support endpoints that require free renegotiation. - -## v11.7.1 - -### Bug Fixes - -- Fix missing support for http(s) proxy when using the default sender. - -## v11.7.0 - -### New Features - -- Added methods to obtain a ServicePrincipalToken on the various credential configuration types in the `auth` package. - -## v11.6.1 - -### Bug Fixes - -- Fix ACR DNS endpoint for government clouds. -- Add Cosmos DB DNS endpoints. -- Update dependencies to resolve build breaks in OpenCensus. - -## v11.6.0 - -### New Features - -- Added type `autorest.BasicAuthorizer` to support Basic authentication. - -## v11.5.2 - -### Bug Fixes - -- Fixed `GetTokenFromCLI` did not work with zsh. - -## v11.5.1 - -### Bug Fixes - -- In `Client.sender()` set the minimum TLS version on HTTP clients to 1.2. - -## v11.5.0 - -### New Features - -- The `auth` package has been refactored so that the environment and file settings are now available. -- The methods used in `auth.NewAuthorizerFromEnvironment()` are now exported so that custom authorization chains can be created. -- Added support for certificate authorization for file-based config. - -## v11.4.0 - -### New Features - -- Added `adal.AddToUserAgent()` so callers can append custom data to the user-agent header used for ADAL requests. -- Exported `adal.UserAgent()` for parity with `autorest.Client`. - -## v11.3.2 - -### Bug Fixes - -- In `Future.WaitForCompletionRef()` if the provided context has a deadline don't add the default deadline. - -## v11.3.1 - -### Bug Fixes - -- For an LRO PUT operation the final GET URL was incorrectly set to the Location polling header in some cases. - -## v11.3.0 - -### New Features - -- Added method `ServicePrincipalToken()` to `DeviceFlowConfig` type. - -## v11.2.8 - -### Bug Fixes - -- Deprecate content in the `version` package. The functionality has been superseded by content in the `autorest` package. - -## v11.2.7 - -### Bug Fixes - -- Fix environment variable name for enabling tracing from `AZURE_SDK_TRACING_ENABELD` to `AZURE_SDK_TRACING_ENABLED`. - Note that for backward compatibility reasons, both will work until the next major version release of the package. - -## v11.2.6 - -### Bug Fixes - -- If zero bytes are read from a polling response body don't attempt to unmarshal them. - -## v11.2.5 - -### Bug Fixes - -- Removed race condition in `autorest.DoRetryForStatusCodes`. - -## v11.2.4 - -### Bug Fixes - -- Function `cli.ProfilePath` now respects environment `AZURE_CONFIG_DIR` if available. - -## v11.2.1 - -NOTE: Versions of Go prior to 1.10 have been removed from CI as they no -longer work with golint. - -### Bug Fixes - -- Method `MSIConfig.Authorizer` now supports user-assigned identities. -- The adal package now reports its own user-agent string. - -## v11.2.0 - -### New Features - -- Added `tracing` package that enables instrumentation of HTTP and API calls. - Setting the env variable `AZURE_SDK_TRACING_ENABLED` or calling `tracing.Enable` - will start instrumenting the code for metrics and traces. - Additionally, setting the env variable `OCAGENT_TRACE_EXPORTER_ENDPOINT` or - calling `tracing.EnableWithAIForwarding` will start the instrumentation and connect to an - App Insights Local Forwarder that is needs to be running. Note that if the - AI Local Forwarder is not running tracking will still be enabled. - By default, instrumentation is disabled. Once enabled, instrumentation can also - be programatically disabled by calling `Disable`. -- Added `DoneWithContext` call for checking LRO status. `Done` has been deprecated. - -### Bug Fixes - -- Don't use the initial request's context for LRO polling. -- Don't override the `refreshLock` and the `http.Client` when unmarshalling `ServicePrincipalToken` if - it is already set. - -## v11.1.1 - -### Bug Fixes - -- When creating a future always include the polling tracker even if there's a failure; this allows the underlying response to be obtained by the caller. - -## v11.1.0 - -### New Features - -- Added `auth.NewAuthorizerFromCLI` to create an authorizer configured from the Azure 2.0 CLI. -- Added `adal.NewOAuthConfigWithAPIVersion` to create an OAuthConfig with the specified API version. - -## v11.0.1 - -### New Features - -- Added `x5c` header to client assertion for certificate Issuer+Subject Name authentication. - -## v11.0.0 - -### Breaking Changes - -- To handle differences between ADFS and AAD the following fields have had their types changed from `string` to `json.Number` - - ExpiresIn - - ExpiresOn - - NotBefore - -### New Features - -- Added `auth.NewAuthorizerFromFileWithResource` to create an authorizer from the config file with the specified resource. -- Setting a client's `PollingDuration` to zero will use the provided context to control a LRO's polling duration. - -## v10.15.5 - -### Bug Fixes - -- In `DoRetryForStatusCodes`, if a request's context is cancelled return the last response. - -## v10.15.4 - -### Bug Fixes - -- If a polling operation returns a failure status code return the associated error. - -## v10.15.3 - -### Bug Fixes - -- Initialize the polling URL and method for an LRO tracker on each iteration, favoring the Azure-AsyncOperation header. - -## v10.15.2 - -### Bug Fixes - -- Use fmt.Fprint when printing request/response so that any escape sequences aren't treated as format specifiers. - -## v10.15.1 - -### Bug Fixes - -- If an LRO API returns a `Failed` provisioning state in the initial response return an error at that point so the caller doesn't have to poll. -- For failed LROs without an OData v4 error include the response body in the error's `AdditionalInfo` field to aid in diagnosing the failure. - -## v10.15.0 - -### New Features - -- Add initial support for request/response logging via setting environment variables. - Setting `AZURE_GO_SDK_LOG_LEVEL` to `LogInfo` will log request/response - without their bodies. To include the bodies set the log level to `LogDebug`. - By default the logger writes to strerr, however it can also write to stdout or a file - if specified in `AZURE_GO_SDK_LOG_FILE`. Note that if the specified file - already exists it will be truncated. - IMPORTANT: by default the logger will redact the Authorization and Ocp-Apim-Subscription-Key - headers. Any other secrets will _not_ be redacted. - -## v10.14.0 - -### New Features - -- Added package version that contains version constants and user-agent data. - -### Bug Fixes - -- Add the user-agent to token requests. - -## v10.13.0 - -- Added support for additionalInfo in ServiceError type. - -## v10.12.0 - -### New Features - -- Added field ServicePrincipalToken.MaxMSIRefreshAttempts to configure the maximun number of attempts to refresh an MSI token. - -## v10.11.4 - -### Bug Fixes - -- If an LRO returns http.StatusOK on the initial response with no async headers return the response body from Future.GetResult(). -- If there is no "final GET URL" return an error from Future.GetResult(). - -## v10.11.3 - -### Bug Fixes - -- In IMDS retry logic, if we don't receive a response don't retry. - - Renamed the retry function so it's clear it's meant for IMDS only. -- For error response bodies that aren't OData-v4 compliant stick the raw JSON in the ServiceError.Details field so the information isn't lost. - - Also add the raw HTTP response to the DetailedResponse. -- Removed superfluous wrapping of response error in azure.DoRetryWithRegistration(). - -## v10.11.2 - -### Bug Fixes - -- Validation for integers handles int and int64 types. - -## v10.11.1 - -### Bug Fixes - -- Adding User information to authorization config as parsed from CLI cache. - -## v10.11.0 - -### New Features - -- Added NewServicePrincipalTokenFromManualTokenSecret for creating a new SPT using a manual token and secret -- Added method ServicePrincipalToken.MarshalTokenJSON() to marshall the inner Token - -## v10.10.0 - -### New Features - -- Most ServicePrincipalTokens can now be marshalled/unmarshall to/from JSON (ServicePrincipalCertificateSecret and ServicePrincipalMSISecret are not supported). -- Added method ServicePrincipalToken.SetRefreshCallbacks(). - -## v10.9.2 - -### Bug Fixes - -- Refreshing a refresh token obtained from a web app authorization code now works. - -## v10.9.1 - -### Bug Fixes - -- The retry logic for MSI token requests now uses exponential backoff per the guidelines. -- IsTemporaryNetworkError() will return true for errors that don't implement the net.Error interface. - -## v10.9.0 - -### Deprecated Methods - -| Old Method | New Method | -| -------------------------: | :---------------------------: | -| azure.NewFuture() | azure.NewFutureFromResponse() | -| Future.WaitForCompletion() | Future.WaitForCompletionRef() | - -### New Features - -- Added azure.NewFutureFromResponse() for creating a Future from the initial response from an async operation. -- Added Future.GetResult() for making the final GET call to retrieve the result from an async operation. - -### Bug Fixes - -- Some futures failed to return their results, this should now be fixed. - -## v10.8.2 - -### Bug Fixes - -- Add nil-gaurd to token retry logic. - -## v10.8.1 - -### Bug Fixes - -- Return a TokenRefreshError if the sender fails on the initial request. -- Don't retry on non-temporary network errors. - -## v10.8.0 - -- Added NewAuthorizerFromEnvironmentWithResource() helper function. - -## v10.7.0 - -### New Features - -- Added \*WithContext() methods to ADAL token refresh operations. - -## v10.6.2 - -- Fixed a bug on device authentication. - -## v10.6.1 - -- Added retries to MSI token get request. - -## v10.6.0 - -- Changed MSI token implementation. Now, the token endpoint is the IMDS endpoint. - -## v10.5.1 - -### Bug Fixes - -- `DeviceFlowConfig.Authorizer()` now prints the device code message when running `go test`. `-v` flag is required. - -## v10.5.0 - -### New Features - -- Added NewPollingRequestWithContext() for use with polling asynchronous operations. - -### Bug Fixes - -- Make retry logic use the request's context instead of the deprecated Cancel object. - -## v10.4.0 - -### New Features - -- Added helper for parsing Azure Resource ID's. -- Added deprecation message to utils.GetEnvVarOrExit() - -## v10.3.0 - -### New Features - -- Added EnvironmentFromURL method to load an Environment from a given URL. This function is particularly useful in the private and hybrid Cloud model, where one may define their own endpoints -- Added TokenAudience endpoint to Environment structure. This is useful in private and hybrid cloud models where TokenAudience endpoint can be different from ResourceManagerEndpoint - -## v10.2.0 - -### New Features - -- Added endpoints for batch management. - -## v10.1.3 - -### Bug Fixes - -- In Client.Do() invoke WithInspection() last so that it will inspect WithAuthorization(). -- Fixed authorization methods to invoke p.Prepare() first, aligning them with the other preparers. - -## v10.1.2 - -- Corrected comment for auth.NewAuthorizerFromFile() function. - -## v10.1.1 - -- Updated version number to match current release. - -## v10.1.0 - -### New Features - -- Expose the polling URL for futures. - -### Bug Fixes - -- Add validation.NewErrorWithValidationError back to prevent breaking changes (it is deprecated). - -## v10.0.0 - -### New Features - -- Added target and innererror fields to ServiceError to comply with OData v4 spec. -- The Done() method on futures will now return a ServiceError object when available (it used to return a partial value of such errors). -- Added helper methods for obtaining authorizers. -- Expose the polling URL for futures. - -### Bug Fixes - -- Switched from glide to dep for dependency management. -- Fixed unmarshaling of ServiceError for JSON bodies that don't conform to the OData spec. -- Fixed a race condition in token refresh. - -### Breaking Changes - -- The ServiceError.Details field type has been changed to match the OData v4 spec. -- Go v1.7 has been dropped from CI. -- API parameter validation failures will now return a unique error type validation.Error. -- The adal.Token type has been decomposed from adal.ServicePrincipalToken (this was necessary in order to fix the token refresh race). - -## v9.10.0 - -- Fix the Service Bus suffix in Azure public env -- Add Service Bus Endpoint (AAD ResourceURI) for use in [Azure Service Bus RBAC Preview](https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-role-based-access-control) - -## v9.9.0 - -### New Features - -- Added EventGridKeyAuthorizer for key authorization with event grid topics. - -### Bug Fixes - -- Fixed race condition when auto-refreshing service principal tokens. - -## v9.8.1 - -### Bug Fixes - -- Added http.StatusNoContent (204) to the list of expected status codes for long-running operations. -- Updated runtime version info so it's current. - -## v9.8.0 - -### New Features - -- Added type azure.AsyncOpIncompleteError to be returned from a future's Result() method when the operation has not completed. - -## v9.7.1 - -### Bug Fixes - -- Use correct AAD and Graph endpoints for US Gov environment. - -## v9.7.0 - -### New Features - -- Added support for application/octet-stream MIME types. - -## v9.6.1 - -### Bug Fixes - -- Ensure Authorization header is added to request when polling for registration status. - -## v9.6.0 - -### New Features - -- Added support for acquiring tokens via MSI with a user assigned identity. - -## v9.5.3 - -### Bug Fixes - -- Don't remove encoding of existing URL Query parameters when calling autorest.WithQueryParameters. -- Set correct Content Type when using autorest.WithFormData. - -## v9.5.2 - -### Bug Fixes - -- Check for nil \*http.Response before dereferencing it. - -## v9.5.1 - -### Bug Fixes - -- Don't count http.StatusTooManyRequests (429) against the retry cap. -- Use retry logic when SkipResourceProviderRegistration is set to true. - -## v9.5.0 - -### New Features - -- Added support for username + password, API key, authoriazation code and cognitive services authentication. -- Added field SkipResourceProviderRegistration to clients to provide a way to skip auto-registration of RPs. -- Added utility function AsStringSlice() to convert its parameters to a string slice. - -### Bug Fixes - -- When checking for authentication failures look at the error type not the status code as it could vary. - -## v9.4.2 - -### Bug Fixes - -- Validate parameters when creating credentials. -- Don't retry requests if the returned status is a 401 (http.StatusUnauthorized) as it will never succeed. - -## v9.4.1 - -### Bug Fixes - -- Update the AccessTokensPath() to read access tokens path through AZURE_ACCESS_TOKEN_FILE. If this - environment variable is not set, it will fall back to use default path set by Azure CLI. -- Use case-insensitive string comparison for polling states. - -## v9.4.0 - -### New Features - -- Added WaitForCompletion() to Future as a default polling implementation. - -### Bug Fixes - -- Method Future.Done() shouldn't update polling status for unexpected HTTP status codes. - -## v9.3.1 - -### Bug Fixes - -- DoRetryForStatusCodes will retry if sender.Do returns a non-nil error. - -## v9.3.0 - -### New Features - -- Added PollingMethod() to Future so callers know what kind of polling mechanism is used. -- Added azure.ChangeToGet() which transforms an http.Request into a GET (to be used with LROs). - -## v9.2.0 - -### New Features - -- Added support for custom Azure Stack endpoints. -- Added type azure.Future used to track the status of long-running operations. - -### Bug Fixes - -- Preserve the original error in DoRetryWithRegistration when registration fails. - -## v9.1.1 - -- Fixes a bug regarding the cookie jar on `autorest.Client.Sender`. - -## v9.1.0 - -### New Features - -- In cases where there is a non-empty error from the service, attempt to unmarshal it instead of uniformly calling it an "Unknown" error. -- Support for loading Azure CLI Authentication files. -- Automatically register your subscription with the Azure Resource Provider if it hadn't been previously. - -### Bug Fixes - -- RetriableRequest can now tolerate a ReadSeekable body being read but not reset. -- Adding missing Apache Headers - -## v9.0.0 - -> **IMPORTANT:** This release was intially labeled incorrectly as `v8.4.0`. From the time it was released, it should have been marked `v9.0.0` because it contains breaking changes to the MSI packages. We appologize for any inconvenience this causes. - -Adding MSI Endpoint Support and CLI token rehydration. - -## v8.3.1 - -Pick up bug fix in adal for MSI support. - -## v8.3.0 - -Updates to Error string formats for clarity. Also, adding a copy of the http.Response to errors for an improved debugging experience. - -## v8.2.0 - -### New Features - -- Add support for bearer authentication callbacks -- Support 429 response codes that include "Retry-After" header -- Support validation constraint "Pattern" for map keys - -### Bug Fixes - -- Make RetriableRequest work with multiple versions of Go - -## v8.1.1 - -Updates the RetriableRequest to take advantage of GetBody() added in Go 1.8. - -## v8.1.0 - -Adds RetriableRequest type for more efficient handling of retrying HTTP requests. - -## v8.0.0 - -ADAL refactored into its own package. -Support for UNIX time. - -## v7.3.1 - -- Version Testing now removed from production bits that are shipped with the library. - -## v7.3.0 - -- Exposing new `RespondDecorator`, `ByDiscardingBody`. This allows operations - to acknowledge that they do not need either the entire or a trailing portion - of accepts response body. In doing so, Go's http library can reuse HTTP - connections more readily. -- Adding `PrepareDecorator` to target custom BaseURLs. -- Adding ACR suffix to public cloud environment. -- Updating Glide dependencies. - -## v7.2.5 - -- Fixed the Active Directory endpoint for the China cloud. -- Removes UTF-8 BOM if present in response payload. -- Added telemetry. - -## v7.2.3 - -- Fixing bug in calls to `DelayForBackoff` that caused doubling of delay - duration. - -## v7.2.2 - -- autorest/azure: added ASM and ARM VM DNS suffixes. - -## v7.2.1 - -- fixed parsing of UTC times that are not RFC3339 conformant. - -## v7.2.0 - -- autorest/validation: Reformat validation error for better error message. - -## v7.1.0 - -- preparer: Added support for multipart formdata - WithMultiPartFormdata() -- preparer: Added support for sending file in request body - WithFile -- client: Added RetryDuration parameter. -- autorest/validation: new package for validation code for Azure Go SDK. - -## v7.0.7 - -- Add trailing / to endpoint -- azure: add EnvironmentFromName - -## v7.0.6 - -- Add retry logic for 408, 500, 502, 503 and 504 status codes. -- Change url path and query encoding logic. -- Fix DelayForBackoff for proper exponential delay. -- Add CookieJar in Client. - -## v7.0.5 - -- Add check to start polling only when status is in [200,201,202]. -- Refactoring for unchecked errors. -- azure/persist changes. -- Fix 'file in use' issue in renewing token in deviceflow. -- Store header RetryAfter for subsequent requests in polling. -- Add attribute details in service error. - -## v7.0.4 - -- Better error messages for long running operation failures - -## v7.0.3 - -- Corrected DoPollForAsynchronous to properly handle the initial response - -## v7.0.2 - -- Corrected DoPollForAsynchronous to continue using the polling method first discovered - -## v7.0.1 - -- Fixed empty JSON input error in ByUnmarshallingJSON -- Fixed polling support for GET calls -- Changed format name from TimeRfc1123 to TimeRFC1123 - -## v7.0.0 - -- Added ByCopying responder with supporting TeeReadCloser -- Rewrote Azure asynchronous handling -- Reverted to only unmarshalling JSON -- Corrected handling of RFC3339 time strings and added support for Rfc1123 time format - -The `json.Decoder` does not catch bad data as thoroughly as `json.Unmarshal`. Since -`encoding/json` successfully deserializes all core types, and extended types normally provide -their custom JSON serialization handlers, the code has been reverted back to using -`json.Unmarshal`. The original change to use `json.Decode` was made to reduce duplicate -code; there is no loss of function, and there is a gain in accuracy, by reverting. - -Additionally, Azure services indicate requests to be polled by multiple means. The existing code -only checked for one of those (that is, the presence of the `Azure-AsyncOperation` header). -The new code correctly covers all cases and aligns with the other Azure SDKs. - -## v6.1.0 - -- Introduced `date.ByUnmarshallingJSONDate` and `date.ByUnmarshallingJSONTime` to enable JSON encoded values. - -## v6.0.0 - -- Completely reworked the handling of polled and asynchronous requests -- Removed unnecessary routines -- Reworked `mocks.Sender` to replay a series of `http.Response` objects -- Added `PrepareDecorators` for primitive types (e.g., bool, int32) - -Handling polled and asynchronous requests is no longer part of `Client#Send`. Instead new -`SendDecorators` implement different styles of polled behavior. See`autorest.DoPollForStatusCodes` -and `azure.DoPollForAsynchronous` for examples. - -## v5.0.0 - -- Added new RespondDecorators unmarshalling primitive types -- Corrected application of inspection and authorization PrependDecorators - -## v4.0.0 - -- Added support for Azure long-running operations. -- Added cancelation support to all decorators and functions that may delay. -- Breaking: `DelayForBackoff` now accepts a channel, which may be nil. - -## v3.1.0 - -- Add support for OAuth Device Flow authorization. -- Add support for ServicePrincipalTokens that are backed by an existing token, rather than other secret material. -- Add helpers for persisting and restoring Tokens. -- Increased code coverage in the github.com/Azure/autorest/azure package - -## v3.0.0 - -- Breaking: `NewErrorWithError` no longer takes `statusCode int`. -- Breaking: `NewErrorWithStatusCode` is replaced with `NewErrorWithResponse`. -- Breaking: `Client#Send()` no longer takes `codes ...int` argument. -- Add: XML unmarshaling support with `ByUnmarshallingXML()` -- Stopped vending dependencies locally and switched to [Glide](https://github.com/Masterminds/glide). - Applications using this library should either use Glide or vendor dependencies locally some other way. -- Add: `azure.WithErrorUnlessStatusCode()` decorator to handle Azure errors. -- Fix: use `net/http.DefaultClient` as base client. -- Fix: Missing inspection for polling responses added. -- Add: CopyAndDecode helpers. -- Improved `./autorest/to` with `[]string` helpers. -- Removed golint suppressions in .travis.yml. - -## v2.1.0 - -- Added `StatusCode` to `Error` for more easily obtaining the HTTP Reponse StatusCode (if any) - -## v2.0.0 - -- Changed `to.StringMapPtr` method signature to return a pointer -- Changed `ServicePrincipalCertificateSecret` and `NewServicePrincipalTokenFromCertificate` to support generic certificate and private keys - -## v1.0.0 - -- Added Logging inspectors to trace http.Request / Response -- Added support for User-Agent header -- Changed WithHeader PrepareDecorator to use set vs. add -- Added JSON to error when unmarshalling fails -- Added Client#Send method -- Corrected case of "Azure" in package paths -- Added "to" helpers, Azure helpers, and improved ease-of-use -- Corrected golint issues - -## v1.0.1 - -- Added CHANGELOG.md - -## v1.1.0 - -- Added mechanism to retrieve a ServicePrincipalToken using a certificate-signed JWT -- Added an example of creating a certificate-based ServicePrincipal and retrieving an OAuth token using the certificate - -## v1.1.1 - -- Introduce godeps and vendor dependencies introduced in v1.1.1 diff --git a/vendor/github.com/Azure/go-autorest/GNUmakefile b/vendor/github.com/Azure/go-autorest/GNUmakefile deleted file mode 100644 index a434e73ac4..0000000000 --- a/vendor/github.com/Azure/go-autorest/GNUmakefile +++ /dev/null @@ -1,23 +0,0 @@ -DIR?=./autorest/ - -default: build - -build: fmt - go install $(DIR) - -test: - go test $(DIR) || exit 1 - -vet: - @echo "go vet ." - @go vet $(DIR)... ; if [ $$? -eq 1 ]; then \ - echo ""; \ - echo "Vet found suspicious constructs. Please check the reported constructs"; \ - echo "and fix them if necessary before submitting the code for review."; \ - exit 1; \ - fi - -fmt: - gofmt -w $(DIR) - -.PHONY: build test vet fmt diff --git a/vendor/github.com/Azure/go-autorest/Gopkg.lock b/vendor/github.com/Azure/go-autorest/Gopkg.lock deleted file mode 100644 index dc6e3e633e..0000000000 --- a/vendor/github.com/Azure/go-autorest/Gopkg.lock +++ /dev/null @@ -1,324 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - digest = "1:892e39e5c083d0943f1e80ab8351690f183c6a5ab24e1d280adcad424c26255e" - name = "contrib.go.opencensus.io/exporter/ocagent" - packages = ["."] - pruneopts = "UT" - revision = "a8a6f458bbc1d5042322ad1f9b65eeb0b69be9ea" - version = "v0.6.0" - -[[projects]] - digest = "1:8f5acd4d4462b5136af644d25101f0968a7a94ee90fcb2059cec5b7cc42e0b20" - name = "github.com/census-instrumentation/opencensus-proto" - packages = [ - "gen-go/agent/common/v1", - "gen-go/agent/metrics/v1", - "gen-go/agent/trace/v1", - "gen-go/metrics/v1", - "gen-go/resource/v1", - "gen-go/trace/v1", - ] - pruneopts = "UT" - revision = "d89fa54de508111353cb0b06403c00569be780d8" - version = "v0.2.1" - -[[projects]] - digest = "1:ffe9824d294da03b391f44e1ae8281281b4afc1bdaa9588c9097785e3af10cec" - name = "github.com/davecgh/go-spew" - packages = ["spew"] - pruneopts = "UT" - revision = "8991bc29aa16c548c550c7ff78260e27b9ab7c73" - version = "v1.1.1" - -[[projects]] - digest = "1:76dc72490af7174349349838f2fe118996381b31ea83243812a97e5a0fd5ed55" - name = "github.com/dgrijalva/jwt-go" - packages = ["."] - pruneopts = "UT" - revision = "06ea1031745cb8b3dab3f6a236daf2b0aa468b7e" - version = "v3.2.0" - -[[projects]] - digest = "1:cf0d2e435fd4ce45b789e93ef24b5f08e86be0e9807a16beb3694e2d8c9af965" - name = "github.com/dimchansky/utfbom" - packages = ["."] - pruneopts = "UT" - revision = "d2133a1ce379ef6fa992b0514a77146c60db9d1c" - version = "v1.1.0" - -[[projects]] - branch = "master" - digest = "1:b7cb6054d3dff43b38ad2e92492f220f57ae6087ee797dca298139776749ace8" - name = "github.com/golang/groupcache" - packages = ["lru"] - pruneopts = "UT" - revision = "611e8accdfc92c4187d399e95ce826046d4c8d73" - -[[projects]] - digest = "1:e3839df32927e8d3403cd5aa7253d966e8ff80fc8f10e2e35d146461cd83fcfa" - name = "github.com/golang/protobuf" - packages = [ - "descriptor", - "jsonpb", - "proto", - "protoc-gen-go/descriptor", - "ptypes", - "ptypes/any", - "ptypes/duration", - "ptypes/struct", - "ptypes/timestamp", - "ptypes/wrappers", - ] - pruneopts = "UT" - revision = "6c65a5562fc06764971b7c5d05c76c75e84bdbf7" - version = "v1.3.2" - -[[projects]] - digest = "1:c560cd79300fac84f124b96225181a637a70b60155919a3c36db50b7cca6b806" - name = "github.com/grpc-ecosystem/grpc-gateway" - packages = [ - "internal", - "runtime", - "utilities", - ] - pruneopts = "UT" - revision = "f7120437bb4f6c71f7f5076ad65a45310de2c009" - version = "v1.12.1" - -[[projects]] - digest = "1:5d231480e1c64a726869bc4142d270184c419749d34f167646baa21008eb0a79" - name = "github.com/mitchellh/go-homedir" - packages = ["."] - pruneopts = "UT" - revision = "af06845cf3004701891bf4fdb884bfe4920b3727" - version = "v1.1.0" - -[[projects]] - digest = "1:0028cb19b2e4c3112225cd871870f2d9cf49b9b4276531f03438a88e94be86fe" - name = "github.com/pmezard/go-difflib" - packages = ["difflib"] - pruneopts = "UT" - revision = "792786c7400a136282c1664665ae0a8db921c6c2" - version = "v1.0.0" - -[[projects]] - digest = "1:99d32780e5238c2621fff621123997c3e3cca96db8be13179013aea77dfab551" - name = "github.com/stretchr/testify" - packages = [ - "assert", - "require", - ] - pruneopts = "UT" - revision = "221dbe5ed46703ee255b1da0dec05086f5035f62" - version = "v1.4.0" - -[[projects]] - digest = "1:7c5e00383399fe13de0b4b65c9fdde16275407ce8ac02d867eafeaa916edcc71" - name = "go.opencensus.io" - packages = [ - ".", - "internal", - "internal/tagencoding", - "metric/metricdata", - "metric/metricproducer", - "plugin/ocgrpc", - "plugin/ochttp", - "plugin/ochttp/propagation/b3", - "plugin/ochttp/propagation/tracecontext", - "resource", - "stats", - "stats/internal", - "stats/view", - "tag", - "trace", - "trace/internal", - "trace/propagation", - "trace/tracestate", - ] - pruneopts = "UT" - revision = "aad2c527c5defcf89b5afab7f37274304195a6b2" - version = "v0.22.2" - -[[projects]] - branch = "master" - digest = "1:f604f5e2ee721b6757d962dfe7bab4f28aae50c456e39cfb2f3819762a44a6ae" - name = "golang.org/x/crypto" - packages = [ - "pkcs12", - "pkcs12/internal/rc2", - ] - pruneopts = "UT" - revision = "e9b2fee46413994441b28dfca259d911d963dfed" - -[[projects]] - branch = "master" - digest = "1:334b27eac455cb6567ea28cd424230b07b1a64334a2f861a8075ac26ce10af43" - name = "golang.org/x/lint" - packages = [ - ".", - "golint", - ] - pruneopts = "UT" - revision = "fdd1cda4f05fd1fd86124f0ef9ce31a0b72c8448" - -[[projects]] - branch = "master" - digest = "1:257a75d024975428ab9192bfc334c3490882f8cb21322ea5784ca8eca000a910" - name = "golang.org/x/net" - packages = [ - "http/httpguts", - "http2", - "http2/hpack", - "idna", - "internal/timeseries", - "trace", - ] - pruneopts = "UT" - revision = "1ddd1de85cb0337b623b740a609d35817d516a8d" - -[[projects]] - branch = "master" - digest = "1:382bb5a7fb4034db3b6a2d19e5a4a6bcf52f4750530603c01ca18a172fa3089b" - name = "golang.org/x/sync" - packages = ["semaphore"] - pruneopts = "UT" - revision = "cd5d95a43a6e21273425c7ae415d3df9ea832eeb" - -[[projects]] - branch = "master" - digest = "1:4da420ceda5f68e8d748aa2169d0ed44ffadb1bbd6537cf778a49563104189b8" - name = "golang.org/x/sys" - packages = ["unix"] - pruneopts = "UT" - revision = "ce4227a45e2eb77e5c847278dcc6a626742e2945" - -[[projects]] - digest = "1:8d8faad6b12a3a4c819a3f9618cb6ee1fa1cfc33253abeeea8b55336721e3405" - name = "golang.org/x/text" - packages = [ - "collate", - "collate/build", - "internal/colltab", - "internal/gen", - "internal/language", - "internal/language/compact", - "internal/tag", - "internal/triegen", - "internal/ucd", - "language", - "secure/bidirule", - "transform", - "unicode/bidi", - "unicode/cldr", - "unicode/norm", - "unicode/rangetable", - ] - pruneopts = "UT" - revision = "342b2e1fbaa52c93f31447ad2c6abc048c63e475" - version = "v0.3.2" - -[[projects]] - branch = "master" - digest = "1:4eb5ea8395fb60212dd58b92c9db80bab59d5e99c7435f9a6a0a528c373b60e7" - name = "golang.org/x/tools" - packages = [ - "go/ast/astutil", - "go/gcexportdata", - "go/internal/gcimporter", - "go/types/typeutil", - ] - pruneopts = "UT" - revision = "259af5ff87bdcd4abf2ecda8edc3f13f04f26a42" - -[[projects]] - digest = "1:964bb30febc27fabfbec4759fa530c6ec35e77a7c85fed90b9317ea39a054877" - name = "google.golang.org/api" - packages = ["support/bundler"] - pruneopts = "UT" - revision = "8a410c21381766a810817fd6200fce8838ecb277" - version = "v0.14.0" - -[[projects]] - branch = "master" - digest = "1:a8d5c2c6e746b3485e36908ab2a9e3d77b86b81f8156d88403c7d2b462431dfd" - name = "google.golang.org/genproto" - packages = [ - "googleapis/api/httpbody", - "googleapis/rpc/status", - "protobuf/field_mask", - ] - pruneopts = "UT" - revision = "51378566eb590fa106d1025ea12835a4416dda84" - -[[projects]] - digest = "1:b59ce3ddb11daeeccccc9cb3183b58ebf8e9a779f1c853308cd91612e817a301" - name = "google.golang.org/grpc" - packages = [ - ".", - "backoff", - "balancer", - "balancer/base", - "balancer/roundrobin", - "binarylog/grpc_binarylog_v1", - "codes", - "connectivity", - "credentials", - "credentials/internal", - "encoding", - "encoding/proto", - "grpclog", - "internal", - "internal/backoff", - "internal/balancerload", - "internal/binarylog", - "internal/buffer", - "internal/channelz", - "internal/envconfig", - "internal/grpcrand", - "internal/grpcsync", - "internal/resolver/dns", - "internal/resolver/passthrough", - "internal/syscall", - "internal/transport", - "keepalive", - "metadata", - "naming", - "peer", - "resolver", - "serviceconfig", - "stats", - "status", - "tap", - ] - pruneopts = "UT" - revision = "1a3960e4bd028ac0cec0a2afd27d7d8e67c11514" - version = "v1.25.1" - -[[projects]] - digest = "1:b75b3deb2bce8bc079e16bb2aecfe01eb80098f5650f9e93e5643ca8b7b73737" - name = "gopkg.in/yaml.v2" - packages = ["."] - pruneopts = "UT" - revision = "1f64d6156d11335c3f22d9330b0ad14fc1e789ce" - version = "v2.2.7" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - input-imports = [ - "contrib.go.opencensus.io/exporter/ocagent", - "github.com/dgrijalva/jwt-go", - "github.com/dimchansky/utfbom", - "github.com/mitchellh/go-homedir", - "github.com/stretchr/testify/require", - "go.opencensus.io/plugin/ochttp", - "go.opencensus.io/plugin/ochttp/propagation/tracecontext", - "go.opencensus.io/stats/view", - "go.opencensus.io/trace", - "golang.org/x/crypto/pkcs12", - "golang.org/x/lint/golint", - ] - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/vendor/github.com/Azure/go-autorest/Gopkg.toml b/vendor/github.com/Azure/go-autorest/Gopkg.toml deleted file mode 100644 index 1fc2865969..0000000000 --- a/vendor/github.com/Azure/go-autorest/Gopkg.toml +++ /dev/null @@ -1,59 +0,0 @@ -# Gopkg.toml example -# -# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html -# for detailed Gopkg.toml documentation. -# -# required = ["github.com/user/thing/cmd/thing"] -# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] -# -# [[constraint]] -# name = "github.com/user/project" -# version = "1.0.0" -# -# [[constraint]] -# name = "github.com/user/project2" -# branch = "dev" -# source = "github.com/myfork/project2" -# -# [[override]] -# name = "github.com/x/y" -# version = "2.4.0" -# -# [prune] -# non-go = false -# go-tests = true -# unused-packages = true - -required = ["golang.org/x/lint/golint"] - -[prune] - go-tests = true - unused-packages = true - -[[constraint]] - name = "contrib.go.opencensus.io/exporter/ocagent" - version = "0.6.0" - -[[constraint]] - name = "github.com/dgrijalva/jwt-go" - version = "3.2.0" - -[[constraint]] - name = "github.com/dimchansky/utfbom" - version = "1.1.0" - -[[constraint]] - name = "github.com/mitchellh/go-homedir" - version = "1.1.0" - -[[constraint]] - name = "github.com/stretchr/testify" - version = "1.3.0" - -[[constraint]] - name = "go.opencensus.io" - version = "0.22.0" - -[[constraint]] - branch = "master" - name = "golang.org/x/crypto" diff --git a/vendor/github.com/Azure/go-autorest/LICENSE b/vendor/github.com/Azure/go-autorest/LICENSE deleted file mode 100644 index b9d6a27ea9..0000000000 --- a/vendor/github.com/Azure/go-autorest/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2015 Microsoft Corporation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/Azure/go-autorest/README.md b/vendor/github.com/Azure/go-autorest/README.md deleted file mode 100644 index de1e19a44d..0000000000 --- a/vendor/github.com/Azure/go-autorest/README.md +++ /dev/null @@ -1,165 +0,0 @@ -# go-autorest - -[![GoDoc](https://godoc.org/github.com/Azure/go-autorest/autorest?status.png)](https://godoc.org/github.com/Azure/go-autorest/autorest) -[![Build Status](https://dev.azure.com/azure-sdk/public/_apis/build/status/go/Azure.go-autorest?branchName=master)](https://dev.azure.com/azure-sdk/public/_build/latest?definitionId=625&branchName=master) -[![Go Report Card](https://goreportcard.com/badge/Azure/go-autorest)](https://goreportcard.com/report/Azure/go-autorest) - -Package go-autorest provides an HTTP request client for use with [Autorest](https://github.com/Azure/autorest.go)-generated API client packages. - -An authentication client tested with Azure Active Directory (AAD) is also -provided in this repo in the package -`github.com/Azure/go-autorest/autorest/adal`. Despite its name, this package -is maintained only as part of the Azure Go SDK and is not related to other -"ADAL" libraries in [github.com/AzureAD](https://github.com/AzureAD). - -## Overview - -Package go-autorest implements an HTTP request pipeline suitable for use across -multiple goroutines and provides the shared routines used by packages generated -by [Autorest](https://github.com/Azure/autorest.go). - -The package breaks sending and responding to HTTP requests into three phases: Preparing, Sending, -and Responding. A typical pattern is: - -```go - req, err := Prepare(&http.Request{}, - token.WithAuthorization()) - - resp, err := Send(req, - WithLogging(logger), - DoErrorIfStatusCode(http.StatusInternalServerError), - DoCloseIfError(), - DoRetryForAttempts(5, time.Second)) - - err = Respond(resp, - ByDiscardingBody(), - ByClosing()) -``` - -Each phase relies on decorators to modify and / or manage processing. Decorators may first modify -and then pass the data along, pass the data first and then modify the result, or wrap themselves -around passing the data (such as a logger might do). Decorators run in the order provided. For -example, the following: - -```go - req, err := Prepare(&http.Request{}, - WithBaseURL("https://microsoft.com/"), - WithPath("a"), - WithPath("b"), - WithPath("c")) -``` - -will set the URL to: - -``` - https://microsoft.com/a/b/c -``` - -Preparers and Responders may be shared and re-used (assuming the underlying decorators support -sharing and re-use). Performant use is obtained by creating one or more Preparers and Responders -shared among multiple go-routines, and a single Sender shared among multiple sending go-routines, -all bound together by means of input / output channels. - -Decorators hold their passed state within a closure (such as the path components in the example -above). Be careful to share Preparers and Responders only in a context where such held state -applies. For example, it may not make sense to share a Preparer that applies a query string from a -fixed set of values. Similarly, sharing a Responder that reads the response body into a passed -struct (e.g., `ByUnmarshallingJson`) is likely incorrect. - -Errors raised by autorest objects and methods will conform to the `autorest.Error` interface. - -See the included examples for more detail. For details on the suggested use of this package by -generated clients, see the Client described below. - -## Helpers - -### Handling Swagger Dates - -The Swagger specification (https://swagger.io) that drives AutoRest -(https://github.com/Azure/autorest/) precisely defines two date forms: date and date-time. The -github.com/Azure/go-autorest/autorest/date package provides time.Time derivations to ensure correct -parsing and formatting. - -### Handling Empty Values - -In JSON, missing values have different semantics than empty values. This is especially true for -services using the HTTP PATCH verb. The JSON submitted with a PATCH request generally contains -only those values to modify. Missing values are to be left unchanged. Developers, then, require a -means to both specify an empty value and to leave the value out of the submitted JSON. - -The Go JSON package (`encoding/json`) supports the `omitempty` tag. When specified, it omits -empty values from the rendered JSON. Since Go defines default values for all base types (such as "" -for string and 0 for int) and provides no means to mark a value as actually empty, the JSON package -treats default values as meaning empty, omitting them from the rendered JSON. This means that, using -the Go base types encoded through the default JSON package, it is not possible to create JSON to -clear a value at the server. - -The workaround within the Go community is to use pointers to base types in lieu of base types within -structures that map to JSON. For example, instead of a value of type `string`, the workaround uses -`*string`. While this enables distinguishing empty values from those to be unchanged, creating -pointers to a base type (notably constant, in-line values) requires additional variables. This, for -example, - -```go - s := struct { - S *string - }{ S: &"foo" } -``` -fails, while, this - -```go - v := "foo" - s := struct { - S *string - }{ S: &v } -``` -succeeds. - -To ease using pointers, the subpackage `to` contains helpers that convert to and from pointers for -Go base types which have Swagger analogs. It also provides a helper that converts between -`map[string]string` and `map[string]*string`, enabling the JSON to specify that the value -associated with a key should be cleared. With the helpers, the previous example becomes - -```go - s := struct { - S *string - }{ S: to.StringPtr("foo") } -``` - -## Install - -```bash -go get github.com/Azure/go-autorest/autorest -go get github.com/Azure/go-autorest/autorest/azure -go get github.com/Azure/go-autorest/autorest/date -go get github.com/Azure/go-autorest/autorest/to -``` - -### Using with Go Modules -In [v12.0.1](https://github.com/Azure/go-autorest/pull/386), this repository introduced the following modules. - -- autorest/adal -- autorest/azure/auth -- autorest/azure/cli -- autorest/date -- autorest/mocks -- autorest/to -- autorest/validation -- autorest -- logger -- tracing - -Tagging cumulative SDK releases as a whole (e.g. `v12.3.0`) is still enabled to support consumers of this repo that have not yet migrated to modules. - -## License - -See LICENSE file. - ------ - -This project has adopted the [Microsoft Open Source Code of -Conduct](https://opensource.microsoft.com/codeofconduct/). For more information -see the [Code of Conduct -FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact -[opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional -questions or comments. diff --git a/vendor/github.com/Azure/go-autorest/autorest/LICENSE b/vendor/github.com/Azure/go-autorest/autorest/LICENSE deleted file mode 100644 index b9d6a27ea9..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2015 Microsoft Corporation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/LICENSE b/vendor/github.com/Azure/go-autorest/autorest/adal/LICENSE deleted file mode 100644 index b9d6a27ea9..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2015 Microsoft Corporation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/README.md b/vendor/github.com/Azure/go-autorest/autorest/adal/README.md deleted file mode 100644 index fec416a9c4..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/README.md +++ /dev/null @@ -1,292 +0,0 @@ -# Azure Active Directory authentication for Go - -This is a standalone package for authenticating with Azure Active -Directory from other Go libraries and applications, in particular the [Azure SDK -for Go](https://github.com/Azure/azure-sdk-for-go). - -Note: Despite the package's name it is not related to other "ADAL" libraries -maintained in the [github.com/AzureAD](https://github.com/AzureAD) org. Issues -should be opened in [this repo's](https://github.com/Azure/go-autorest/issues) -or [the SDK's](https://github.com/Azure/azure-sdk-for-go/issues) issue -trackers. - -## Install - -```bash -go get -u github.com/Azure/go-autorest/autorest/adal -``` - -## Usage - -An Active Directory application is required in order to use this library. An application can be registered in the [Azure Portal](https://portal.azure.com/) by following these [guidelines](https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-integrating-applications) or using the [Azure CLI](https://github.com/Azure/azure-cli). - -### Register an Azure AD Application with secret - - -1. Register a new application with a `secret` credential - - ``` - az ad app create \ - --display-name example-app \ - --homepage https://example-app/home \ - --identifier-uris https://example-app/app \ - --password secret - ``` - -2. Create a service principal using the `Application ID` from previous step - - ``` - az ad sp create --id "Application ID" - ``` - - * Replace `Application ID` with `appId` from step 1. - -### Register an Azure AD Application with certificate - -1. Create a private key - - ``` - openssl genrsa -out "example-app.key" 2048 - ``` - -2. Create the certificate - - ``` - openssl req -new -key "example-app.key" -subj "/CN=example-app" -out "example-app.csr" - openssl x509 -req -in "example-app.csr" -signkey "example-app.key" -out "example-app.crt" -days 10000 - ``` - -3. Create the PKCS12 version of the certificate containing also the private key - - ``` - openssl pkcs12 -export -out "example-app.pfx" -inkey "example-app.key" -in "example-app.crt" -passout pass: - - ``` - -4. Register a new application with the certificate content form `example-app.crt` - - ``` - certificateContents="$(tail -n+2 "example-app.crt" | head -n-1)" - - az ad app create \ - --display-name example-app \ - --homepage https://example-app/home \ - --identifier-uris https://example-app/app \ - --key-usage Verify --end-date 2018-01-01 \ - --key-value "${certificateContents}" - ``` - -5. Create a service principal using the `Application ID` from previous step - - ``` - az ad sp create --id "APPLICATION_ID" - ``` - - * Replace `APPLICATION_ID` with `appId` from step 4. - - -### Grant the necessary permissions - -Azure relies on a Role-Based Access Control (RBAC) model to manage the access to resources at a fine-grained -level. There is a set of [pre-defined roles](https://docs.microsoft.com/en-us/azure/active-directory/role-based-access-built-in-roles) -which can be assigned to a service principal of an Azure AD application depending of your needs. - -``` -az role assignment create --assigner "SERVICE_PRINCIPAL_ID" --role "ROLE_NAME" -``` - -* Replace the `SERVICE_PRINCIPAL_ID` with the `appId` from previous step. -* Replace the `ROLE_NAME` with a role name of your choice. - -It is also possible to define custom role definitions. - -``` -az role definition create --role-definition role-definition.json -``` - -* Check [custom roles](https://docs.microsoft.com/en-us/azure/active-directory/role-based-access-control-custom-roles) for more details regarding the content of `role-definition.json` file. - - -### Acquire Access Token - -The common configuration used by all flows: - -```Go -const activeDirectoryEndpoint = "https://login.microsoftonline.com/" -tenantID := "TENANT_ID" -oauthConfig, err := adal.NewOAuthConfig(activeDirectoryEndpoint, tenantID) - -applicationID := "APPLICATION_ID" - -callback := func(token adal.Token) error { - // This is called after the token is acquired -} - -// The resource for which the token is acquired -resource := "https://management.core.windows.net/" -``` - -* Replace the `TENANT_ID` with your tenant ID. -* Replace the `APPLICATION_ID` with the value from previous section. - -#### Client Credentials - -```Go -applicationSecret := "APPLICATION_SECRET" - -spt, err := adal.NewServicePrincipalToken( - *oauthConfig, - appliationID, - applicationSecret, - resource, - callbacks...) -if err != nil { - return nil, err -} - -// Acquire a new access token -err = spt.Refresh() -if (err == nil) { - token := spt.Token -} -``` - -* Replace the `APPLICATION_SECRET` with the `password` value from previous section. - -#### Client Certificate - -```Go -certificatePath := "./example-app.pfx" - -certData, err := ioutil.ReadFile(certificatePath) -if err != nil { - return nil, fmt.Errorf("failed to read the certificate file (%s): %v", certificatePath, err) -} - -// Get the certificate and private key from pfx file -certificate, rsaPrivateKey, err := decodePkcs12(certData, "") -if err != nil { - return nil, fmt.Errorf("failed to decode pkcs12 certificate while creating spt: %v", err) -} - -spt, err := adal.NewServicePrincipalTokenFromCertificate( - *oauthConfig, - applicationID, - certificate, - rsaPrivateKey, - resource, - callbacks...) - -// Acquire a new access token -err = spt.Refresh() -if (err == nil) { - token := spt.Token -} -``` - -* Update the certificate path to point to the example-app.pfx file which was created in previous section. - - -#### Device Code - -```Go -oauthClient := &http.Client{} - -// Acquire the device code -deviceCode, err := adal.InitiateDeviceAuth( - oauthClient, - *oauthConfig, - applicationID, - resource) -if err != nil { - return nil, fmt.Errorf("Failed to start device auth flow: %s", err) -} - -// Display the authentication message -fmt.Println(*deviceCode.Message) - -// Wait here until the user is authenticated -token, err := adal.WaitForUserCompletion(oauthClient, deviceCode) -if err != nil { - return nil, fmt.Errorf("Failed to finish device auth flow: %s", err) -} - -spt, err := adal.NewServicePrincipalTokenFromManualToken( - *oauthConfig, - applicationID, - resource, - *token, - callbacks...) - -if (err == nil) { - token := spt.Token -} -``` - -#### Username password authenticate - -```Go -spt, err := adal.NewServicePrincipalTokenFromUsernamePassword( - *oauthConfig, - applicationID, - username, - password, - resource, - callbacks...) - -if (err == nil) { - token := spt.Token -} -``` - -#### Authorization code authenticate - -``` Go -spt, err := adal.NewServicePrincipalTokenFromAuthorizationCode( - *oauthConfig, - applicationID, - clientSecret, - authorizationCode, - redirectURI, - resource, - callbacks...) - -err = spt.Refresh() -if (err == nil) { - token := spt.Token -} -``` - -### Command Line Tool - -A command line tool is available in `cmd/adal.go` that can acquire a token for a given resource. It supports all flows mentioned above. - -``` -adal -h - -Usage of ./adal: - -applicationId string - application id - -certificatePath string - path to pk12/PFC application certificate - -mode string - authentication mode (device, secret, cert, refresh) (default "device") - -resource string - resource for which the token is requested - -secret string - application secret - -tenantId string - tenant id - -tokenCachePath string - location of oath token cache (default "/home/cgc/.adal/accessToken.json") -``` - -Example acquire a token for `https://management.core.windows.net/` using device code flow: - -``` -adal -mode device \ - -applicationId "APPLICATION_ID" \ - -tenantId "TENANT_ID" \ - -resource https://management.core.windows.net/ - -``` diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/config.go b/vendor/github.com/Azure/go-autorest/autorest/adal/config.go deleted file mode 100644 index fa5964742f..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/config.go +++ /dev/null @@ -1,151 +0,0 @@ -package adal - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "errors" - "fmt" - "net/url" -) - -const ( - activeDirectoryEndpointTemplate = "%s/oauth2/%s%s" -) - -// OAuthConfig represents the endpoints needed -// in OAuth operations -type OAuthConfig struct { - AuthorityEndpoint url.URL `json:"authorityEndpoint"` - AuthorizeEndpoint url.URL `json:"authorizeEndpoint"` - TokenEndpoint url.URL `json:"tokenEndpoint"` - DeviceCodeEndpoint url.URL `json:"deviceCodeEndpoint"` -} - -// IsZero returns true if the OAuthConfig object is zero-initialized. -func (oac OAuthConfig) IsZero() bool { - return oac == OAuthConfig{} -} - -func validateStringParam(param, name string) error { - if len(param) == 0 { - return fmt.Errorf("parameter '" + name + "' cannot be empty") - } - return nil -} - -// NewOAuthConfig returns an OAuthConfig with tenant specific urls -func NewOAuthConfig(activeDirectoryEndpoint, tenantID string) (*OAuthConfig, error) { - apiVer := "1.0" - return NewOAuthConfigWithAPIVersion(activeDirectoryEndpoint, tenantID, &apiVer) -} - -// NewOAuthConfigWithAPIVersion returns an OAuthConfig with tenant specific urls. -// If apiVersion is not nil the "api-version" query parameter will be appended to the endpoint URLs with the specified value. -func NewOAuthConfigWithAPIVersion(activeDirectoryEndpoint, tenantID string, apiVersion *string) (*OAuthConfig, error) { - if err := validateStringParam(activeDirectoryEndpoint, "activeDirectoryEndpoint"); err != nil { - return nil, err - } - api := "" - // it's legal for tenantID to be empty so don't validate it - if apiVersion != nil { - if err := validateStringParam(*apiVersion, "apiVersion"); err != nil { - return nil, err - } - api = fmt.Sprintf("?api-version=%s", *apiVersion) - } - u, err := url.Parse(activeDirectoryEndpoint) - if err != nil { - return nil, err - } - authorityURL, err := u.Parse(tenantID) - if err != nil { - return nil, err - } - authorizeURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "authorize", api)) - if err != nil { - return nil, err - } - tokenURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "token", api)) - if err != nil { - return nil, err - } - deviceCodeURL, err := u.Parse(fmt.Sprintf(activeDirectoryEndpointTemplate, tenantID, "devicecode", api)) - if err != nil { - return nil, err - } - - return &OAuthConfig{ - AuthorityEndpoint: *authorityURL, - AuthorizeEndpoint: *authorizeURL, - TokenEndpoint: *tokenURL, - DeviceCodeEndpoint: *deviceCodeURL, - }, nil -} - -// MultiTenantOAuthConfig provides endpoints for primary and aulixiary tenant IDs. -type MultiTenantOAuthConfig interface { - PrimaryTenant() *OAuthConfig - AuxiliaryTenants() []*OAuthConfig -} - -// OAuthOptions contains optional OAuthConfig creation arguments. -type OAuthOptions struct { - APIVersion string -} - -func (c OAuthOptions) apiVersion() string { - if c.APIVersion != "" { - return fmt.Sprintf("?api-version=%s", c.APIVersion) - } - return "1.0" -} - -// NewMultiTenantOAuthConfig creates an object that support multitenant OAuth configuration. -// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/authenticate-multi-tenant for more information. -func NewMultiTenantOAuthConfig(activeDirectoryEndpoint, primaryTenantID string, auxiliaryTenantIDs []string, options OAuthOptions) (MultiTenantOAuthConfig, error) { - if len(auxiliaryTenantIDs) == 0 || len(auxiliaryTenantIDs) > 3 { - return nil, errors.New("must specify one to three auxiliary tenants") - } - mtCfg := multiTenantOAuthConfig{ - cfgs: make([]*OAuthConfig, len(auxiliaryTenantIDs)+1), - } - apiVer := options.apiVersion() - pri, err := NewOAuthConfigWithAPIVersion(activeDirectoryEndpoint, primaryTenantID, &apiVer) - if err != nil { - return nil, fmt.Errorf("failed to create OAuthConfig for primary tenant: %v", err) - } - mtCfg.cfgs[0] = pri - for i := range auxiliaryTenantIDs { - aux, err := NewOAuthConfig(activeDirectoryEndpoint, auxiliaryTenantIDs[i]) - if err != nil { - return nil, fmt.Errorf("failed to create OAuthConfig for tenant '%s': %v", auxiliaryTenantIDs[i], err) - } - mtCfg.cfgs[i+1] = aux - } - return mtCfg, nil -} - -type multiTenantOAuthConfig struct { - // first config in the slice is the primary tenant - cfgs []*OAuthConfig -} - -func (m multiTenantOAuthConfig) PrimaryTenant() *OAuthConfig { - return m.cfgs[0] -} - -func (m multiTenantOAuthConfig) AuxiliaryTenants() []*OAuthConfig { - return m.cfgs[1:] -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/devicetoken.go b/vendor/github.com/Azure/go-autorest/autorest/adal/devicetoken.go deleted file mode 100644 index 9daa4b58b8..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/devicetoken.go +++ /dev/null @@ -1,273 +0,0 @@ -package adal - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -/* - This file is largely based on rjw57/oauth2device's code, with the follow differences: - * scope -> resource, and only allow a single one - * receive "Message" in the DeviceCode struct and show it to users as the prompt - * azure-xplat-cli has the following behavior that this emulates: - - does not send client_secret during the token exchange - - sends resource again in the token exchange request -*/ - -import ( - "context" - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "net/url" - "strings" - "time" -) - -const ( - logPrefix = "autorest/adal/devicetoken:" -) - -var ( - // ErrDeviceGeneric represents an unknown error from the token endpoint when using device flow - ErrDeviceGeneric = fmt.Errorf("%s Error while retrieving OAuth token: Unknown Error", logPrefix) - - // ErrDeviceAccessDenied represents an access denied error from the token endpoint when using device flow - ErrDeviceAccessDenied = fmt.Errorf("%s Error while retrieving OAuth token: Access Denied", logPrefix) - - // ErrDeviceAuthorizationPending represents the server waiting on the user to complete the device flow - ErrDeviceAuthorizationPending = fmt.Errorf("%s Error while retrieving OAuth token: Authorization Pending", logPrefix) - - // ErrDeviceCodeExpired represents the server timing out and expiring the code during device flow - ErrDeviceCodeExpired = fmt.Errorf("%s Error while retrieving OAuth token: Code Expired", logPrefix) - - // ErrDeviceSlowDown represents the service telling us we're polling too often during device flow - ErrDeviceSlowDown = fmt.Errorf("%s Error while retrieving OAuth token: Slow Down", logPrefix) - - // ErrDeviceCodeEmpty represents an empty device code from the device endpoint while using device flow - ErrDeviceCodeEmpty = fmt.Errorf("%s Error while retrieving device code: Device Code Empty", logPrefix) - - // ErrOAuthTokenEmpty represents an empty OAuth token from the token endpoint when using device flow - ErrOAuthTokenEmpty = fmt.Errorf("%s Error while retrieving OAuth token: Token Empty", logPrefix) - - errCodeSendingFails = "Error occurred while sending request for Device Authorization Code" - errCodeHandlingFails = "Error occurred while handling response from the Device Endpoint" - errTokenSendingFails = "Error occurred while sending request with device code for a token" - errTokenHandlingFails = "Error occurred while handling response from the Token Endpoint (during device flow)" - errStatusNotOK = "Error HTTP status != 200" -) - -// DeviceCode is the object returned by the device auth endpoint -// It contains information to instruct the user to complete the auth flow -type DeviceCode struct { - DeviceCode *string `json:"device_code,omitempty"` - UserCode *string `json:"user_code,omitempty"` - VerificationURL *string `json:"verification_url,omitempty"` - ExpiresIn *int64 `json:"expires_in,string,omitempty"` - Interval *int64 `json:"interval,string,omitempty"` - - Message *string `json:"message"` // Azure specific - Resource string // store the following, stored when initiating, used when exchanging - OAuthConfig OAuthConfig - ClientID string -} - -// TokenError is the object returned by the token exchange endpoint -// when something is amiss -type TokenError struct { - Error *string `json:"error,omitempty"` - ErrorCodes []int `json:"error_codes,omitempty"` - ErrorDescription *string `json:"error_description,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` - TraceID *string `json:"trace_id,omitempty"` -} - -// DeviceToken is the object return by the token exchange endpoint -// It can either look like a Token or an ErrorToken, so put both here -// and check for presence of "Error" to know if we are in error state -type deviceToken struct { - Token - TokenError -} - -// InitiateDeviceAuth initiates a device auth flow. It returns a DeviceCode -// that can be used with CheckForUserCompletion or WaitForUserCompletion. -// Deprecated: use InitiateDeviceAuthWithContext() instead. -func InitiateDeviceAuth(sender Sender, oauthConfig OAuthConfig, clientID, resource string) (*DeviceCode, error) { - return InitiateDeviceAuthWithContext(context.Background(), sender, oauthConfig, clientID, resource) -} - -// InitiateDeviceAuthWithContext initiates a device auth flow. It returns a DeviceCode -// that can be used with CheckForUserCompletion or WaitForUserCompletion. -func InitiateDeviceAuthWithContext(ctx context.Context, sender Sender, oauthConfig OAuthConfig, clientID, resource string) (*DeviceCode, error) { - v := url.Values{ - "client_id": []string{clientID}, - "resource": []string{resource}, - } - - s := v.Encode() - body := ioutil.NopCloser(strings.NewReader(s)) - - req, err := http.NewRequest(http.MethodPost, oauthConfig.DeviceCodeEndpoint.String(), body) - if err != nil { - return nil, fmt.Errorf("%s %s: %s", logPrefix, errCodeSendingFails, err.Error()) - } - - req.ContentLength = int64(len(s)) - req.Header.Set(contentType, mimeTypeFormPost) - resp, err := sender.Do(req.WithContext(ctx)) - if err != nil { - return nil, fmt.Errorf("%s %s: %s", logPrefix, errCodeSendingFails, err.Error()) - } - defer resp.Body.Close() - - rb, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, fmt.Errorf("%s %s: %s", logPrefix, errCodeHandlingFails, err.Error()) - } - - if resp.StatusCode != http.StatusOK { - return nil, fmt.Errorf("%s %s: %s", logPrefix, errCodeHandlingFails, errStatusNotOK) - } - - if len(strings.Trim(string(rb), " ")) == 0 { - return nil, ErrDeviceCodeEmpty - } - - var code DeviceCode - err = json.Unmarshal(rb, &code) - if err != nil { - return nil, fmt.Errorf("%s %s: %s", logPrefix, errCodeHandlingFails, err.Error()) - } - - code.ClientID = clientID - code.Resource = resource - code.OAuthConfig = oauthConfig - - return &code, nil -} - -// CheckForUserCompletion takes a DeviceCode and checks with the Azure AD OAuth endpoint -// to see if the device flow has: been completed, timed out, or otherwise failed -// Deprecated: use CheckForUserCompletionWithContext() instead. -func CheckForUserCompletion(sender Sender, code *DeviceCode) (*Token, error) { - return CheckForUserCompletionWithContext(context.Background(), sender, code) -} - -// CheckForUserCompletionWithContext takes a DeviceCode and checks with the Azure AD OAuth endpoint -// to see if the device flow has: been completed, timed out, or otherwise failed -func CheckForUserCompletionWithContext(ctx context.Context, sender Sender, code *DeviceCode) (*Token, error) { - v := url.Values{ - "client_id": []string{code.ClientID}, - "code": []string{*code.DeviceCode}, - "grant_type": []string{OAuthGrantTypeDeviceCode}, - "resource": []string{code.Resource}, - } - - s := v.Encode() - body := ioutil.NopCloser(strings.NewReader(s)) - - req, err := http.NewRequest(http.MethodPost, code.OAuthConfig.TokenEndpoint.String(), body) - if err != nil { - return nil, fmt.Errorf("%s %s: %s", logPrefix, errTokenSendingFails, err.Error()) - } - - req.ContentLength = int64(len(s)) - req.Header.Set(contentType, mimeTypeFormPost) - resp, err := sender.Do(req.WithContext(ctx)) - if err != nil { - return nil, fmt.Errorf("%s %s: %s", logPrefix, errTokenSendingFails, err.Error()) - } - defer resp.Body.Close() - - rb, err := ioutil.ReadAll(resp.Body) - if err != nil { - return nil, fmt.Errorf("%s %s: %s", logPrefix, errTokenHandlingFails, err.Error()) - } - - if resp.StatusCode != http.StatusOK && len(strings.Trim(string(rb), " ")) == 0 { - return nil, fmt.Errorf("%s %s: %s", logPrefix, errTokenHandlingFails, errStatusNotOK) - } - if len(strings.Trim(string(rb), " ")) == 0 { - return nil, ErrOAuthTokenEmpty - } - - var token deviceToken - err = json.Unmarshal(rb, &token) - if err != nil { - return nil, fmt.Errorf("%s %s: %s", logPrefix, errTokenHandlingFails, err.Error()) - } - - if token.Error == nil { - return &token.Token, nil - } - - switch *token.Error { - case "authorization_pending": - return nil, ErrDeviceAuthorizationPending - case "slow_down": - return nil, ErrDeviceSlowDown - case "access_denied": - return nil, ErrDeviceAccessDenied - case "code_expired": - return nil, ErrDeviceCodeExpired - default: - // return a more meaningful error message if available - if token.ErrorDescription != nil { - return nil, fmt.Errorf("%s %s: %s", logPrefix, *token.Error, *token.ErrorDescription) - } - return nil, ErrDeviceGeneric - } -} - -// WaitForUserCompletion calls CheckForUserCompletion repeatedly until a token is granted or an error state occurs. -// This prevents the user from looping and checking against 'ErrDeviceAuthorizationPending'. -// Deprecated: use WaitForUserCompletionWithContext() instead. -func WaitForUserCompletion(sender Sender, code *DeviceCode) (*Token, error) { - return WaitForUserCompletionWithContext(context.Background(), sender, code) -} - -// WaitForUserCompletionWithContext calls CheckForUserCompletion repeatedly until a token is granted or an error -// state occurs. This prevents the user from looping and checking against 'ErrDeviceAuthorizationPending'. -func WaitForUserCompletionWithContext(ctx context.Context, sender Sender, code *DeviceCode) (*Token, error) { - intervalDuration := time.Duration(*code.Interval) * time.Second - waitDuration := intervalDuration - - for { - token, err := CheckForUserCompletionWithContext(ctx, sender, code) - - if err == nil { - return token, nil - } - - switch err { - case ErrDeviceSlowDown: - waitDuration += waitDuration - case ErrDeviceAuthorizationPending: - // noop - default: // everything else is "fatal" to us - return nil, err - } - - if waitDuration > (intervalDuration * 3) { - return nil, fmt.Errorf("%s Error waiting for user to complete device flow. Server told us to slow_down too much", logPrefix) - } - - select { - case <-time.After(waitDuration): - // noop - case <-ctx.Done(): - return nil, ctx.Err() - } - } -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/go_mod_tidy_hack.go b/vendor/github.com/Azure/go-autorest/autorest/adal/go_mod_tidy_hack.go deleted file mode 100644 index 647a61bb8c..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/go_mod_tidy_hack.go +++ /dev/null @@ -1,25 +0,0 @@ -//go:build modhack -// +build modhack - -package adal - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file, and the github.com/Azure/go-autorest import, won't actually become part of -// the resultant binary. - -// Necessary for safely adding multi-module repo. -// See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository -import _ "github.com/Azure/go-autorest" diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/persist.go b/vendor/github.com/Azure/go-autorest/autorest/adal/persist.go deleted file mode 100644 index 2a974a39b3..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/persist.go +++ /dev/null @@ -1,135 +0,0 @@ -package adal - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "crypto/rsa" - "crypto/x509" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "os" - "path/filepath" - - "golang.org/x/crypto/pkcs12" -) - -var ( - // ErrMissingCertificate is returned when no local certificate is found in the provided PFX data. - ErrMissingCertificate = errors.New("adal: certificate missing") - - // ErrMissingPrivateKey is returned when no private key is found in the provided PFX data. - ErrMissingPrivateKey = errors.New("adal: private key missing") -) - -// LoadToken restores a Token object from a file located at 'path'. -func LoadToken(path string) (*Token, error) { - file, err := os.Open(path) - if err != nil { - return nil, fmt.Errorf("failed to open file (%s) while loading token: %v", path, err) - } - defer file.Close() - - var token Token - - dec := json.NewDecoder(file) - if err = dec.Decode(&token); err != nil { - return nil, fmt.Errorf("failed to decode contents of file (%s) into Token representation: %v", path, err) - } - return &token, nil -} - -// SaveToken persists an oauth token at the given location on disk. -// It moves the new file into place so it can safely be used to replace an existing file -// that maybe accessed by multiple processes. -func SaveToken(path string, mode os.FileMode, token Token) error { - dir := filepath.Dir(path) - err := os.MkdirAll(dir, os.ModePerm) - if err != nil { - return fmt.Errorf("failed to create directory (%s) to store token in: %v", dir, err) - } - - newFile, err := ioutil.TempFile(dir, "token") - if err != nil { - return fmt.Errorf("failed to create the temp file to write the token: %v", err) - } - tempPath := newFile.Name() - - if err := json.NewEncoder(newFile).Encode(token); err != nil { - return fmt.Errorf("failed to encode token to file (%s) while saving token: %v", tempPath, err) - } - if err := newFile.Close(); err != nil { - return fmt.Errorf("failed to close temp file %s: %v", tempPath, err) - } - - // Atomic replace to avoid multi-writer file corruptions - if err := os.Rename(tempPath, path); err != nil { - return fmt.Errorf("failed to move temporary token to desired output location. src=%s dst=%s: %v", tempPath, path, err) - } - if err := os.Chmod(path, mode); err != nil { - return fmt.Errorf("failed to chmod the token file %s: %v", path, err) - } - return nil -} - -// DecodePfxCertificateData extracts the x509 certificate and RSA private key from the provided PFX data. -// The PFX data must contain a private key along with a certificate whose public key matches that of the -// private key or an error is returned. -// If the private key is not password protected pass the empty string for password. -func DecodePfxCertificateData(pfxData []byte, password string) (*x509.Certificate, *rsa.PrivateKey, error) { - blocks, err := pkcs12.ToPEM(pfxData, password) - if err != nil { - return nil, nil, err - } - // first extract the private key - var priv *rsa.PrivateKey - for _, block := range blocks { - if block.Type == "PRIVATE KEY" { - priv, err = x509.ParsePKCS1PrivateKey(block.Bytes) - if err != nil { - return nil, nil, err - } - break - } - } - if priv == nil { - return nil, nil, ErrMissingPrivateKey - } - // now find the certificate with the matching public key of our private key - var cert *x509.Certificate - for _, block := range blocks { - if block.Type == "CERTIFICATE" { - pcert, err := x509.ParseCertificate(block.Bytes) - if err != nil { - return nil, nil, err - } - certKey, ok := pcert.PublicKey.(*rsa.PublicKey) - if !ok { - // keep looking - continue - } - if priv.E == certKey.E && priv.N.Cmp(certKey.N) == 0 { - // found a match - cert = pcert - break - } - } - } - if cert == nil { - return nil, nil, ErrMissingCertificate - } - return cert, priv, nil -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go b/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go deleted file mode 100644 index eb649bce9f..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/sender.go +++ /dev/null @@ -1,101 +0,0 @@ -package adal - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "crypto/tls" - "net" - "net/http" - "net/http/cookiejar" - "sync" - "time" - - "github.com/Azure/go-autorest/tracing" -) - -const ( - contentType = "Content-Type" - mimeTypeFormPost = "application/x-www-form-urlencoded" -) - -// DO NOT ACCESS THIS DIRECTLY. go through sender() -var defaultSender Sender -var defaultSenderInit = &sync.Once{} - -// Sender is the interface that wraps the Do method to send HTTP requests. -// -// The standard http.Client conforms to this interface. -type Sender interface { - Do(*http.Request) (*http.Response, error) -} - -// SenderFunc is a method that implements the Sender interface. -type SenderFunc func(*http.Request) (*http.Response, error) - -// Do implements the Sender interface on SenderFunc. -func (sf SenderFunc) Do(r *http.Request) (*http.Response, error) { - return sf(r) -} - -// SendDecorator takes and possibly decorates, by wrapping, a Sender. Decorators may affect the -// http.Request and pass it along or, first, pass the http.Request along then react to the -// http.Response result. -type SendDecorator func(Sender) Sender - -// CreateSender creates, decorates, and returns, as a Sender, the default http.Client. -func CreateSender(decorators ...SendDecorator) Sender { - return DecorateSender(sender(), decorators...) -} - -// DecorateSender accepts a Sender and a, possibly empty, set of SendDecorators, which is applies to -// the Sender. Decorators are applied in the order received, but their affect upon the request -// depends on whether they are a pre-decorator (change the http.Request and then pass it along) or a -// post-decorator (pass the http.Request along and react to the results in http.Response). -func DecorateSender(s Sender, decorators ...SendDecorator) Sender { - for _, decorate := range decorators { - s = decorate(s) - } - return s -} - -func sender() Sender { - // note that we can't init defaultSender in init() since it will - // execute before calling code has had a chance to enable tracing - defaultSenderInit.Do(func() { - // copied from http.DefaultTransport with a TLS minimum version. - transport := &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - }).DialContext, - ForceAttemptHTTP2: true, - MaxIdleConns: 100, - IdleConnTimeout: 90 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - ExpectContinueTimeout: 1 * time.Second, - TLSClientConfig: &tls.Config{ - MinVersion: tls.VersionTLS12, - }, - } - var roundTripper http.RoundTripper = transport - if tracing.IsEnabled() { - roundTripper = tracing.NewTransport(transport) - } - j, _ := cookiejar.New(nil) - defaultSender = &http.Client{Jar: j, Transport: roundTripper} - }) - return defaultSender -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/token.go b/vendor/github.com/Azure/go-autorest/autorest/adal/token.go deleted file mode 100644 index 310be07ec3..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/token.go +++ /dev/null @@ -1,1328 +0,0 @@ -package adal - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "context" - "crypto/rand" - "crypto/rsa" - "crypto/sha1" - "crypto/x509" - "encoding/base64" - "encoding/json" - "errors" - "fmt" - "io" - "io/ioutil" - "math" - "net/http" - "net/url" - "os" - "strconv" - "strings" - "sync" - "time" - - "github.com/Azure/go-autorest/autorest/date" - "github.com/Azure/go-autorest/logger" - "github.com/golang-jwt/jwt/v4" -) - -const ( - defaultRefresh = 5 * time.Minute - - // OAuthGrantTypeDeviceCode is the "grant_type" identifier used in device flow - OAuthGrantTypeDeviceCode = "device_code" - - // OAuthGrantTypeClientCredentials is the "grant_type" identifier used in credential flows - OAuthGrantTypeClientCredentials = "client_credentials" - - // OAuthGrantTypeUserPass is the "grant_type" identifier used in username and password auth flows - OAuthGrantTypeUserPass = "password" - - // OAuthGrantTypeRefreshToken is the "grant_type" identifier used in refresh token flows - OAuthGrantTypeRefreshToken = "refresh_token" - - // OAuthGrantTypeAuthorizationCode is the "grant_type" identifier used in authorization code flows - OAuthGrantTypeAuthorizationCode = "authorization_code" - - // metadataHeader is the header required by MSI extension - metadataHeader = "Metadata" - - // msiEndpoint is the well known endpoint for getting MSI authentications tokens - msiEndpoint = "http://169.254.169.254/metadata/identity/oauth2/token" - - // the API version to use for the MSI endpoint - msiAPIVersion = "2018-02-01" - - // the default number of attempts to refresh an MSI authentication token - defaultMaxMSIRefreshAttempts = 5 - - // asMSIEndpointEnv is the environment variable used to store the endpoint on App Service and Functions - msiEndpointEnv = "MSI_ENDPOINT" - - // asMSISecretEnv is the environment variable used to store the request secret on App Service and Functions - msiSecretEnv = "MSI_SECRET" - - // the API version to use for the legacy App Service MSI endpoint - appServiceAPIVersion2017 = "2017-09-01" - - // secret header used when authenticating against app service MSI endpoint - secretHeader = "Secret" - - // the format for expires_on in UTC with AM/PM - expiresOnDateFormatPM = "1/2/2006 15:04:05 PM +00:00" - - // the format for expires_on in UTC without AM/PM - expiresOnDateFormat = "1/2/2006 15:04:05 +00:00" -) - -// OAuthTokenProvider is an interface which should be implemented by an access token retriever -type OAuthTokenProvider interface { - OAuthToken() string -} - -// MultitenantOAuthTokenProvider provides tokens used for multi-tenant authorization. -type MultitenantOAuthTokenProvider interface { - PrimaryOAuthToken() string - AuxiliaryOAuthTokens() []string -} - -// TokenRefreshError is an interface used by errors returned during token refresh. -type TokenRefreshError interface { - error - Response() *http.Response -} - -// Refresher is an interface for token refresh functionality -type Refresher interface { - Refresh() error - RefreshExchange(resource string) error - EnsureFresh() error -} - -// RefresherWithContext is an interface for token refresh functionality -type RefresherWithContext interface { - RefreshWithContext(ctx context.Context) error - RefreshExchangeWithContext(ctx context.Context, resource string) error - EnsureFreshWithContext(ctx context.Context) error -} - -// TokenRefreshCallback is the type representing callbacks that will be called after -// a successful token refresh -type TokenRefreshCallback func(Token) error - -// TokenRefresh is a type representing a custom callback to refresh a token -type TokenRefresh func(ctx context.Context, resource string) (*Token, error) - -// Token encapsulates the access token used to authorize Azure requests. -// https://docs.microsoft.com/en-us/azure/active-directory/develop/v1-oauth2-client-creds-grant-flow#service-to-service-access-token-response -type Token struct { - AccessToken string `json:"access_token"` - RefreshToken string `json:"refresh_token"` - - ExpiresIn json.Number `json:"expires_in"` - ExpiresOn json.Number `json:"expires_on"` - NotBefore json.Number `json:"not_before"` - - Resource string `json:"resource"` - Type string `json:"token_type"` -} - -func newToken() Token { - return Token{ - ExpiresIn: "0", - ExpiresOn: "0", - NotBefore: "0", - } -} - -// IsZero returns true if the token object is zero-initialized. -func (t Token) IsZero() bool { - return t == Token{} -} - -// Expires returns the time.Time when the Token expires. -func (t Token) Expires() time.Time { - s, err := t.ExpiresOn.Float64() - if err != nil { - s = -3600 - } - - expiration := date.NewUnixTimeFromSeconds(s) - - return time.Time(expiration).UTC() -} - -// IsExpired returns true if the Token is expired, false otherwise. -func (t Token) IsExpired() bool { - return t.WillExpireIn(0) -} - -// WillExpireIn returns true if the Token will expire after the passed time.Duration interval -// from now, false otherwise. -func (t Token) WillExpireIn(d time.Duration) bool { - return !t.Expires().After(time.Now().Add(d)) -} - -//OAuthToken return the current access token -func (t *Token) OAuthToken() string { - return t.AccessToken -} - -// ServicePrincipalSecret is an interface that allows various secret mechanism to fill the form -// that is submitted when acquiring an oAuth token. -type ServicePrincipalSecret interface { - SetAuthenticationValues(spt *ServicePrincipalToken, values *url.Values) error -} - -// ServicePrincipalNoSecret represents a secret type that contains no secret -// meaning it is not valid for fetching a fresh token. This is used by Manual -type ServicePrincipalNoSecret struct { -} - -// SetAuthenticationValues is a method of the interface ServicePrincipalSecret -// It only returns an error for the ServicePrincipalNoSecret type -func (noSecret *ServicePrincipalNoSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error { - return fmt.Errorf("Manually created ServicePrincipalToken does not contain secret material to retrieve a new access token") -} - -// MarshalJSON implements the json.Marshaler interface. -func (noSecret ServicePrincipalNoSecret) MarshalJSON() ([]byte, error) { - type tokenType struct { - Type string `json:"type"` - } - return json.Marshal(tokenType{ - Type: "ServicePrincipalNoSecret", - }) -} - -// ServicePrincipalTokenSecret implements ServicePrincipalSecret for client_secret type authorization. -type ServicePrincipalTokenSecret struct { - ClientSecret string `json:"value"` -} - -// SetAuthenticationValues is a method of the interface ServicePrincipalSecret. -// It will populate the form submitted during oAuth Token Acquisition using the client_secret. -func (tokenSecret *ServicePrincipalTokenSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error { - v.Set("client_secret", tokenSecret.ClientSecret) - return nil -} - -// MarshalJSON implements the json.Marshaler interface. -func (tokenSecret ServicePrincipalTokenSecret) MarshalJSON() ([]byte, error) { - type tokenType struct { - Type string `json:"type"` - Value string `json:"value"` - } - return json.Marshal(tokenType{ - Type: "ServicePrincipalTokenSecret", - Value: tokenSecret.ClientSecret, - }) -} - -// ServicePrincipalCertificateSecret implements ServicePrincipalSecret for generic RSA cert auth with signed JWTs. -type ServicePrincipalCertificateSecret struct { - Certificate *x509.Certificate - PrivateKey *rsa.PrivateKey -} - -// SignJwt returns the JWT signed with the certificate's private key. -func (secret *ServicePrincipalCertificateSecret) SignJwt(spt *ServicePrincipalToken) (string, error) { - hasher := sha1.New() - _, err := hasher.Write(secret.Certificate.Raw) - if err != nil { - return "", err - } - - thumbprint := base64.URLEncoding.EncodeToString(hasher.Sum(nil)) - - // The jti (JWT ID) claim provides a unique identifier for the JWT. - jti := make([]byte, 20) - _, err = rand.Read(jti) - if err != nil { - return "", err - } - - token := jwt.New(jwt.SigningMethodRS256) - token.Header["x5t"] = thumbprint - x5c := []string{base64.StdEncoding.EncodeToString(secret.Certificate.Raw)} - token.Header["x5c"] = x5c - token.Claims = jwt.MapClaims{ - "aud": spt.inner.OauthConfig.TokenEndpoint.String(), - "iss": spt.inner.ClientID, - "sub": spt.inner.ClientID, - "jti": base64.URLEncoding.EncodeToString(jti), - "nbf": time.Now().Unix(), - "exp": time.Now().Add(24 * time.Hour).Unix(), - } - - signedString, err := token.SignedString(secret.PrivateKey) - return signedString, err -} - -// SetAuthenticationValues is a method of the interface ServicePrincipalSecret. -// It will populate the form submitted during oAuth Token Acquisition using a JWT signed with a certificate. -func (secret *ServicePrincipalCertificateSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error { - jwt, err := secret.SignJwt(spt) - if err != nil { - return err - } - - v.Set("client_assertion", jwt) - v.Set("client_assertion_type", "urn:ietf:params:oauth:client-assertion-type:jwt-bearer") - return nil -} - -// MarshalJSON implements the json.Marshaler interface. -func (secret ServicePrincipalCertificateSecret) MarshalJSON() ([]byte, error) { - return nil, errors.New("marshalling ServicePrincipalCertificateSecret is not supported") -} - -// ServicePrincipalMSISecret implements ServicePrincipalSecret for machines running the MSI Extension. -type ServicePrincipalMSISecret struct { - msiType msiType - clientResourceID string -} - -// SetAuthenticationValues is a method of the interface ServicePrincipalSecret. -func (msiSecret *ServicePrincipalMSISecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error { - return nil -} - -// MarshalJSON implements the json.Marshaler interface. -func (msiSecret ServicePrincipalMSISecret) MarshalJSON() ([]byte, error) { - return nil, errors.New("marshalling ServicePrincipalMSISecret is not supported") -} - -// ServicePrincipalUsernamePasswordSecret implements ServicePrincipalSecret for username and password auth. -type ServicePrincipalUsernamePasswordSecret struct { - Username string `json:"username"` - Password string `json:"password"` -} - -// SetAuthenticationValues is a method of the interface ServicePrincipalSecret. -func (secret *ServicePrincipalUsernamePasswordSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error { - v.Set("username", secret.Username) - v.Set("password", secret.Password) - return nil -} - -// MarshalJSON implements the json.Marshaler interface. -func (secret ServicePrincipalUsernamePasswordSecret) MarshalJSON() ([]byte, error) { - type tokenType struct { - Type string `json:"type"` - Username string `json:"username"` - Password string `json:"password"` - } - return json.Marshal(tokenType{ - Type: "ServicePrincipalUsernamePasswordSecret", - Username: secret.Username, - Password: secret.Password, - }) -} - -// ServicePrincipalAuthorizationCodeSecret implements ServicePrincipalSecret for authorization code auth. -type ServicePrincipalAuthorizationCodeSecret struct { - ClientSecret string `json:"value"` - AuthorizationCode string `json:"authCode"` - RedirectURI string `json:"redirect"` -} - -// SetAuthenticationValues is a method of the interface ServicePrincipalSecret. -func (secret *ServicePrincipalAuthorizationCodeSecret) SetAuthenticationValues(spt *ServicePrincipalToken, v *url.Values) error { - v.Set("code", secret.AuthorizationCode) - v.Set("client_secret", secret.ClientSecret) - v.Set("redirect_uri", secret.RedirectURI) - return nil -} - -// MarshalJSON implements the json.Marshaler interface. -func (secret ServicePrincipalAuthorizationCodeSecret) MarshalJSON() ([]byte, error) { - type tokenType struct { - Type string `json:"type"` - Value string `json:"value"` - AuthCode string `json:"authCode"` - Redirect string `json:"redirect"` - } - return json.Marshal(tokenType{ - Type: "ServicePrincipalAuthorizationCodeSecret", - Value: secret.ClientSecret, - AuthCode: secret.AuthorizationCode, - Redirect: secret.RedirectURI, - }) -} - -// ServicePrincipalToken encapsulates a Token created for a Service Principal. -type ServicePrincipalToken struct { - inner servicePrincipalToken - refreshLock *sync.RWMutex - sender Sender - customRefreshFunc TokenRefresh - refreshCallbacks []TokenRefreshCallback - // MaxMSIRefreshAttempts is the maximum number of attempts to refresh an MSI token. - // Settings this to a value less than 1 will use the default value. - MaxMSIRefreshAttempts int -} - -// MarshalTokenJSON returns the marshalled inner token. -func (spt ServicePrincipalToken) MarshalTokenJSON() ([]byte, error) { - return json.Marshal(spt.inner.Token) -} - -// SetRefreshCallbacks replaces any existing refresh callbacks with the specified callbacks. -func (spt *ServicePrincipalToken) SetRefreshCallbacks(callbacks []TokenRefreshCallback) { - spt.refreshCallbacks = callbacks -} - -// SetCustomRefreshFunc sets a custom refresh function used to refresh the token. -func (spt *ServicePrincipalToken) SetCustomRefreshFunc(customRefreshFunc TokenRefresh) { - spt.customRefreshFunc = customRefreshFunc -} - -// MarshalJSON implements the json.Marshaler interface. -func (spt ServicePrincipalToken) MarshalJSON() ([]byte, error) { - return json.Marshal(spt.inner) -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (spt *ServicePrincipalToken) UnmarshalJSON(data []byte) error { - // need to determine the token type - raw := map[string]interface{}{} - err := json.Unmarshal(data, &raw) - if err != nil { - return err - } - secret := raw["secret"].(map[string]interface{}) - switch secret["type"] { - case "ServicePrincipalNoSecret": - spt.inner.Secret = &ServicePrincipalNoSecret{} - case "ServicePrincipalTokenSecret": - spt.inner.Secret = &ServicePrincipalTokenSecret{} - case "ServicePrincipalCertificateSecret": - return errors.New("unmarshalling ServicePrincipalCertificateSecret is not supported") - case "ServicePrincipalMSISecret": - return errors.New("unmarshalling ServicePrincipalMSISecret is not supported") - case "ServicePrincipalUsernamePasswordSecret": - spt.inner.Secret = &ServicePrincipalUsernamePasswordSecret{} - case "ServicePrincipalAuthorizationCodeSecret": - spt.inner.Secret = &ServicePrincipalAuthorizationCodeSecret{} - default: - return fmt.Errorf("unrecognized token type '%s'", secret["type"]) - } - err = json.Unmarshal(data, &spt.inner) - if err != nil { - return err - } - // Don't override the refreshLock or the sender if those have been already set. - if spt.refreshLock == nil { - spt.refreshLock = &sync.RWMutex{} - } - if spt.sender == nil { - spt.sender = sender() - } - return nil -} - -// internal type used for marshalling/unmarshalling -type servicePrincipalToken struct { - Token Token `json:"token"` - Secret ServicePrincipalSecret `json:"secret"` - OauthConfig OAuthConfig `json:"oauth"` - ClientID string `json:"clientID"` - Resource string `json:"resource"` - AutoRefresh bool `json:"autoRefresh"` - RefreshWithin time.Duration `json:"refreshWithin"` -} - -func validateOAuthConfig(oac OAuthConfig) error { - if oac.IsZero() { - return fmt.Errorf("parameter 'oauthConfig' cannot be zero-initialized") - } - return nil -} - -// NewServicePrincipalTokenWithSecret create a ServicePrincipalToken using the supplied ServicePrincipalSecret implementation. -func NewServicePrincipalTokenWithSecret(oauthConfig OAuthConfig, id string, resource string, secret ServicePrincipalSecret, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - if err := validateOAuthConfig(oauthConfig); err != nil { - return nil, err - } - if err := validateStringParam(id, "id"); err != nil { - return nil, err - } - if err := validateStringParam(resource, "resource"); err != nil { - return nil, err - } - if secret == nil { - return nil, fmt.Errorf("parameter 'secret' cannot be nil") - } - spt := &ServicePrincipalToken{ - inner: servicePrincipalToken{ - Token: newToken(), - OauthConfig: oauthConfig, - Secret: secret, - ClientID: id, - Resource: resource, - AutoRefresh: true, - RefreshWithin: defaultRefresh, - }, - refreshLock: &sync.RWMutex{}, - sender: sender(), - refreshCallbacks: callbacks, - } - return spt, nil -} - -// NewServicePrincipalTokenFromManualToken creates a ServicePrincipalToken using the supplied token -func NewServicePrincipalTokenFromManualToken(oauthConfig OAuthConfig, clientID string, resource string, token Token, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - if err := validateOAuthConfig(oauthConfig); err != nil { - return nil, err - } - if err := validateStringParam(clientID, "clientID"); err != nil { - return nil, err - } - if err := validateStringParam(resource, "resource"); err != nil { - return nil, err - } - if token.IsZero() { - return nil, fmt.Errorf("parameter 'token' cannot be zero-initialized") - } - spt, err := NewServicePrincipalTokenWithSecret( - oauthConfig, - clientID, - resource, - &ServicePrincipalNoSecret{}, - callbacks...) - if err != nil { - return nil, err - } - - spt.inner.Token = token - - return spt, nil -} - -// NewServicePrincipalTokenFromManualTokenSecret creates a ServicePrincipalToken using the supplied token and secret -func NewServicePrincipalTokenFromManualTokenSecret(oauthConfig OAuthConfig, clientID string, resource string, token Token, secret ServicePrincipalSecret, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - if err := validateOAuthConfig(oauthConfig); err != nil { - return nil, err - } - if err := validateStringParam(clientID, "clientID"); err != nil { - return nil, err - } - if err := validateStringParam(resource, "resource"); err != nil { - return nil, err - } - if secret == nil { - return nil, fmt.Errorf("parameter 'secret' cannot be nil") - } - if token.IsZero() { - return nil, fmt.Errorf("parameter 'token' cannot be zero-initialized") - } - spt, err := NewServicePrincipalTokenWithSecret( - oauthConfig, - clientID, - resource, - secret, - callbacks...) - if err != nil { - return nil, err - } - - spt.inner.Token = token - - return spt, nil -} - -// NewServicePrincipalToken creates a ServicePrincipalToken from the supplied Service Principal -// credentials scoped to the named resource. -func NewServicePrincipalToken(oauthConfig OAuthConfig, clientID string, secret string, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - if err := validateOAuthConfig(oauthConfig); err != nil { - return nil, err - } - if err := validateStringParam(clientID, "clientID"); err != nil { - return nil, err - } - if err := validateStringParam(secret, "secret"); err != nil { - return nil, err - } - if err := validateStringParam(resource, "resource"); err != nil { - return nil, err - } - return NewServicePrincipalTokenWithSecret( - oauthConfig, - clientID, - resource, - &ServicePrincipalTokenSecret{ - ClientSecret: secret, - }, - callbacks..., - ) -} - -// NewServicePrincipalTokenFromCertificate creates a ServicePrincipalToken from the supplied pkcs12 bytes. -func NewServicePrincipalTokenFromCertificate(oauthConfig OAuthConfig, clientID string, certificate *x509.Certificate, privateKey *rsa.PrivateKey, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - if err := validateOAuthConfig(oauthConfig); err != nil { - return nil, err - } - if err := validateStringParam(clientID, "clientID"); err != nil { - return nil, err - } - if err := validateStringParam(resource, "resource"); err != nil { - return nil, err - } - if certificate == nil { - return nil, fmt.Errorf("parameter 'certificate' cannot be nil") - } - if privateKey == nil { - return nil, fmt.Errorf("parameter 'privateKey' cannot be nil") - } - return NewServicePrincipalTokenWithSecret( - oauthConfig, - clientID, - resource, - &ServicePrincipalCertificateSecret{ - PrivateKey: privateKey, - Certificate: certificate, - }, - callbacks..., - ) -} - -// NewServicePrincipalTokenFromUsernamePassword creates a ServicePrincipalToken from the username and password. -func NewServicePrincipalTokenFromUsernamePassword(oauthConfig OAuthConfig, clientID string, username string, password string, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - if err := validateOAuthConfig(oauthConfig); err != nil { - return nil, err - } - if err := validateStringParam(clientID, "clientID"); err != nil { - return nil, err - } - if err := validateStringParam(username, "username"); err != nil { - return nil, err - } - if err := validateStringParam(password, "password"); err != nil { - return nil, err - } - if err := validateStringParam(resource, "resource"); err != nil { - return nil, err - } - return NewServicePrincipalTokenWithSecret( - oauthConfig, - clientID, - resource, - &ServicePrincipalUsernamePasswordSecret{ - Username: username, - Password: password, - }, - callbacks..., - ) -} - -// NewServicePrincipalTokenFromAuthorizationCode creates a ServicePrincipalToken from the -func NewServicePrincipalTokenFromAuthorizationCode(oauthConfig OAuthConfig, clientID string, clientSecret string, authorizationCode string, redirectURI string, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - - if err := validateOAuthConfig(oauthConfig); err != nil { - return nil, err - } - if err := validateStringParam(clientID, "clientID"); err != nil { - return nil, err - } - if err := validateStringParam(clientSecret, "clientSecret"); err != nil { - return nil, err - } - if err := validateStringParam(authorizationCode, "authorizationCode"); err != nil { - return nil, err - } - if err := validateStringParam(redirectURI, "redirectURI"); err != nil { - return nil, err - } - if err := validateStringParam(resource, "resource"); err != nil { - return nil, err - } - - return NewServicePrincipalTokenWithSecret( - oauthConfig, - clientID, - resource, - &ServicePrincipalAuthorizationCodeSecret{ - ClientSecret: clientSecret, - AuthorizationCode: authorizationCode, - RedirectURI: redirectURI, - }, - callbacks..., - ) -} - -type msiType int - -const ( - msiTypeUnavailable msiType = iota - msiTypeAppServiceV20170901 - msiTypeCloudShell - msiTypeIMDS -) - -func (m msiType) String() string { - switch m { - case msiTypeAppServiceV20170901: - return "AppServiceV20170901" - case msiTypeCloudShell: - return "CloudShell" - case msiTypeIMDS: - return "IMDS" - default: - return fmt.Sprintf("unhandled MSI type %d", m) - } -} - -// returns the MSI type and endpoint, or an error -func getMSIType() (msiType, string, error) { - if endpointEnvVar := os.Getenv(msiEndpointEnv); endpointEnvVar != "" { - // if the env var MSI_ENDPOINT is set - if secretEnvVar := os.Getenv(msiSecretEnv); secretEnvVar != "" { - // if BOTH the env vars MSI_ENDPOINT and MSI_SECRET are set the msiType is AppService - return msiTypeAppServiceV20170901, endpointEnvVar, nil - } - // if ONLY the env var MSI_ENDPOINT is set the msiType is CloudShell - return msiTypeCloudShell, endpointEnvVar, nil - } - // if MSI_ENDPOINT is NOT set assume the msiType is IMDS - return msiTypeIMDS, msiEndpoint, nil -} - -// GetMSIVMEndpoint gets the MSI endpoint on Virtual Machines. -// NOTE: this always returns the IMDS endpoint, it does not work for app services or cloud shell. -// Deprecated: NewServicePrincipalTokenFromMSI() and variants will automatically detect the endpoint. -func GetMSIVMEndpoint() (string, error) { - return msiEndpoint, nil -} - -// GetMSIAppServiceEndpoint get the MSI endpoint for App Service and Functions. -// It will return an error when not running in an app service/functions environment. -// Deprecated: NewServicePrincipalTokenFromMSI() and variants will automatically detect the endpoint. -func GetMSIAppServiceEndpoint() (string, error) { - msiType, endpoint, err := getMSIType() - if err != nil { - return "", err - } - switch msiType { - case msiTypeAppServiceV20170901: - return endpoint, nil - default: - return "", fmt.Errorf("%s is not app service environment", msiType) - } -} - -// GetMSIEndpoint get the appropriate MSI endpoint depending on the runtime environment -// Deprecated: NewServicePrincipalTokenFromMSI() and variants will automatically detect the endpoint. -func GetMSIEndpoint() (string, error) { - _, endpoint, err := getMSIType() - return endpoint, err -} - -// NewServicePrincipalTokenFromMSI creates a ServicePrincipalToken via the MSI VM Extension. -// It will use the system assigned identity when creating the token. -// msiEndpoint - empty string, or pass a non-empty string to override the default value. -// Deprecated: use NewServicePrincipalTokenFromManagedIdentity() instead. -func NewServicePrincipalTokenFromMSI(msiEndpoint, resource string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - return newServicePrincipalTokenFromMSI(msiEndpoint, resource, "", "", callbacks...) -} - -// NewServicePrincipalTokenFromMSIWithUserAssignedID creates a ServicePrincipalToken via the MSI VM Extension. -// It will use the clientID of specified user assigned identity when creating the token. -// msiEndpoint - empty string, or pass a non-empty string to override the default value. -// Deprecated: use NewServicePrincipalTokenFromManagedIdentity() instead. -func NewServicePrincipalTokenFromMSIWithUserAssignedID(msiEndpoint, resource string, userAssignedID string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - if err := validateStringParam(userAssignedID, "userAssignedID"); err != nil { - return nil, err - } - return newServicePrincipalTokenFromMSI(msiEndpoint, resource, userAssignedID, "", callbacks...) -} - -// NewServicePrincipalTokenFromMSIWithIdentityResourceID creates a ServicePrincipalToken via the MSI VM Extension. -// It will use the azure resource id of user assigned identity when creating the token. -// msiEndpoint - empty string, or pass a non-empty string to override the default value. -// Deprecated: use NewServicePrincipalTokenFromManagedIdentity() instead. -func NewServicePrincipalTokenFromMSIWithIdentityResourceID(msiEndpoint, resource string, identityResourceID string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - if err := validateStringParam(identityResourceID, "identityResourceID"); err != nil { - return nil, err - } - return newServicePrincipalTokenFromMSI(msiEndpoint, resource, "", identityResourceID, callbacks...) -} - -// ManagedIdentityOptions contains optional values for configuring managed identity authentication. -type ManagedIdentityOptions struct { - // ClientID is the user-assigned identity to use during authentication. - // It is mutually exclusive with IdentityResourceID. - ClientID string - - // IdentityResourceID is the resource ID of the user-assigned identity to use during authentication. - // It is mutually exclusive with ClientID. - IdentityResourceID string -} - -// NewServicePrincipalTokenFromManagedIdentity creates a ServicePrincipalToken using a managed identity. -// It supports the following managed identity environments. -// - App Service Environment (API version 2017-09-01 only) -// - Cloud shell -// - IMDS with a system or user assigned identity -func NewServicePrincipalTokenFromManagedIdentity(resource string, options *ManagedIdentityOptions, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - if options == nil { - options = &ManagedIdentityOptions{} - } - return newServicePrincipalTokenFromMSI("", resource, options.ClientID, options.IdentityResourceID, callbacks...) -} - -func newServicePrincipalTokenFromMSI(msiEndpoint, resource, userAssignedID, identityResourceID string, callbacks ...TokenRefreshCallback) (*ServicePrincipalToken, error) { - if err := validateStringParam(resource, "resource"); err != nil { - return nil, err - } - if userAssignedID != "" && identityResourceID != "" { - return nil, errors.New("cannot specify userAssignedID and identityResourceID") - } - msiType, endpoint, err := getMSIType() - if err != nil { - logger.Instance.Writef(logger.LogError, "Error determining managed identity environment: %v\n", err) - return nil, err - } - logger.Instance.Writef(logger.LogInfo, "Managed identity environment is %s, endpoint is %s\n", msiType, endpoint) - if msiEndpoint != "" { - endpoint = msiEndpoint - logger.Instance.Writef(logger.LogInfo, "Managed identity custom endpoint is %s\n", endpoint) - } - msiEndpointURL, err := url.Parse(endpoint) - if err != nil { - return nil, err - } - // cloud shell sends its data in the request body - if msiType != msiTypeCloudShell { - v := url.Values{} - v.Set("resource", resource) - clientIDParam := "client_id" - switch msiType { - case msiTypeAppServiceV20170901: - clientIDParam = "clientid" - v.Set("api-version", appServiceAPIVersion2017) - break - case msiTypeIMDS: - v.Set("api-version", msiAPIVersion) - } - if userAssignedID != "" { - v.Set(clientIDParam, userAssignedID) - } else if identityResourceID != "" { - v.Set("mi_res_id", identityResourceID) - } - msiEndpointURL.RawQuery = v.Encode() - } - - spt := &ServicePrincipalToken{ - inner: servicePrincipalToken{ - Token: newToken(), - OauthConfig: OAuthConfig{ - TokenEndpoint: *msiEndpointURL, - }, - Secret: &ServicePrincipalMSISecret{ - msiType: msiType, - clientResourceID: identityResourceID, - }, - Resource: resource, - AutoRefresh: true, - RefreshWithin: defaultRefresh, - ClientID: userAssignedID, - }, - refreshLock: &sync.RWMutex{}, - sender: sender(), - refreshCallbacks: callbacks, - MaxMSIRefreshAttempts: defaultMaxMSIRefreshAttempts, - } - - return spt, nil -} - -// internal type that implements TokenRefreshError -type tokenRefreshError struct { - message string - resp *http.Response -} - -// Error implements the error interface which is part of the TokenRefreshError interface. -func (tre tokenRefreshError) Error() string { - return tre.message -} - -// Response implements the TokenRefreshError interface, it returns the raw HTTP response from the refresh operation. -func (tre tokenRefreshError) Response() *http.Response { - return tre.resp -} - -func newTokenRefreshError(message string, resp *http.Response) TokenRefreshError { - return tokenRefreshError{message: message, resp: resp} -} - -// EnsureFresh will refresh the token if it will expire within the refresh window (as set by -// RefreshWithin) and autoRefresh flag is on. This method is safe for concurrent use. -func (spt *ServicePrincipalToken) EnsureFresh() error { - return spt.EnsureFreshWithContext(context.Background()) -} - -// EnsureFreshWithContext will refresh the token if it will expire within the refresh window (as set by -// RefreshWithin) and autoRefresh flag is on. This method is safe for concurrent use. -func (spt *ServicePrincipalToken) EnsureFreshWithContext(ctx context.Context) error { - // must take the read lock when initially checking the token's expiration - if spt.inner.AutoRefresh && spt.Token().WillExpireIn(spt.inner.RefreshWithin) { - // take the write lock then check again to see if the token was already refreshed - spt.refreshLock.Lock() - defer spt.refreshLock.Unlock() - if spt.inner.Token.WillExpireIn(spt.inner.RefreshWithin) { - return spt.refreshInternal(ctx, spt.inner.Resource) - } - } - return nil -} - -// InvokeRefreshCallbacks calls any TokenRefreshCallbacks that were added to the SPT during initialization -func (spt *ServicePrincipalToken) InvokeRefreshCallbacks(token Token) error { - if spt.refreshCallbacks != nil { - for _, callback := range spt.refreshCallbacks { - err := callback(spt.inner.Token) - if err != nil { - return fmt.Errorf("adal: TokenRefreshCallback handler failed. Error = '%v'", err) - } - } - } - return nil -} - -// Refresh obtains a fresh token for the Service Principal. -// This method is safe for concurrent use. -func (spt *ServicePrincipalToken) Refresh() error { - return spt.RefreshWithContext(context.Background()) -} - -// RefreshWithContext obtains a fresh token for the Service Principal. -// This method is safe for concurrent use. -func (spt *ServicePrincipalToken) RefreshWithContext(ctx context.Context) error { - spt.refreshLock.Lock() - defer spt.refreshLock.Unlock() - return spt.refreshInternal(ctx, spt.inner.Resource) -} - -// RefreshExchange refreshes the token, but for a different resource. -// This method is safe for concurrent use. -func (spt *ServicePrincipalToken) RefreshExchange(resource string) error { - return spt.RefreshExchangeWithContext(context.Background(), resource) -} - -// RefreshExchangeWithContext refreshes the token, but for a different resource. -// This method is safe for concurrent use. -func (spt *ServicePrincipalToken) RefreshExchangeWithContext(ctx context.Context, resource string) error { - spt.refreshLock.Lock() - defer spt.refreshLock.Unlock() - return spt.refreshInternal(ctx, resource) -} - -func (spt *ServicePrincipalToken) getGrantType() string { - switch spt.inner.Secret.(type) { - case *ServicePrincipalUsernamePasswordSecret: - return OAuthGrantTypeUserPass - case *ServicePrincipalAuthorizationCodeSecret: - return OAuthGrantTypeAuthorizationCode - default: - return OAuthGrantTypeClientCredentials - } -} - -func (spt *ServicePrincipalToken) refreshInternal(ctx context.Context, resource string) error { - if spt.customRefreshFunc != nil { - token, err := spt.customRefreshFunc(ctx, resource) - if err != nil { - return err - } - spt.inner.Token = *token - return spt.InvokeRefreshCallbacks(spt.inner.Token) - } - req, err := http.NewRequest(http.MethodPost, spt.inner.OauthConfig.TokenEndpoint.String(), nil) - if err != nil { - return fmt.Errorf("adal: Failed to build the refresh request. Error = '%v'", err) - } - req.Header.Add("User-Agent", UserAgent()) - req = req.WithContext(ctx) - var resp *http.Response - authBodyFilter := func(b []byte) []byte { - if logger.Level() != logger.LogAuth { - return []byte("**REDACTED** authentication body") - } - return b - } - if msiSecret, ok := spt.inner.Secret.(*ServicePrincipalMSISecret); ok { - switch msiSecret.msiType { - case msiTypeAppServiceV20170901: - req.Method = http.MethodGet - req.Header.Set("secret", os.Getenv(msiSecretEnv)) - break - case msiTypeCloudShell: - req.Header.Set("Metadata", "true") - data := url.Values{} - data.Set("resource", spt.inner.Resource) - if spt.inner.ClientID != "" { - data.Set("client_id", spt.inner.ClientID) - } else if msiSecret.clientResourceID != "" { - data.Set("msi_res_id", msiSecret.clientResourceID) - } - req.Body = ioutil.NopCloser(strings.NewReader(data.Encode())) - req.Header.Set("Content-Type", "application/x-www-form-urlencoded") - break - case msiTypeIMDS: - req.Method = http.MethodGet - req.Header.Set("Metadata", "true") - break - } - logger.Instance.WriteRequest(req, logger.Filter{Body: authBodyFilter}) - resp, err = retryForIMDS(spt.sender, req, spt.MaxMSIRefreshAttempts) - } else { - v := url.Values{} - v.Set("client_id", spt.inner.ClientID) - v.Set("resource", resource) - - if spt.inner.Token.RefreshToken != "" { - v.Set("grant_type", OAuthGrantTypeRefreshToken) - v.Set("refresh_token", spt.inner.Token.RefreshToken) - // web apps must specify client_secret when refreshing tokens - // see https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-protocols-oauth-code#refreshing-the-access-tokens - if spt.getGrantType() == OAuthGrantTypeAuthorizationCode { - err := spt.inner.Secret.SetAuthenticationValues(spt, &v) - if err != nil { - return err - } - } - } else { - v.Set("grant_type", spt.getGrantType()) - err := spt.inner.Secret.SetAuthenticationValues(spt, &v) - if err != nil { - return err - } - } - - s := v.Encode() - body := ioutil.NopCloser(strings.NewReader(s)) - req.ContentLength = int64(len(s)) - req.Header.Set(contentType, mimeTypeFormPost) - req.Body = body - logger.Instance.WriteRequest(req, logger.Filter{Body: authBodyFilter}) - resp, err = spt.sender.Do(req) - } - - // don't return a TokenRefreshError here; this will allow retry logic to apply - if err != nil { - return fmt.Errorf("adal: Failed to execute the refresh request. Error = '%v'", err) - } else if resp == nil { - return fmt.Errorf("adal: received nil response and error") - } - - logger.Instance.WriteResponse(resp, logger.Filter{Body: authBodyFilter}) - defer resp.Body.Close() - rb, err := ioutil.ReadAll(resp.Body) - - if resp.StatusCode != http.StatusOK { - if err != nil { - return newTokenRefreshError(fmt.Sprintf("adal: Refresh request failed. Status Code = '%d'. Failed reading response body: %v Endpoint %s", resp.StatusCode, err, req.URL.String()), resp) - } - return newTokenRefreshError(fmt.Sprintf("adal: Refresh request failed. Status Code = '%d'. Response body: %s Endpoint %s", resp.StatusCode, string(rb), req.URL.String()), resp) - } - - // for the following error cases don't return a TokenRefreshError. the operation succeeded - // but some transient failure happened during deserialization. by returning a generic error - // the retry logic will kick in (we don't retry on TokenRefreshError). - - if err != nil { - return fmt.Errorf("adal: Failed to read a new service principal token during refresh. Error = '%v'", err) - } - if len(strings.Trim(string(rb), " ")) == 0 { - return fmt.Errorf("adal: Empty service principal token received during refresh") - } - token := struct { - AccessToken string `json:"access_token"` - RefreshToken string `json:"refresh_token"` - - // AAD returns expires_in as a string, ADFS returns it as an int - ExpiresIn json.Number `json:"expires_in"` - // expires_on can be in two formats, a UTC time stamp or the number of seconds. - ExpiresOn string `json:"expires_on"` - NotBefore json.Number `json:"not_before"` - - Resource string `json:"resource"` - Type string `json:"token_type"` - }{} - // return a TokenRefreshError in the follow error cases as the token is in an unexpected format - err = json.Unmarshal(rb, &token) - if err != nil { - return newTokenRefreshError(fmt.Sprintf("adal: Failed to unmarshal the service principal token during refresh. Error = '%v' JSON = '%s'", err, string(rb)), resp) - } - expiresOn := json.Number("") - // ADFS doesn't include the expires_on field - if token.ExpiresOn != "" { - if expiresOn, err = parseExpiresOn(token.ExpiresOn); err != nil { - return newTokenRefreshError(fmt.Sprintf("adal: failed to parse expires_on: %v value '%s'", err, token.ExpiresOn), resp) - } - } - spt.inner.Token.AccessToken = token.AccessToken - spt.inner.Token.RefreshToken = token.RefreshToken - spt.inner.Token.ExpiresIn = token.ExpiresIn - spt.inner.Token.ExpiresOn = expiresOn - spt.inner.Token.NotBefore = token.NotBefore - spt.inner.Token.Resource = token.Resource - spt.inner.Token.Type = token.Type - - return spt.InvokeRefreshCallbacks(spt.inner.Token) -} - -// converts expires_on to the number of seconds -func parseExpiresOn(s string) (json.Number, error) { - // convert the expiration date to the number of seconds from now - timeToDuration := func(t time.Time) json.Number { - dur := t.Sub(time.Now().UTC()) - return json.Number(strconv.FormatInt(int64(dur.Round(time.Second).Seconds()), 10)) - } - if _, err := strconv.ParseInt(s, 10, 64); err == nil { - // this is the number of seconds case, no conversion required - return json.Number(s), nil - } else if eo, err := time.Parse(expiresOnDateFormatPM, s); err == nil { - return timeToDuration(eo), nil - } else if eo, err := time.Parse(expiresOnDateFormat, s); err == nil { - return timeToDuration(eo), nil - } else { - // unknown format - return json.Number(""), err - } -} - -// retry logic specific to retrieving a token from the IMDS endpoint -func retryForIMDS(sender Sender, req *http.Request, maxAttempts int) (resp *http.Response, err error) { - // copied from client.go due to circular dependency - retries := []int{ - http.StatusRequestTimeout, // 408 - http.StatusTooManyRequests, // 429 - http.StatusInternalServerError, // 500 - http.StatusBadGateway, // 502 - http.StatusServiceUnavailable, // 503 - http.StatusGatewayTimeout, // 504 - } - // extra retry status codes specific to IMDS - retries = append(retries, - http.StatusNotFound, - http.StatusGone, - // all remaining 5xx - http.StatusNotImplemented, - http.StatusHTTPVersionNotSupported, - http.StatusVariantAlsoNegotiates, - http.StatusInsufficientStorage, - http.StatusLoopDetected, - http.StatusNotExtended, - http.StatusNetworkAuthenticationRequired) - - // see https://docs.microsoft.com/en-us/azure/active-directory/managed-service-identity/how-to-use-vm-token#retry-guidance - - const maxDelay time.Duration = 60 * time.Second - - attempt := 0 - delay := time.Duration(0) - - // maxAttempts is user-specified, ensure that its value is greater than zero else no request will be made - if maxAttempts < 1 { - maxAttempts = defaultMaxMSIRefreshAttempts - } - - for attempt < maxAttempts { - if resp != nil && resp.Body != nil { - io.Copy(ioutil.Discard, resp.Body) - resp.Body.Close() - } - resp, err = sender.Do(req) - // we want to retry if err is not nil or the status code is in the list of retry codes - if err == nil && !responseHasStatusCode(resp, retries...) { - return - } - - // perform exponential backoff with a cap. - // must increment attempt before calculating delay. - attempt++ - // the base value of 2 is the "delta backoff" as specified in the guidance doc - delay += (time.Duration(math.Pow(2, float64(attempt))) * time.Second) - if delay > maxDelay { - delay = maxDelay - } - - select { - case <-time.After(delay): - // intentionally left blank - case <-req.Context().Done(): - err = req.Context().Err() - return - } - } - return -} - -func responseHasStatusCode(resp *http.Response, codes ...int) bool { - if resp != nil { - for _, i := range codes { - if i == resp.StatusCode { - return true - } - } - } - return false -} - -// SetAutoRefresh enables or disables automatic refreshing of stale tokens. -func (spt *ServicePrincipalToken) SetAutoRefresh(autoRefresh bool) { - spt.inner.AutoRefresh = autoRefresh -} - -// SetRefreshWithin sets the interval within which if the token will expire, EnsureFresh will -// refresh the token. -func (spt *ServicePrincipalToken) SetRefreshWithin(d time.Duration) { - spt.inner.RefreshWithin = d - return -} - -// SetSender sets the http.Client used when obtaining the Service Principal token. An -// undecorated http.Client is used by default. -func (spt *ServicePrincipalToken) SetSender(s Sender) { spt.sender = s } - -// OAuthToken implements the OAuthTokenProvider interface. It returns the current access token. -func (spt *ServicePrincipalToken) OAuthToken() string { - spt.refreshLock.RLock() - defer spt.refreshLock.RUnlock() - return spt.inner.Token.OAuthToken() -} - -// Token returns a copy of the current token. -func (spt *ServicePrincipalToken) Token() Token { - spt.refreshLock.RLock() - defer spt.refreshLock.RUnlock() - return spt.inner.Token -} - -// MultiTenantServicePrincipalToken contains tokens for multi-tenant authorization. -type MultiTenantServicePrincipalToken struct { - PrimaryToken *ServicePrincipalToken - AuxiliaryTokens []*ServicePrincipalToken -} - -// PrimaryOAuthToken returns the primary authorization token. -func (mt *MultiTenantServicePrincipalToken) PrimaryOAuthToken() string { - return mt.PrimaryToken.OAuthToken() -} - -// AuxiliaryOAuthTokens returns one to three auxiliary authorization tokens. -func (mt *MultiTenantServicePrincipalToken) AuxiliaryOAuthTokens() []string { - tokens := make([]string, len(mt.AuxiliaryTokens)) - for i := range mt.AuxiliaryTokens { - tokens[i] = mt.AuxiliaryTokens[i].OAuthToken() - } - return tokens -} - -// NewMultiTenantServicePrincipalToken creates a new MultiTenantServicePrincipalToken with the specified credentials and resource. -func NewMultiTenantServicePrincipalToken(multiTenantCfg MultiTenantOAuthConfig, clientID string, secret string, resource string) (*MultiTenantServicePrincipalToken, error) { - if err := validateStringParam(clientID, "clientID"); err != nil { - return nil, err - } - if err := validateStringParam(secret, "secret"); err != nil { - return nil, err - } - if err := validateStringParam(resource, "resource"); err != nil { - return nil, err - } - auxTenants := multiTenantCfg.AuxiliaryTenants() - m := MultiTenantServicePrincipalToken{ - AuxiliaryTokens: make([]*ServicePrincipalToken, len(auxTenants)), - } - primary, err := NewServicePrincipalToken(*multiTenantCfg.PrimaryTenant(), clientID, secret, resource) - if err != nil { - return nil, fmt.Errorf("failed to create SPT for primary tenant: %v", err) - } - m.PrimaryToken = primary - for i := range auxTenants { - aux, err := NewServicePrincipalToken(*auxTenants[i], clientID, secret, resource) - if err != nil { - return nil, fmt.Errorf("failed to create SPT for auxiliary tenant: %v", err) - } - m.AuxiliaryTokens[i] = aux - } - return &m, nil -} - -// NewMultiTenantServicePrincipalTokenFromCertificate creates a new MultiTenantServicePrincipalToken with the specified certificate credentials and resource. -func NewMultiTenantServicePrincipalTokenFromCertificate(multiTenantCfg MultiTenantOAuthConfig, clientID string, certificate *x509.Certificate, privateKey *rsa.PrivateKey, resource string) (*MultiTenantServicePrincipalToken, error) { - if err := validateStringParam(clientID, "clientID"); err != nil { - return nil, err - } - if err := validateStringParam(resource, "resource"); err != nil { - return nil, err - } - if certificate == nil { - return nil, fmt.Errorf("parameter 'certificate' cannot be nil") - } - if privateKey == nil { - return nil, fmt.Errorf("parameter 'privateKey' cannot be nil") - } - auxTenants := multiTenantCfg.AuxiliaryTenants() - m := MultiTenantServicePrincipalToken{ - AuxiliaryTokens: make([]*ServicePrincipalToken, len(auxTenants)), - } - primary, err := NewServicePrincipalTokenWithSecret( - *multiTenantCfg.PrimaryTenant(), - clientID, - resource, - &ServicePrincipalCertificateSecret{ - PrivateKey: privateKey, - Certificate: certificate, - }, - ) - if err != nil { - return nil, fmt.Errorf("failed to create SPT for primary tenant: %v", err) - } - m.PrimaryToken = primary - for i := range auxTenants { - aux, err := NewServicePrincipalTokenWithSecret( - *auxTenants[i], - clientID, - resource, - &ServicePrincipalCertificateSecret{ - PrivateKey: privateKey, - Certificate: certificate, - }, - ) - if err != nil { - return nil, fmt.Errorf("failed to create SPT for auxiliary tenant: %v", err) - } - m.AuxiliaryTokens[i] = aux - } - return &m, nil -} - -// MSIAvailable returns true if the MSI endpoint is available for authentication. -func MSIAvailable(ctx context.Context, s Sender) bool { - if s == nil { - s = sender() - } - resp, err := getMSIEndpoint(ctx, s) - if err == nil { - resp.Body.Close() - } - return err == nil -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/token_1.13.go b/vendor/github.com/Azure/go-autorest/autorest/adal/token_1.13.go deleted file mode 100644 index 89190a4213..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/token_1.13.go +++ /dev/null @@ -1,76 +0,0 @@ -//go:build go1.13 -// +build go1.13 - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package adal - -import ( - "context" - "fmt" - "net/http" - "time" -) - -func getMSIEndpoint(ctx context.Context, sender Sender) (*http.Response, error) { - tempCtx, cancel := context.WithTimeout(ctx, 2*time.Second) - defer cancel() - // http.NewRequestWithContext() was added in Go 1.13 - req, _ := http.NewRequestWithContext(tempCtx, http.MethodGet, msiEndpoint, nil) - q := req.URL.Query() - q.Add("api-version", msiAPIVersion) - req.URL.RawQuery = q.Encode() - return sender.Do(req) -} - -// EnsureFreshWithContext will refresh the token if it will expire within the refresh window (as set by -// RefreshWithin) and autoRefresh flag is on. This method is safe for concurrent use. -func (mt *MultiTenantServicePrincipalToken) EnsureFreshWithContext(ctx context.Context) error { - if err := mt.PrimaryToken.EnsureFreshWithContext(ctx); err != nil { - return fmt.Errorf("failed to refresh primary token: %w", err) - } - for _, aux := range mt.AuxiliaryTokens { - if err := aux.EnsureFreshWithContext(ctx); err != nil { - return fmt.Errorf("failed to refresh auxiliary token: %w", err) - } - } - return nil -} - -// RefreshWithContext obtains a fresh token for the Service Principal. -func (mt *MultiTenantServicePrincipalToken) RefreshWithContext(ctx context.Context) error { - if err := mt.PrimaryToken.RefreshWithContext(ctx); err != nil { - return fmt.Errorf("failed to refresh primary token: %w", err) - } - for _, aux := range mt.AuxiliaryTokens { - if err := aux.RefreshWithContext(ctx); err != nil { - return fmt.Errorf("failed to refresh auxiliary token: %w", err) - } - } - return nil -} - -// RefreshExchangeWithContext refreshes the token, but for a different resource. -func (mt *MultiTenantServicePrincipalToken) RefreshExchangeWithContext(ctx context.Context, resource string) error { - if err := mt.PrimaryToken.RefreshExchangeWithContext(ctx, resource); err != nil { - return fmt.Errorf("failed to refresh primary token: %w", err) - } - for _, aux := range mt.AuxiliaryTokens { - if err := aux.RefreshExchangeWithContext(ctx, resource); err != nil { - return fmt.Errorf("failed to refresh auxiliary token: %w", err) - } - } - return nil -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/token_legacy.go b/vendor/github.com/Azure/go-autorest/autorest/adal/token_legacy.go deleted file mode 100644 index 27ec4efad7..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/token_legacy.go +++ /dev/null @@ -1,75 +0,0 @@ -//go:build !go1.13 -// +build !go1.13 - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package adal - -import ( - "context" - "net/http" - "time" -) - -func getMSIEndpoint(ctx context.Context, sender Sender) (*http.Response, error) { - tempCtx, cancel := context.WithTimeout(ctx, 2*time.Second) - defer cancel() - req, _ := http.NewRequest(http.MethodGet, msiEndpoint, nil) - req = req.WithContext(tempCtx) - q := req.URL.Query() - q.Add("api-version", msiAPIVersion) - req.URL.RawQuery = q.Encode() - return sender.Do(req) -} - -// EnsureFreshWithContext will refresh the token if it will expire within the refresh window (as set by -// RefreshWithin) and autoRefresh flag is on. This method is safe for concurrent use. -func (mt *MultiTenantServicePrincipalToken) EnsureFreshWithContext(ctx context.Context) error { - if err := mt.PrimaryToken.EnsureFreshWithContext(ctx); err != nil { - return err - } - for _, aux := range mt.AuxiliaryTokens { - if err := aux.EnsureFreshWithContext(ctx); err != nil { - return err - } - } - return nil -} - -// RefreshWithContext obtains a fresh token for the Service Principal. -func (mt *MultiTenantServicePrincipalToken) RefreshWithContext(ctx context.Context) error { - if err := mt.PrimaryToken.RefreshWithContext(ctx); err != nil { - return err - } - for _, aux := range mt.AuxiliaryTokens { - if err := aux.RefreshWithContext(ctx); err != nil { - return err - } - } - return nil -} - -// RefreshExchangeWithContext refreshes the token, but for a different resource. -func (mt *MultiTenantServicePrincipalToken) RefreshExchangeWithContext(ctx context.Context, resource string) error { - if err := mt.PrimaryToken.RefreshExchangeWithContext(ctx, resource); err != nil { - return err - } - for _, aux := range mt.AuxiliaryTokens { - if err := aux.RefreshExchangeWithContext(ctx, resource); err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/adal/version.go b/vendor/github.com/Azure/go-autorest/autorest/adal/version.go deleted file mode 100644 index c867b34843..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/adal/version.go +++ /dev/null @@ -1,45 +0,0 @@ -package adal - -import ( - "fmt" - "runtime" -) - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -const number = "v1.0.0" - -var ( - ua = fmt.Sprintf("Go/%s (%s-%s) go-autorest/adal/%s", - runtime.Version(), - runtime.GOARCH, - runtime.GOOS, - number, - ) -) - -// UserAgent returns a string containing the Go version, system architecture and OS, and the adal version. -func UserAgent() string { - return ua -} - -// AddToUserAgent adds an extension to the current user agent -func AddToUserAgent(extension string) error { - if extension != "" { - ua = fmt.Sprintf("%s %s", ua, extension) - return nil - } - return fmt.Errorf("Extension was empty, User Agent remained as '%s'", ua) -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/authorization.go b/vendor/github.com/Azure/go-autorest/autorest/authorization.go deleted file mode 100644 index 1226c41115..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/authorization.go +++ /dev/null @@ -1,353 +0,0 @@ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "crypto/tls" - "encoding/base64" - "fmt" - "net/http" - "net/url" - "strings" - - "github.com/Azure/go-autorest/autorest/adal" -) - -const ( - bearerChallengeHeader = "Www-Authenticate" - bearer = "Bearer" - tenantID = "tenantID" - apiKeyAuthorizerHeader = "Ocp-Apim-Subscription-Key" - bingAPISdkHeader = "X-BingApis-SDK-Client" - golangBingAPISdkHeaderValue = "Go-SDK" - authorization = "Authorization" - basic = "Basic" -) - -// Authorizer is the interface that provides a PrepareDecorator used to supply request -// authorization. Most often, the Authorizer decorator runs last so it has access to the full -// state of the formed HTTP request. -type Authorizer interface { - WithAuthorization() PrepareDecorator -} - -// NullAuthorizer implements a default, "do nothing" Authorizer. -type NullAuthorizer struct{} - -// WithAuthorization returns a PrepareDecorator that does nothing. -func (na NullAuthorizer) WithAuthorization() PrepareDecorator { - return WithNothing() -} - -// APIKeyAuthorizer implements API Key authorization. -type APIKeyAuthorizer struct { - headers map[string]interface{} - queryParameters map[string]interface{} -} - -// NewAPIKeyAuthorizerWithHeaders creates an ApiKeyAuthorizer with headers. -func NewAPIKeyAuthorizerWithHeaders(headers map[string]interface{}) *APIKeyAuthorizer { - return NewAPIKeyAuthorizer(headers, nil) -} - -// NewAPIKeyAuthorizerWithQueryParameters creates an ApiKeyAuthorizer with query parameters. -func NewAPIKeyAuthorizerWithQueryParameters(queryParameters map[string]interface{}) *APIKeyAuthorizer { - return NewAPIKeyAuthorizer(nil, queryParameters) -} - -// NewAPIKeyAuthorizer creates an ApiKeyAuthorizer with headers. -func NewAPIKeyAuthorizer(headers map[string]interface{}, queryParameters map[string]interface{}) *APIKeyAuthorizer { - return &APIKeyAuthorizer{headers: headers, queryParameters: queryParameters} -} - -// WithAuthorization returns a PrepareDecorator that adds an HTTP headers and Query Parameters. -func (aka *APIKeyAuthorizer) WithAuthorization() PrepareDecorator { - return func(p Preparer) Preparer { - return DecoratePreparer(p, WithHeaders(aka.headers), WithQueryParameters(aka.queryParameters)) - } -} - -// CognitiveServicesAuthorizer implements authorization for Cognitive Services. -type CognitiveServicesAuthorizer struct { - subscriptionKey string -} - -// NewCognitiveServicesAuthorizer is -func NewCognitiveServicesAuthorizer(subscriptionKey string) *CognitiveServicesAuthorizer { - return &CognitiveServicesAuthorizer{subscriptionKey: subscriptionKey} -} - -// WithAuthorization is -func (csa *CognitiveServicesAuthorizer) WithAuthorization() PrepareDecorator { - headers := make(map[string]interface{}) - headers[apiKeyAuthorizerHeader] = csa.subscriptionKey - headers[bingAPISdkHeader] = golangBingAPISdkHeaderValue - - return NewAPIKeyAuthorizerWithHeaders(headers).WithAuthorization() -} - -// BearerAuthorizer implements the bearer authorization -type BearerAuthorizer struct { - tokenProvider adal.OAuthTokenProvider -} - -// NewBearerAuthorizer crates a BearerAuthorizer using the given token provider -func NewBearerAuthorizer(tp adal.OAuthTokenProvider) *BearerAuthorizer { - return &BearerAuthorizer{tokenProvider: tp} -} - -// WithAuthorization returns a PrepareDecorator that adds an HTTP Authorization header whose -// value is "Bearer " followed by the token. -// -// By default, the token will be automatically refreshed through the Refresher interface. -func (ba *BearerAuthorizer) WithAuthorization() PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - // the ordering is important here, prefer RefresherWithContext if available - if refresher, ok := ba.tokenProvider.(adal.RefresherWithContext); ok { - err = refresher.EnsureFreshWithContext(r.Context()) - } else if refresher, ok := ba.tokenProvider.(adal.Refresher); ok { - err = refresher.EnsureFresh() - } - if err != nil { - var resp *http.Response - if tokError, ok := err.(adal.TokenRefreshError); ok { - resp = tokError.Response() - } - return r, NewErrorWithError(err, "azure.BearerAuthorizer", "WithAuthorization", resp, - "Failed to refresh the Token for request to %s", r.URL) - } - return Prepare(r, WithHeader(headerAuthorization, fmt.Sprintf("Bearer %s", ba.tokenProvider.OAuthToken()))) - } - return r, err - }) - } -} - -// TokenProvider returns OAuthTokenProvider so that it can be used for authorization outside the REST. -func (ba *BearerAuthorizer) TokenProvider() adal.OAuthTokenProvider { - return ba.tokenProvider -} - -// BearerAuthorizerCallbackFunc is the authentication callback signature. -type BearerAuthorizerCallbackFunc func(tenantID, resource string) (*BearerAuthorizer, error) - -// BearerAuthorizerCallback implements bearer authorization via a callback. -type BearerAuthorizerCallback struct { - sender Sender - callback BearerAuthorizerCallbackFunc -} - -// NewBearerAuthorizerCallback creates a bearer authorization callback. The callback -// is invoked when the HTTP request is submitted. -func NewBearerAuthorizerCallback(s Sender, callback BearerAuthorizerCallbackFunc) *BearerAuthorizerCallback { - if s == nil { - s = sender(tls.RenegotiateNever) - } - return &BearerAuthorizerCallback{sender: s, callback: callback} -} - -// WithAuthorization returns a PrepareDecorator that adds an HTTP Authorization header whose value -// is "Bearer " followed by the token. The BearerAuthorizer is obtained via a user-supplied callback. -// -// By default, the token will be automatically refreshed through the Refresher interface. -func (bacb *BearerAuthorizerCallback) WithAuthorization() PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - // make a copy of the request and remove the body as it's not - // required and avoids us having to create a copy of it. - rCopy := *r - removeRequestBody(&rCopy) - - resp, err := bacb.sender.Do(&rCopy) - if err != nil { - return r, err - } - DrainResponseBody(resp) - if resp.StatusCode == 401 && hasBearerChallenge(resp.Header) { - bc, err := newBearerChallenge(resp.Header) - if err != nil { - return r, err - } - if bacb.callback != nil { - ba, err := bacb.callback(bc.values[tenantID], bc.values["resource"]) - if err != nil { - return r, err - } - return Prepare(r, ba.WithAuthorization()) - } - } - } - return r, err - }) - } -} - -// returns true if the HTTP response contains a bearer challenge -func hasBearerChallenge(header http.Header) bool { - authHeader := header.Get(bearerChallengeHeader) - if len(authHeader) == 0 || strings.Index(authHeader, bearer) < 0 { - return false - } - return true -} - -type bearerChallenge struct { - values map[string]string -} - -func newBearerChallenge(header http.Header) (bc bearerChallenge, err error) { - challenge := strings.TrimSpace(header.Get(bearerChallengeHeader)) - trimmedChallenge := challenge[len(bearer)+1:] - - // challenge is a set of key=value pairs that are comma delimited - pairs := strings.Split(trimmedChallenge, ",") - if len(pairs) < 1 { - err = fmt.Errorf("challenge '%s' contains no pairs", challenge) - return bc, err - } - - bc.values = make(map[string]string) - for i := range pairs { - trimmedPair := strings.TrimSpace(pairs[i]) - pair := strings.Split(trimmedPair, "=") - if len(pair) == 2 { - // remove the enclosing quotes - key := strings.Trim(pair[0], "\"") - value := strings.Trim(pair[1], "\"") - - switch key { - case "authorization", "authorization_uri": - // strip the tenant ID from the authorization URL - asURL, err := url.Parse(value) - if err != nil { - return bc, err - } - bc.values[tenantID] = asURL.Path[1:] - default: - bc.values[key] = value - } - } - } - - return bc, err -} - -// EventGridKeyAuthorizer implements authorization for event grid using key authentication. -type EventGridKeyAuthorizer struct { - topicKey string -} - -// NewEventGridKeyAuthorizer creates a new EventGridKeyAuthorizer -// with the specified topic key. -func NewEventGridKeyAuthorizer(topicKey string) EventGridKeyAuthorizer { - return EventGridKeyAuthorizer{topicKey: topicKey} -} - -// WithAuthorization returns a PrepareDecorator that adds the aeg-sas-key authentication header. -func (egta EventGridKeyAuthorizer) WithAuthorization() PrepareDecorator { - headers := map[string]interface{}{ - "aeg-sas-key": egta.topicKey, - } - return NewAPIKeyAuthorizerWithHeaders(headers).WithAuthorization() -} - -// BasicAuthorizer implements basic HTTP authorization by adding the Authorization HTTP header -// with the value "Basic " where is a base64-encoded username:password tuple. -type BasicAuthorizer struct { - userName string - password string -} - -// NewBasicAuthorizer creates a new BasicAuthorizer with the specified username and password. -func NewBasicAuthorizer(userName, password string) *BasicAuthorizer { - return &BasicAuthorizer{ - userName: userName, - password: password, - } -} - -// WithAuthorization returns a PrepareDecorator that adds an HTTP Authorization header whose -// value is "Basic " followed by the base64-encoded username:password tuple. -func (ba *BasicAuthorizer) WithAuthorization() PrepareDecorator { - headers := make(map[string]interface{}) - headers[authorization] = basic + " " + base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s:%s", ba.userName, ba.password))) - - return NewAPIKeyAuthorizerWithHeaders(headers).WithAuthorization() -} - -// MultiTenantServicePrincipalTokenAuthorizer provides authentication across tenants. -type MultiTenantServicePrincipalTokenAuthorizer interface { - WithAuthorization() PrepareDecorator -} - -// NewMultiTenantServicePrincipalTokenAuthorizer crates a BearerAuthorizer using the given token provider -func NewMultiTenantServicePrincipalTokenAuthorizer(tp adal.MultitenantOAuthTokenProvider) MultiTenantServicePrincipalTokenAuthorizer { - return NewMultiTenantBearerAuthorizer(tp) -} - -// MultiTenantBearerAuthorizer implements bearer authorization across multiple tenants. -type MultiTenantBearerAuthorizer struct { - tp adal.MultitenantOAuthTokenProvider -} - -// NewMultiTenantBearerAuthorizer creates a MultiTenantBearerAuthorizer using the given token provider. -func NewMultiTenantBearerAuthorizer(tp adal.MultitenantOAuthTokenProvider) *MultiTenantBearerAuthorizer { - return &MultiTenantBearerAuthorizer{tp: tp} -} - -// WithAuthorization returns a PrepareDecorator that adds an HTTP Authorization header using the -// primary token along with the auxiliary authorization header using the auxiliary tokens. -// -// By default, the token will be automatically refreshed through the Refresher interface. -func (mt *MultiTenantBearerAuthorizer) WithAuthorization() PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err != nil { - return r, err - } - if refresher, ok := mt.tp.(adal.RefresherWithContext); ok { - err = refresher.EnsureFreshWithContext(r.Context()) - if err != nil { - var resp *http.Response - if tokError, ok := err.(adal.TokenRefreshError); ok { - resp = tokError.Response() - } - return r, NewErrorWithError(err, "azure.multiTenantSPTAuthorizer", "WithAuthorization", resp, - "Failed to refresh one or more Tokens for request to %s", r.URL) - } - } - r, err = Prepare(r, WithHeader(headerAuthorization, fmt.Sprintf("Bearer %s", mt.tp.PrimaryOAuthToken()))) - if err != nil { - return r, err - } - auxTokens := mt.tp.AuxiliaryOAuthTokens() - for i := range auxTokens { - auxTokens[i] = fmt.Sprintf("Bearer %s", auxTokens[i]) - } - return Prepare(r, WithHeader(headerAuxAuthorization, strings.Join(auxTokens, ", "))) - }) - } -} - -// TokenProvider returns the underlying MultitenantOAuthTokenProvider for this authorizer. -func (mt *MultiTenantBearerAuthorizer) TokenProvider() adal.MultitenantOAuthTokenProvider { - return mt.tp -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/authorization_sas.go b/vendor/github.com/Azure/go-autorest/autorest/authorization_sas.go deleted file mode 100644 index 66501493bd..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/authorization_sas.go +++ /dev/null @@ -1,66 +0,0 @@ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "fmt" - "net/http" - "strings" -) - -// SASTokenAuthorizer implements an authorization for SAS Token Authentication -// this can be used for interaction with Blob Storage Endpoints -type SASTokenAuthorizer struct { - sasToken string -} - -// NewSASTokenAuthorizer creates a SASTokenAuthorizer using the given credentials -func NewSASTokenAuthorizer(sasToken string) (*SASTokenAuthorizer, error) { - if strings.TrimSpace(sasToken) == "" { - return nil, fmt.Errorf("sasToken cannot be empty") - } - - token := sasToken - if strings.HasPrefix(sasToken, "?") { - token = strings.TrimPrefix(sasToken, "?") - } - - return &SASTokenAuthorizer{ - sasToken: token, - }, nil -} - -// WithAuthorization returns a PrepareDecorator that adds a shared access signature token to the -// URI's query parameters. This can be used for the Blob, Queue, and File Services. -// -// See https://docs.microsoft.com/en-us/rest/api/storageservices/delegate-access-with-shared-access-signature -func (sas *SASTokenAuthorizer) WithAuthorization() PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err != nil { - return r, err - } - - if r.URL.RawQuery == "" { - r.URL.RawQuery = sas.sasToken - } else if !strings.Contains(r.URL.RawQuery, sas.sasToken) { - r.URL.RawQuery = fmt.Sprintf("%s&%s", r.URL.RawQuery, sas.sasToken) - } - - return Prepare(r) - }) - } -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/authorization_storage.go b/vendor/github.com/Azure/go-autorest/autorest/authorization_storage.go deleted file mode 100644 index 2af5030a1c..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/authorization_storage.go +++ /dev/null @@ -1,307 +0,0 @@ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "crypto/hmac" - "crypto/sha256" - "encoding/base64" - "fmt" - "net/http" - "net/url" - "sort" - "strings" - "time" -) - -// SharedKeyType defines the enumeration for the various shared key types. -// See https://docs.microsoft.com/en-us/rest/api/storageservices/authorize-with-shared-key for details on the shared key types. -type SharedKeyType string - -const ( - // SharedKey is used to authorize against blobs, files and queues services. - SharedKey SharedKeyType = "sharedKey" - - // SharedKeyForTable is used to authorize against the table service. - SharedKeyForTable SharedKeyType = "sharedKeyTable" - - // SharedKeyLite is used to authorize against blobs, files and queues services. It's provided for - // backwards compatibility with API versions before 2009-09-19. Prefer SharedKey instead. - SharedKeyLite SharedKeyType = "sharedKeyLite" - - // SharedKeyLiteForTable is used to authorize against the table service. It's provided for - // backwards compatibility with older table API versions. Prefer SharedKeyForTable instead. - SharedKeyLiteForTable SharedKeyType = "sharedKeyLiteTable" -) - -const ( - headerAccept = "Accept" - headerAcceptCharset = "Accept-Charset" - headerContentEncoding = "Content-Encoding" - headerContentLength = "Content-Length" - headerContentMD5 = "Content-MD5" - headerContentLanguage = "Content-Language" - headerIfModifiedSince = "If-Modified-Since" - headerIfMatch = "If-Match" - headerIfNoneMatch = "If-None-Match" - headerIfUnmodifiedSince = "If-Unmodified-Since" - headerDate = "Date" - headerXMSDate = "X-Ms-Date" - headerXMSVersion = "x-ms-version" - headerRange = "Range" -) - -const storageEmulatorAccountName = "devstoreaccount1" - -// SharedKeyAuthorizer implements an authorization for Shared Key -// this can be used for interaction with Blob, File and Queue Storage Endpoints -type SharedKeyAuthorizer struct { - accountName string - accountKey []byte - keyType SharedKeyType -} - -// NewSharedKeyAuthorizer creates a SharedKeyAuthorizer using the provided credentials and shared key type. -func NewSharedKeyAuthorizer(accountName, accountKey string, keyType SharedKeyType) (*SharedKeyAuthorizer, error) { - key, err := base64.StdEncoding.DecodeString(accountKey) - if err != nil { - return nil, fmt.Errorf("malformed storage account key: %v", err) - } - return &SharedKeyAuthorizer{ - accountName: accountName, - accountKey: key, - keyType: keyType, - }, nil -} - -// WithAuthorization returns a PrepareDecorator that adds an HTTP Authorization header whose -// value is " " followed by the computed key. -// This can be used for the Blob, Queue, and File Services -// -// from: https://docs.microsoft.com/en-us/rest/api/storageservices/authorize-with-shared-key -// You may use Shared Key authorization to authorize a request made against the -// 2009-09-19 version and later of the Blob and Queue services, -// and version 2014-02-14 and later of the File services. -func (sk *SharedKeyAuthorizer) WithAuthorization() PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err != nil { - return r, err - } - - sk, err := buildSharedKey(sk.accountName, sk.accountKey, r, sk.keyType) - if err != nil { - return r, err - } - return Prepare(r, WithHeader(headerAuthorization, sk)) - }) - } -} - -func buildSharedKey(accName string, accKey []byte, req *http.Request, keyType SharedKeyType) (string, error) { - canRes, err := buildCanonicalizedResource(accName, req.URL.String(), keyType) - if err != nil { - return "", err - } - - if req.Header == nil { - req.Header = http.Header{} - } - - // ensure date is set - if req.Header.Get(headerDate) == "" && req.Header.Get(headerXMSDate) == "" { - date := time.Now().UTC().Format(http.TimeFormat) - req.Header.Set(headerXMSDate, date) - } - canString, err := buildCanonicalizedString(req.Method, req.Header, canRes, keyType) - if err != nil { - return "", err - } - return createAuthorizationHeader(accName, accKey, canString, keyType), nil -} - -func buildCanonicalizedResource(accountName, uri string, keyType SharedKeyType) (string, error) { - errMsg := "buildCanonicalizedResource error: %s" - u, err := url.Parse(uri) - if err != nil { - return "", fmt.Errorf(errMsg, err.Error()) - } - - cr := bytes.NewBufferString("") - if accountName != storageEmulatorAccountName { - cr.WriteString("/") - cr.WriteString(getCanonicalizedAccountName(accountName)) - } - - if len(u.Path) > 0 { - // Any portion of the CanonicalizedResource string that is derived from - // the resource's URI should be encoded exactly as it is in the URI. - // -- https://msdn.microsoft.com/en-gb/library/azure/dd179428.aspx - cr.WriteString(u.EscapedPath()) - } else { - // a slash is required to indicate the root path - cr.WriteString("/") - } - - params, err := url.ParseQuery(u.RawQuery) - if err != nil { - return "", fmt.Errorf(errMsg, err.Error()) - } - - // See https://github.com/Azure/azure-storage-net/blob/master/Lib/Common/Core/Util/AuthenticationUtility.cs#L277 - if keyType == SharedKey { - if len(params) > 0 { - cr.WriteString("\n") - - keys := []string{} - for key := range params { - keys = append(keys, key) - } - sort.Strings(keys) - - completeParams := []string{} - for _, key := range keys { - if len(params[key]) > 1 { - sort.Strings(params[key]) - } - - completeParams = append(completeParams, fmt.Sprintf("%s:%s", key, strings.Join(params[key], ","))) - } - cr.WriteString(strings.Join(completeParams, "\n")) - } - } else { - // search for "comp" parameter, if exists then add it to canonicalizedresource - if v, ok := params["comp"]; ok { - cr.WriteString("?comp=" + v[0]) - } - } - - return string(cr.Bytes()), nil -} - -func getCanonicalizedAccountName(accountName string) string { - // since we may be trying to access a secondary storage account, we need to - // remove the -secondary part of the storage name - return strings.TrimSuffix(accountName, "-secondary") -} - -func buildCanonicalizedString(verb string, headers http.Header, canonicalizedResource string, keyType SharedKeyType) (string, error) { - contentLength := headers.Get(headerContentLength) - if contentLength == "0" { - contentLength = "" - } - date := headers.Get(headerDate) - if v := headers.Get(headerXMSDate); v != "" { - if keyType == SharedKey || keyType == SharedKeyLite { - date = "" - } else { - date = v - } - } - var canString string - switch keyType { - case SharedKey: - canString = strings.Join([]string{ - verb, - headers.Get(headerContentEncoding), - headers.Get(headerContentLanguage), - contentLength, - headers.Get(headerContentMD5), - headers.Get(headerContentType), - date, - headers.Get(headerIfModifiedSince), - headers.Get(headerIfMatch), - headers.Get(headerIfNoneMatch), - headers.Get(headerIfUnmodifiedSince), - headers.Get(headerRange), - buildCanonicalizedHeader(headers), - canonicalizedResource, - }, "\n") - case SharedKeyForTable: - canString = strings.Join([]string{ - verb, - headers.Get(headerContentMD5), - headers.Get(headerContentType), - date, - canonicalizedResource, - }, "\n") - case SharedKeyLite: - canString = strings.Join([]string{ - verb, - headers.Get(headerContentMD5), - headers.Get(headerContentType), - date, - buildCanonicalizedHeader(headers), - canonicalizedResource, - }, "\n") - case SharedKeyLiteForTable: - canString = strings.Join([]string{ - date, - canonicalizedResource, - }, "\n") - default: - return "", fmt.Errorf("key type '%s' is not supported", keyType) - } - return canString, nil -} - -func buildCanonicalizedHeader(headers http.Header) string { - cm := make(map[string]string) - - for k := range headers { - headerName := strings.TrimSpace(strings.ToLower(k)) - if strings.HasPrefix(headerName, "x-ms-") { - cm[headerName] = headers.Get(k) - } - } - - if len(cm) == 0 { - return "" - } - - keys := []string{} - for key := range cm { - keys = append(keys, key) - } - - sort.Strings(keys) - - ch := bytes.NewBufferString("") - - for _, key := range keys { - ch.WriteString(key) - ch.WriteRune(':') - ch.WriteString(cm[key]) - ch.WriteRune('\n') - } - - return strings.TrimSuffix(string(ch.Bytes()), "\n") -} - -func createAuthorizationHeader(accountName string, accountKey []byte, canonicalizedString string, keyType SharedKeyType) string { - h := hmac.New(sha256.New, accountKey) - h.Write([]byte(canonicalizedString)) - signature := base64.StdEncoding.EncodeToString(h.Sum(nil)) - var key string - switch keyType { - case SharedKey, SharedKeyForTable: - key = "SharedKey" - case SharedKeyLite, SharedKeyLiteForTable: - key = "SharedKeyLite" - } - return fmt.Sprintf("%s %s:%s", key, getCanonicalizedAccountName(accountName), signature) -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/autorest.go b/vendor/github.com/Azure/go-autorest/autorest/autorest.go deleted file mode 100644 index aafdf021fd..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/autorest.go +++ /dev/null @@ -1,150 +0,0 @@ -/* -Package autorest implements an HTTP request pipeline suitable for use across multiple go-routines -and provides the shared routines relied on by AutoRest (see https://github.com/Azure/autorest/) -generated Go code. - -The package breaks sending and responding to HTTP requests into three phases: Preparing, Sending, -and Responding. A typical pattern is: - - req, err := Prepare(&http.Request{}, - token.WithAuthorization()) - - resp, err := Send(req, - WithLogging(logger), - DoErrorIfStatusCode(http.StatusInternalServerError), - DoCloseIfError(), - DoRetryForAttempts(5, time.Second)) - - err = Respond(resp, - ByDiscardingBody(), - ByClosing()) - -Each phase relies on decorators to modify and / or manage processing. Decorators may first modify -and then pass the data along, pass the data first and then modify the result, or wrap themselves -around passing the data (such as a logger might do). Decorators run in the order provided. For -example, the following: - - req, err := Prepare(&http.Request{}, - WithBaseURL("https://microsoft.com/"), - WithPath("a"), - WithPath("b"), - WithPath("c")) - -will set the URL to: - - https://microsoft.com/a/b/c - -Preparers and Responders may be shared and re-used (assuming the underlying decorators support -sharing and re-use). Performant use is obtained by creating one or more Preparers and Responders -shared among multiple go-routines, and a single Sender shared among multiple sending go-routines, -all bound together by means of input / output channels. - -Decorators hold their passed state within a closure (such as the path components in the example -above). Be careful to share Preparers and Responders only in a context where such held state -applies. For example, it may not make sense to share a Preparer that applies a query string from a -fixed set of values. Similarly, sharing a Responder that reads the response body into a passed -struct (e.g., ByUnmarshallingJson) is likely incorrect. - -Lastly, the Swagger specification (https://swagger.io) that drives AutoRest -(https://github.com/Azure/autorest/) precisely defines two date forms: date and date-time. The -github.com/Azure/go-autorest/autorest/date package provides time.Time derivations to ensure -correct parsing and formatting. - -Errors raised by autorest objects and methods will conform to the autorest.Error interface. - -See the included examples for more detail. For details on the suggested use of this package by -generated clients, see the Client described below. -*/ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "context" - "net/http" - "time" -) - -const ( - // HeaderLocation specifies the HTTP Location header. - HeaderLocation = "Location" - - // HeaderRetryAfter specifies the HTTP Retry-After header. - HeaderRetryAfter = "Retry-After" -) - -// ResponseHasStatusCode returns true if the status code in the HTTP Response is in the passed set -// and false otherwise. -func ResponseHasStatusCode(resp *http.Response, codes ...int) bool { - if resp == nil { - return false - } - return containsInt(codes, resp.StatusCode) -} - -// GetLocation retrieves the URL from the Location header of the passed response. -func GetLocation(resp *http.Response) string { - return resp.Header.Get(HeaderLocation) -} - -// GetRetryAfter extracts the retry delay from the Retry-After header of the passed response. If -// the header is absent or is malformed, it will return the supplied default delay time.Duration. -func GetRetryAfter(resp *http.Response, defaultDelay time.Duration) time.Duration { - retry := resp.Header.Get(HeaderRetryAfter) - if retry == "" { - return defaultDelay - } - - d, err := time.ParseDuration(retry + "s") - if err != nil { - return defaultDelay - } - - return d -} - -// NewPollingRequest allocates and returns a new http.Request to poll for the passed response. -func NewPollingRequest(resp *http.Response, cancel <-chan struct{}) (*http.Request, error) { - location := GetLocation(resp) - if location == "" { - return nil, NewErrorWithResponse("autorest", "NewPollingRequest", resp, "Location header missing from response that requires polling") - } - - req, err := Prepare(&http.Request{Cancel: cancel}, - AsGet(), - WithBaseURL(location)) - if err != nil { - return nil, NewErrorWithError(err, "autorest", "NewPollingRequest", nil, "Failure creating poll request to %s", location) - } - - return req, nil -} - -// NewPollingRequestWithContext allocates and returns a new http.Request with the specified context to poll for the passed response. -func NewPollingRequestWithContext(ctx context.Context, resp *http.Response) (*http.Request, error) { - location := GetLocation(resp) - if location == "" { - return nil, NewErrorWithResponse("autorest", "NewPollingRequestWithContext", resp, "Location header missing from response that requires polling") - } - - req, err := Prepare((&http.Request{}).WithContext(ctx), - AsGet(), - WithBaseURL(location)) - if err != nil { - return nil, NewErrorWithError(err, "autorest", "NewPollingRequestWithContext", nil, "Failure creating poll request to %s", location) - } - - return req, nil -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/async.go b/vendor/github.com/Azure/go-autorest/autorest/azure/async.go deleted file mode 100644 index 45575eedbf..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/async.go +++ /dev/null @@ -1,995 +0,0 @@ -package azure - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "net/url" - "strings" - "time" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/logger" - "github.com/Azure/go-autorest/tracing" -) - -const ( - headerAsyncOperation = "Azure-AsyncOperation" -) - -const ( - operationInProgress string = "InProgress" - operationCanceled string = "Canceled" - operationFailed string = "Failed" - operationSucceeded string = "Succeeded" -) - -var pollingCodes = [...]int{http.StatusNoContent, http.StatusAccepted, http.StatusCreated, http.StatusOK} - -// FutureAPI contains the set of methods on the Future type. -type FutureAPI interface { - // Response returns the last HTTP response. - Response() *http.Response - - // Status returns the last status message of the operation. - Status() string - - // PollingMethod returns the method used to monitor the status of the asynchronous operation. - PollingMethod() PollingMethodType - - // DoneWithContext queries the service to see if the operation has completed. - DoneWithContext(context.Context, autorest.Sender) (bool, error) - - // GetPollingDelay returns a duration the application should wait before checking - // the status of the asynchronous request and true; this value is returned from - // the service via the Retry-After response header. If the header wasn't returned - // then the function returns the zero-value time.Duration and false. - GetPollingDelay() (time.Duration, bool) - - // WaitForCompletionRef will return when one of the following conditions is met: the long - // running operation has completed, the provided context is cancelled, or the client's - // polling duration has been exceeded. It will retry failed polling attempts based on - // the retry value defined in the client up to the maximum retry attempts. - // If no deadline is specified in the context then the client.PollingDuration will be - // used to determine if a default deadline should be used. - // If PollingDuration is greater than zero the value will be used as the context's timeout. - // If PollingDuration is zero then no default deadline will be used. - WaitForCompletionRef(context.Context, autorest.Client) error - - // MarshalJSON implements the json.Marshaler interface. - MarshalJSON() ([]byte, error) - - // MarshalJSON implements the json.Unmarshaler interface. - UnmarshalJSON([]byte) error - - // PollingURL returns the URL used for retrieving the status of the long-running operation. - PollingURL() string - - // GetResult should be called once polling has completed successfully. - // It makes the final GET call to retrieve the resultant payload. - GetResult(autorest.Sender) (*http.Response, error) -} - -var _ FutureAPI = (*Future)(nil) - -// Future provides a mechanism to access the status and results of an asynchronous request. -// Since futures are stateful they should be passed by value to avoid race conditions. -type Future struct { - pt pollingTracker -} - -// NewFutureFromResponse returns a new Future object initialized -// with the initial response from an asynchronous operation. -func NewFutureFromResponse(resp *http.Response) (Future, error) { - pt, err := createPollingTracker(resp) - return Future{pt: pt}, err -} - -// Response returns the last HTTP response. -func (f Future) Response() *http.Response { - if f.pt == nil { - return nil - } - return f.pt.latestResponse() -} - -// Status returns the last status message of the operation. -func (f Future) Status() string { - if f.pt == nil { - return "" - } - return f.pt.pollingStatus() -} - -// PollingMethod returns the method used to monitor the status of the asynchronous operation. -func (f Future) PollingMethod() PollingMethodType { - if f.pt == nil { - return PollingUnknown - } - return f.pt.pollingMethod() -} - -// DoneWithContext queries the service to see if the operation has completed. -func (f *Future) DoneWithContext(ctx context.Context, sender autorest.Sender) (done bool, err error) { - ctx = tracing.StartSpan(ctx, "github.com/Azure/go-autorest/autorest/azure/async.DoneWithContext") - defer func() { - sc := -1 - resp := f.Response() - if resp != nil { - sc = resp.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - - if f.pt == nil { - return false, autorest.NewError("Future", "Done", "future is not initialized") - } - if f.pt.hasTerminated() { - return true, f.pt.pollingError() - } - if err := f.pt.pollForStatus(ctx, sender); err != nil { - return false, err - } - if err := f.pt.checkForErrors(); err != nil { - return f.pt.hasTerminated(), err - } - if err := f.pt.updatePollingState(f.pt.provisioningStateApplicable()); err != nil { - return false, err - } - if err := f.pt.initPollingMethod(); err != nil { - return false, err - } - if err := f.pt.updatePollingMethod(); err != nil { - return false, err - } - return f.pt.hasTerminated(), f.pt.pollingError() -} - -// GetPollingDelay returns a duration the application should wait before checking -// the status of the asynchronous request and true; this value is returned from -// the service via the Retry-After response header. If the header wasn't returned -// then the function returns the zero-value time.Duration and false. -func (f Future) GetPollingDelay() (time.Duration, bool) { - if f.pt == nil { - return 0, false - } - resp := f.pt.latestResponse() - if resp == nil { - return 0, false - } - - retry := resp.Header.Get(autorest.HeaderRetryAfter) - if retry == "" { - return 0, false - } - - d, err := time.ParseDuration(retry + "s") - if err != nil { - panic(err) - } - - return d, true -} - -// WaitForCompletionRef will return when one of the following conditions is met: the long -// running operation has completed, the provided context is cancelled, or the client's -// polling duration has been exceeded. It will retry failed polling attempts based on -// the retry value defined in the client up to the maximum retry attempts. -// If no deadline is specified in the context then the client.PollingDuration will be -// used to determine if a default deadline should be used. -// If PollingDuration is greater than zero the value will be used as the context's timeout. -// If PollingDuration is zero then no default deadline will be used. -func (f *Future) WaitForCompletionRef(ctx context.Context, client autorest.Client) (err error) { - ctx = tracing.StartSpan(ctx, "github.com/Azure/go-autorest/autorest/azure/async.WaitForCompletionRef") - defer func() { - sc := -1 - resp := f.Response() - if resp != nil { - sc = resp.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - cancelCtx := ctx - // if the provided context already has a deadline don't override it - _, hasDeadline := ctx.Deadline() - if d := client.PollingDuration; !hasDeadline && d != 0 { - var cancel context.CancelFunc - cancelCtx, cancel = context.WithTimeout(ctx, d) - defer cancel() - } - // if the initial response has a Retry-After, sleep for the specified amount of time before starting to poll - if delay, ok := f.GetPollingDelay(); ok { - logger.Instance.Writeln(logger.LogInfo, "WaitForCompletionRef: initial polling delay") - if delayElapsed := autorest.DelayForBackoff(delay, 0, cancelCtx.Done()); !delayElapsed { - err = cancelCtx.Err() - return - } - } - done, err := f.DoneWithContext(ctx, client) - for attempts := 0; !done; done, err = f.DoneWithContext(ctx, client) { - if attempts >= client.RetryAttempts { - return autorest.NewErrorWithError(err, "Future", "WaitForCompletion", f.pt.latestResponse(), "the number of retries has been exceeded") - } - // we want delayAttempt to be zero in the non-error case so - // that DelayForBackoff doesn't perform exponential back-off - var delayAttempt int - var delay time.Duration - if err == nil { - // check for Retry-After delay, if not present use the client's polling delay - var ok bool - delay, ok = f.GetPollingDelay() - if !ok { - logger.Instance.Writeln(logger.LogInfo, "WaitForCompletionRef: Using client polling delay") - delay = client.PollingDelay - } - } else { - // there was an error polling for status so perform exponential - // back-off based on the number of attempts using the client's retry - // duration. update attempts after delayAttempt to avoid off-by-one. - logger.Instance.Writef(logger.LogError, "WaitForCompletionRef: %s\n", err) - delayAttempt = attempts - delay = client.RetryDuration - attempts++ - } - // wait until the delay elapses or the context is cancelled - delayElapsed := autorest.DelayForBackoff(delay, delayAttempt, cancelCtx.Done()) - if !delayElapsed { - return autorest.NewErrorWithError(cancelCtx.Err(), "Future", "WaitForCompletion", f.pt.latestResponse(), "context has been cancelled") - } - } - return -} - -// MarshalJSON implements the json.Marshaler interface. -func (f Future) MarshalJSON() ([]byte, error) { - return json.Marshal(f.pt) -} - -// UnmarshalJSON implements the json.Unmarshaler interface. -func (f *Future) UnmarshalJSON(data []byte) error { - // unmarshal into JSON object to determine the tracker type - obj := map[string]interface{}{} - err := json.Unmarshal(data, &obj) - if err != nil { - return err - } - if obj["method"] == nil { - return autorest.NewError("Future", "UnmarshalJSON", "missing 'method' property") - } - method := obj["method"].(string) - switch strings.ToUpper(method) { - case http.MethodDelete: - f.pt = &pollingTrackerDelete{} - case http.MethodPatch: - f.pt = &pollingTrackerPatch{} - case http.MethodPost: - f.pt = &pollingTrackerPost{} - case http.MethodPut: - f.pt = &pollingTrackerPut{} - default: - return autorest.NewError("Future", "UnmarshalJSON", "unsupoorted method '%s'", method) - } - // now unmarshal into the tracker - return json.Unmarshal(data, &f.pt) -} - -// PollingURL returns the URL used for retrieving the status of the long-running operation. -func (f Future) PollingURL() string { - if f.pt == nil { - return "" - } - return f.pt.pollingURL() -} - -// GetResult should be called once polling has completed successfully. -// It makes the final GET call to retrieve the resultant payload. -func (f Future) GetResult(sender autorest.Sender) (*http.Response, error) { - if f.pt.finalGetURL() == "" { - // we can end up in this situation if the async operation returns a 200 - // with no polling URLs. in that case return the response which should - // contain the JSON payload (only do this for successful terminal cases). - if lr := f.pt.latestResponse(); lr != nil && f.pt.hasSucceeded() { - return lr, nil - } - return nil, autorest.NewError("Future", "GetResult", "missing URL for retrieving result") - } - req, err := http.NewRequest(http.MethodGet, f.pt.finalGetURL(), nil) - if err != nil { - return nil, err - } - resp, err := sender.Do(req) - if err == nil && resp.Body != nil { - // copy the body and close it so callers don't have to - defer resp.Body.Close() - b, err := ioutil.ReadAll(resp.Body) - if err != nil { - return resp, err - } - resp.Body = ioutil.NopCloser(bytes.NewReader(b)) - } - return resp, err -} - -type pollingTracker interface { - // these methods can differ per tracker - - // checks the response headers and status code to determine the polling mechanism - updatePollingMethod() error - - // checks the response for tracker-specific error conditions - checkForErrors() error - - // returns true if provisioning state should be checked - provisioningStateApplicable() bool - - // methods common to all trackers - - // initializes a tracker's polling URL and method, called for each iteration. - // these values can be overridden by each polling tracker as required. - initPollingMethod() error - - // initializes the tracker's internal state, call this when the tracker is created - initializeState() error - - // makes an HTTP request to check the status of the LRO - pollForStatus(ctx context.Context, sender autorest.Sender) error - - // updates internal tracker state, call this after each call to pollForStatus - updatePollingState(provStateApl bool) error - - // returns the error response from the service, can be nil - pollingError() error - - // returns the polling method being used - pollingMethod() PollingMethodType - - // returns the state of the LRO as returned from the service - pollingStatus() string - - // returns the URL used for polling status - pollingURL() string - - // returns the URL used for the final GET to retrieve the resource - finalGetURL() string - - // returns true if the LRO is in a terminal state - hasTerminated() bool - - // returns true if the LRO is in a failed terminal state - hasFailed() bool - - // returns true if the LRO is in a successful terminal state - hasSucceeded() bool - - // returns the cached HTTP response after a call to pollForStatus(), can be nil - latestResponse() *http.Response -} - -type pollingTrackerBase struct { - // resp is the last response, either from the submission of the LRO or from polling - resp *http.Response - - // method is the HTTP verb, this is needed for deserialization - Method string `json:"method"` - - // rawBody is the raw JSON response body - rawBody map[string]interface{} - - // denotes if polling is using async-operation or location header - Pm PollingMethodType `json:"pollingMethod"` - - // the URL to poll for status - URI string `json:"pollingURI"` - - // the state of the LRO as returned from the service - State string `json:"lroState"` - - // the URL to GET for the final result - FinalGetURI string `json:"resultURI"` - - // used to hold an error object returned from the service - Err *ServiceError `json:"error,omitempty"` -} - -func (pt *pollingTrackerBase) initializeState() error { - // determine the initial polling state based on response body and/or HTTP status - // code. this is applicable to the initial LRO response, not polling responses! - pt.Method = pt.resp.Request.Method - if err := pt.updateRawBody(); err != nil { - return err - } - switch pt.resp.StatusCode { - case http.StatusOK: - if ps := pt.getProvisioningState(); ps != nil { - pt.State = *ps - if pt.hasFailed() { - pt.updateErrorFromResponse() - return pt.pollingError() - } - } else { - pt.State = operationSucceeded - } - case http.StatusCreated: - if ps := pt.getProvisioningState(); ps != nil { - pt.State = *ps - } else { - pt.State = operationInProgress - } - case http.StatusAccepted: - pt.State = operationInProgress - case http.StatusNoContent: - pt.State = operationSucceeded - default: - pt.State = operationFailed - pt.updateErrorFromResponse() - return pt.pollingError() - } - return pt.initPollingMethod() -} - -func (pt pollingTrackerBase) getProvisioningState() *string { - if pt.rawBody != nil && pt.rawBody["properties"] != nil { - p := pt.rawBody["properties"].(map[string]interface{}) - if ps := p["provisioningState"]; ps != nil { - s := ps.(string) - return &s - } - } - return nil -} - -func (pt *pollingTrackerBase) updateRawBody() error { - pt.rawBody = map[string]interface{}{} - if pt.resp.ContentLength != 0 { - defer pt.resp.Body.Close() - b, err := ioutil.ReadAll(pt.resp.Body) - if err != nil { - return autorest.NewErrorWithError(err, "pollingTrackerBase", "updateRawBody", nil, "failed to read response body") - } - // put the body back so it's available to other callers - pt.resp.Body = ioutil.NopCloser(bytes.NewReader(b)) - // observed in 204 responses over HTTP/2.0; the content length is -1 but body is empty - if len(b) == 0 { - return nil - } - if err = json.Unmarshal(b, &pt.rawBody); err != nil { - return autorest.NewErrorWithError(err, "pollingTrackerBase", "updateRawBody", nil, "failed to unmarshal response body") - } - } - return nil -} - -func (pt *pollingTrackerBase) pollForStatus(ctx context.Context, sender autorest.Sender) error { - req, err := http.NewRequest(http.MethodGet, pt.URI, nil) - if err != nil { - return autorest.NewErrorWithError(err, "pollingTrackerBase", "pollForStatus", nil, "failed to create HTTP request") - } - - req = req.WithContext(ctx) - preparer := autorest.CreatePreparer(autorest.GetPrepareDecorators(ctx)...) - req, err = preparer.Prepare(req) - if err != nil { - return autorest.NewErrorWithError(err, "pollingTrackerBase", "pollForStatus", nil, "failed preparing HTTP request") - } - pt.resp, err = sender.Do(req) - if err != nil { - return autorest.NewErrorWithError(err, "pollingTrackerBase", "pollForStatus", nil, "failed to send HTTP request") - } - if autorest.ResponseHasStatusCode(pt.resp, pollingCodes[:]...) { - // reset the service error on success case - pt.Err = nil - err = pt.updateRawBody() - } else { - // check response body for error content - pt.updateErrorFromResponse() - err = pt.pollingError() - } - return err -} - -// attempts to unmarshal a ServiceError type from the response body. -// if that fails then make a best attempt at creating something meaningful. -// NOTE: this assumes that the async operation has failed. -func (pt *pollingTrackerBase) updateErrorFromResponse() { - var err error - if pt.resp.ContentLength != 0 { - type respErr struct { - ServiceError *ServiceError `json:"error"` - } - re := respErr{} - defer pt.resp.Body.Close() - var b []byte - if b, err = ioutil.ReadAll(pt.resp.Body); err != nil { - goto Default - } - // put the body back so it's available to other callers - pt.resp.Body = ioutil.NopCloser(bytes.NewReader(b)) - if len(b) == 0 { - goto Default - } - if err = json.Unmarshal(b, &re); err != nil { - goto Default - } - // unmarshalling the error didn't yield anything, try unwrapped error - if re.ServiceError == nil { - err = json.Unmarshal(b, &re.ServiceError) - if err != nil { - goto Default - } - } - // the unmarshaller will ensure re.ServiceError is non-nil - // even if there was no content unmarshalled so check the code. - if re.ServiceError.Code != "" { - pt.Err = re.ServiceError - return - } - } -Default: - se := &ServiceError{ - Code: pt.pollingStatus(), - Message: "The async operation failed.", - } - if err != nil { - se.InnerError = make(map[string]interface{}) - se.InnerError["unmarshalError"] = err.Error() - } - // stick the response body into the error object in hopes - // it contains something useful to help diagnose the failure. - if len(pt.rawBody) > 0 { - se.AdditionalInfo = []map[string]interface{}{ - pt.rawBody, - } - } - pt.Err = se -} - -func (pt *pollingTrackerBase) updatePollingState(provStateApl bool) error { - if pt.Pm == PollingAsyncOperation && pt.rawBody["status"] != nil { - pt.State = pt.rawBody["status"].(string) - } else { - if pt.resp.StatusCode == http.StatusAccepted { - pt.State = operationInProgress - } else if provStateApl { - if ps := pt.getProvisioningState(); ps != nil { - pt.State = *ps - } else { - pt.State = operationSucceeded - } - } else { - return autorest.NewError("pollingTrackerBase", "updatePollingState", "the response from the async operation has an invalid status code") - } - } - // if the operation has failed update the error state - if pt.hasFailed() { - pt.updateErrorFromResponse() - } - return nil -} - -func (pt pollingTrackerBase) pollingError() error { - if pt.Err == nil { - return nil - } - return pt.Err -} - -func (pt pollingTrackerBase) pollingMethod() PollingMethodType { - return pt.Pm -} - -func (pt pollingTrackerBase) pollingStatus() string { - return pt.State -} - -func (pt pollingTrackerBase) pollingURL() string { - return pt.URI -} - -func (pt pollingTrackerBase) finalGetURL() string { - return pt.FinalGetURI -} - -func (pt pollingTrackerBase) hasTerminated() bool { - return strings.EqualFold(pt.State, operationCanceled) || strings.EqualFold(pt.State, operationFailed) || strings.EqualFold(pt.State, operationSucceeded) -} - -func (pt pollingTrackerBase) hasFailed() bool { - return strings.EqualFold(pt.State, operationCanceled) || strings.EqualFold(pt.State, operationFailed) -} - -func (pt pollingTrackerBase) hasSucceeded() bool { - return strings.EqualFold(pt.State, operationSucceeded) -} - -func (pt pollingTrackerBase) latestResponse() *http.Response { - return pt.resp -} - -// error checking common to all trackers -func (pt pollingTrackerBase) baseCheckForErrors() error { - // for Azure-AsyncOperations the response body cannot be nil or empty - if pt.Pm == PollingAsyncOperation { - if pt.resp.Body == nil || pt.resp.ContentLength == 0 { - return autorest.NewError("pollingTrackerBase", "baseCheckForErrors", "for Azure-AsyncOperation response body cannot be nil") - } - if pt.rawBody["status"] == nil { - return autorest.NewError("pollingTrackerBase", "baseCheckForErrors", "missing status property in Azure-AsyncOperation response body") - } - } - return nil -} - -// default initialization of polling URL/method. each verb tracker will update this as required. -func (pt *pollingTrackerBase) initPollingMethod() error { - if ao, err := getURLFromAsyncOpHeader(pt.resp); err != nil { - return err - } else if ao != "" { - pt.URI = ao - pt.Pm = PollingAsyncOperation - return nil - } - if lh, err := getURLFromLocationHeader(pt.resp); err != nil { - return err - } else if lh != "" { - pt.URI = lh - pt.Pm = PollingLocation - return nil - } - // it's ok if we didn't find a polling header, this will be handled elsewhere - return nil -} - -// DELETE - -type pollingTrackerDelete struct { - pollingTrackerBase -} - -func (pt *pollingTrackerDelete) updatePollingMethod() error { - // for 201 the Location header is required - if pt.resp.StatusCode == http.StatusCreated { - if lh, err := getURLFromLocationHeader(pt.resp); err != nil { - return err - } else if lh == "" { - return autorest.NewError("pollingTrackerDelete", "updateHeaders", "missing Location header in 201 response") - } else { - pt.URI = lh - } - pt.Pm = PollingLocation - pt.FinalGetURI = pt.URI - } - // for 202 prefer the Azure-AsyncOperation header but fall back to Location if necessary - if pt.resp.StatusCode == http.StatusAccepted { - ao, err := getURLFromAsyncOpHeader(pt.resp) - if err != nil { - return err - } else if ao != "" { - pt.URI = ao - pt.Pm = PollingAsyncOperation - } - // if the Location header is invalid and we already have a polling URL - // then we don't care if the Location header URL is malformed. - if lh, err := getURLFromLocationHeader(pt.resp); err != nil && pt.URI == "" { - return err - } else if lh != "" { - if ao == "" { - pt.URI = lh - pt.Pm = PollingLocation - } - // when both headers are returned we use the value in the Location header for the final GET - pt.FinalGetURI = lh - } - // make sure a polling URL was found - if pt.URI == "" { - return autorest.NewError("pollingTrackerPost", "updateHeaders", "didn't get any suitable polling URLs in 202 response") - } - } - return nil -} - -func (pt pollingTrackerDelete) checkForErrors() error { - return pt.baseCheckForErrors() -} - -func (pt pollingTrackerDelete) provisioningStateApplicable() bool { - return pt.resp.StatusCode == http.StatusOK || pt.resp.StatusCode == http.StatusNoContent -} - -// PATCH - -type pollingTrackerPatch struct { - pollingTrackerBase -} - -func (pt *pollingTrackerPatch) updatePollingMethod() error { - // by default we can use the original URL for polling and final GET - if pt.URI == "" { - pt.URI = pt.resp.Request.URL.String() - } - if pt.FinalGetURI == "" { - pt.FinalGetURI = pt.resp.Request.URL.String() - } - if pt.Pm == PollingUnknown { - pt.Pm = PollingRequestURI - } - // for 201 it's permissible for no headers to be returned - if pt.resp.StatusCode == http.StatusCreated { - if ao, err := getURLFromAsyncOpHeader(pt.resp); err != nil { - return err - } else if ao != "" { - pt.URI = ao - pt.Pm = PollingAsyncOperation - } - } - // for 202 prefer the Azure-AsyncOperation header but fall back to Location if necessary - // note the absence of the "final GET" mechanism for PATCH - if pt.resp.StatusCode == http.StatusAccepted { - ao, err := getURLFromAsyncOpHeader(pt.resp) - if err != nil { - return err - } else if ao != "" { - pt.URI = ao - pt.Pm = PollingAsyncOperation - } - if ao == "" { - if lh, err := getURLFromLocationHeader(pt.resp); err != nil { - return err - } else if lh == "" { - return autorest.NewError("pollingTrackerPatch", "updateHeaders", "didn't get any suitable polling URLs in 202 response") - } else { - pt.URI = lh - pt.Pm = PollingLocation - } - } - } - return nil -} - -func (pt pollingTrackerPatch) checkForErrors() error { - return pt.baseCheckForErrors() -} - -func (pt pollingTrackerPatch) provisioningStateApplicable() bool { - return pt.resp.StatusCode == http.StatusOK || pt.resp.StatusCode == http.StatusCreated -} - -// POST - -type pollingTrackerPost struct { - pollingTrackerBase -} - -func (pt *pollingTrackerPost) updatePollingMethod() error { - // 201 requires Location header - if pt.resp.StatusCode == http.StatusCreated { - if lh, err := getURLFromLocationHeader(pt.resp); err != nil { - return err - } else if lh == "" { - return autorest.NewError("pollingTrackerPost", "updateHeaders", "missing Location header in 201 response") - } else { - pt.URI = lh - pt.FinalGetURI = lh - pt.Pm = PollingLocation - } - } - // for 202 prefer the Azure-AsyncOperation header but fall back to Location if necessary - if pt.resp.StatusCode == http.StatusAccepted { - ao, err := getURLFromAsyncOpHeader(pt.resp) - if err != nil { - return err - } else if ao != "" { - pt.URI = ao - pt.Pm = PollingAsyncOperation - } - // if the Location header is invalid and we already have a polling URL - // then we don't care if the Location header URL is malformed. - if lh, err := getURLFromLocationHeader(pt.resp); err != nil && pt.URI == "" { - return err - } else if lh != "" { - if ao == "" { - pt.URI = lh - pt.Pm = PollingLocation - } - // when both headers are returned we use the value in the Location header for the final GET - pt.FinalGetURI = lh - } - // make sure a polling URL was found - if pt.URI == "" { - return autorest.NewError("pollingTrackerPost", "updateHeaders", "didn't get any suitable polling URLs in 202 response") - } - } - return nil -} - -func (pt pollingTrackerPost) checkForErrors() error { - return pt.baseCheckForErrors() -} - -func (pt pollingTrackerPost) provisioningStateApplicable() bool { - return pt.resp.StatusCode == http.StatusOK || pt.resp.StatusCode == http.StatusNoContent -} - -// PUT - -type pollingTrackerPut struct { - pollingTrackerBase -} - -func (pt *pollingTrackerPut) updatePollingMethod() error { - // by default we can use the original URL for polling and final GET - if pt.URI == "" { - pt.URI = pt.resp.Request.URL.String() - } - if pt.FinalGetURI == "" { - pt.FinalGetURI = pt.resp.Request.URL.String() - } - if pt.Pm == PollingUnknown { - pt.Pm = PollingRequestURI - } - // for 201 it's permissible for no headers to be returned - if pt.resp.StatusCode == http.StatusCreated { - if ao, err := getURLFromAsyncOpHeader(pt.resp); err != nil { - return err - } else if ao != "" { - pt.URI = ao - pt.Pm = PollingAsyncOperation - } - } - // for 202 prefer the Azure-AsyncOperation header but fall back to Location if necessary - if pt.resp.StatusCode == http.StatusAccepted { - ao, err := getURLFromAsyncOpHeader(pt.resp) - if err != nil { - return err - } else if ao != "" { - pt.URI = ao - pt.Pm = PollingAsyncOperation - } - // if the Location header is invalid and we already have a polling URL - // then we don't care if the Location header URL is malformed. - if lh, err := getURLFromLocationHeader(pt.resp); err != nil && pt.URI == "" { - return err - } else if lh != "" { - if ao == "" { - pt.URI = lh - pt.Pm = PollingLocation - } - } - // make sure a polling URL was found - if pt.URI == "" { - return autorest.NewError("pollingTrackerPut", "updateHeaders", "didn't get any suitable polling URLs in 202 response") - } - } - return nil -} - -func (pt pollingTrackerPut) checkForErrors() error { - err := pt.baseCheckForErrors() - if err != nil { - return err - } - // if there are no LRO headers then the body cannot be empty - ao, err := getURLFromAsyncOpHeader(pt.resp) - if err != nil { - return err - } - lh, err := getURLFromLocationHeader(pt.resp) - if err != nil { - return err - } - if ao == "" && lh == "" && len(pt.rawBody) == 0 { - return autorest.NewError("pollingTrackerPut", "checkForErrors", "the response did not contain a body") - } - return nil -} - -func (pt pollingTrackerPut) provisioningStateApplicable() bool { - return pt.resp.StatusCode == http.StatusOK || pt.resp.StatusCode == http.StatusCreated -} - -// creates a polling tracker based on the verb of the original request -func createPollingTracker(resp *http.Response) (pollingTracker, error) { - var pt pollingTracker - switch strings.ToUpper(resp.Request.Method) { - case http.MethodDelete: - pt = &pollingTrackerDelete{pollingTrackerBase: pollingTrackerBase{resp: resp}} - case http.MethodPatch: - pt = &pollingTrackerPatch{pollingTrackerBase: pollingTrackerBase{resp: resp}} - case http.MethodPost: - pt = &pollingTrackerPost{pollingTrackerBase: pollingTrackerBase{resp: resp}} - case http.MethodPut: - pt = &pollingTrackerPut{pollingTrackerBase: pollingTrackerBase{resp: resp}} - default: - return nil, autorest.NewError("azure", "createPollingTracker", "unsupported HTTP method %s", resp.Request.Method) - } - if err := pt.initializeState(); err != nil { - return pt, err - } - // this initializes the polling header values, we do this during creation in case the - // initial response send us invalid values; this way the API call will return a non-nil - // error (not doing this means the error shows up in Future.Done) - return pt, pt.updatePollingMethod() -} - -// gets the polling URL from the Azure-AsyncOperation header. -// ensures the URL is well-formed and absolute. -func getURLFromAsyncOpHeader(resp *http.Response) (string, error) { - s := resp.Header.Get(http.CanonicalHeaderKey(headerAsyncOperation)) - if s == "" { - return "", nil - } - if !isValidURL(s) { - return "", autorest.NewError("azure", "getURLFromAsyncOpHeader", "invalid polling URL '%s'", s) - } - return s, nil -} - -// gets the polling URL from the Location header. -// ensures the URL is well-formed and absolute. -func getURLFromLocationHeader(resp *http.Response) (string, error) { - s := resp.Header.Get(http.CanonicalHeaderKey(autorest.HeaderLocation)) - if s == "" { - return "", nil - } - if !isValidURL(s) { - return "", autorest.NewError("azure", "getURLFromLocationHeader", "invalid polling URL '%s'", s) - } - return s, nil -} - -// verify that the URL is valid and absolute -func isValidURL(s string) bool { - u, err := url.Parse(s) - return err == nil && u.IsAbs() -} - -// PollingMethodType defines a type used for enumerating polling mechanisms. -type PollingMethodType string - -const ( - // PollingAsyncOperation indicates the polling method uses the Azure-AsyncOperation header. - PollingAsyncOperation PollingMethodType = "AsyncOperation" - - // PollingLocation indicates the polling method uses the Location header. - PollingLocation PollingMethodType = "Location" - - // PollingRequestURI indicates the polling method uses the original request URI. - PollingRequestURI PollingMethodType = "RequestURI" - - // PollingUnknown indicates an unknown polling method and is the default value. - PollingUnknown PollingMethodType = "" -) - -// AsyncOpIncompleteError is the type that's returned from a future that has not completed. -type AsyncOpIncompleteError struct { - // FutureType is the name of the type composed of a azure.Future. - FutureType string -} - -// Error returns an error message including the originating type name of the error. -func (e AsyncOpIncompleteError) Error() string { - return fmt.Sprintf("%s: asynchronous operation has not completed", e.FutureType) -} - -// NewAsyncOpIncompleteError creates a new AsyncOpIncompleteError with the specified parameters. -func NewAsyncOpIncompleteError(futureType string) AsyncOpIncompleteError { - return AsyncOpIncompleteError{ - FutureType: futureType, - } -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/auth/LICENSE b/vendor/github.com/Azure/go-autorest/autorest/azure/auth/LICENSE deleted file mode 100644 index b9d6a27ea9..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/auth/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2015 Microsoft Corporation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/auth/README.md b/vendor/github.com/Azure/go-autorest/autorest/azure/auth/README.md deleted file mode 100644 index 05bef8a800..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/auth/README.md +++ /dev/null @@ -1,152 +0,0 @@ -# NOTE: This module will go out of support by March 31, 2023. For authenticating with Azure AD, use module [azidentity](https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/sdk/azidentity) instead. For help migrating from `auth` to `azidentiy` please consult the [migration guide](https://aka.ms/azsdk/go/identity/migration). General information about the retirement of this and other legacy modules can be found [here](https://azure.microsoft.com/updates/support-for-azure-sdk-libraries-that-do-not-conform-to-our-current-azure-sdk-guidelines-will-be-retired-as-of-31-march-2023/). - -## Authentication - -Typical SDK operations must be authenticated and authorized. The `autorest.Authorizer` -interface allows use of any auth style in requests, such as inserting an OAuth2 -Authorization header and bearer token received from Azure AD. - -The SDK itself provides a simple way to get an authorizer which first checks -for OAuth client credentials in environment variables and then falls back to -Azure's [Managed Service Identity]() when available, e.g. when on an Azure -VM. The following snippet from [the previous section](#use) demonstrates -this helper. - -```go -import "github.com/Azure/go-autorest/autorest/azure/auth" - -// create a VirtualNetworks client -vnetClient := network.NewVirtualNetworksClient("") - -// create an authorizer from env vars or Azure Managed Service Idenity -authorizer, err := auth.NewAuthorizerFromEnvironment() -if err != nil { - handle(err) -} - -vnetClient.Authorizer = authorizer - -// call the VirtualNetworks CreateOrUpdate API -vnetClient.CreateOrUpdate(context.Background(), -// ... -``` - -The following environment variables help determine authentication configuration: - -- `AZURE_ENVIRONMENT`: Specifies the Azure Environment to use. If not set, it - defaults to `AzurePublicCloud`. Not applicable to authentication with Managed - Service Identity (MSI). -- `AZURE_AD_RESOURCE`: Specifies the AAD resource ID to use. If not set, it - defaults to `ResourceManagerEndpoint` for operations with Azure Resource - Manager. You can also choose an alternate resource programmatically with - `auth.NewAuthorizerFromEnvironmentWithResource(resource string)`. - -### More Authentication Details - -The previous is the first and most recommended of several authentication -options offered by the SDK because it allows seamless use of both service -principals and [Azure Managed Service Identity][]. Other options are listed -below. - -> Note: If you need to create a new service principal, run `az ad sp create-for-rbac -n ""` in the -> [azure-cli](https://github.com/Azure/azure-cli). See [these -> docs](https://docs.microsoft.com/cli/azure/create-an-azure-service-principal-azure-cli?view=azure-cli-latest) -> for more info. Copy the new principal's ID, secret, and tenant ID for use in -> your app, or consider the `--sdk-auth` parameter for serialized output. - -[azure managed service identity]: https://docs.microsoft.com/azure/active-directory/msi-overview - -- The `auth.NewAuthorizerFromEnvironment()` described above creates an authorizer - from the first available of the following configuration: - - 1. **Client Credentials**: Azure AD Application ID and Secret. - - - `AZURE_TENANT_ID`: Specifies the Tenant to which to authenticate. - - `AZURE_CLIENT_ID`: Specifies the app client ID to use. - - `AZURE_CLIENT_SECRET`: Specifies the app secret to use. - - 2. **Client Certificate**: Azure AD Application ID and X.509 Certificate. - - - `AZURE_TENANT_ID`: Specifies the Tenant to which to authenticate. - - `AZURE_CLIENT_ID`: Specifies the app client ID to use. - - `AZURE_CERTIFICATE_PATH`: Specifies the certificate Path to use. - - `AZURE_CERTIFICATE_PASSWORD`: Specifies the certificate password to use. - - 3. **Resource Owner Password**: Azure AD User and Password. This grant type is *not - recommended*, use device login instead if you need interactive login. - - - `AZURE_TENANT_ID`: Specifies the Tenant to which to authenticate. - - `AZURE_CLIENT_ID`: Specifies the app client ID to use. - - `AZURE_USERNAME`: Specifies the username to use. - - `AZURE_PASSWORD`: Specifies the password to use. - - 4. **Azure Managed Service Identity**: Delegate credential management to the - platform. Requires that code is running in Azure, e.g. on a VM. All - configuration is handled by Azure. See [Azure Managed Service - Identity](https://docs.microsoft.com/azure/active-directory/msi-overview) - for more details. - -- The `auth.NewAuthorizerFromFile()` method creates an authorizer using - credentials from an auth file created by the [Azure CLI][]. Follow these - steps to utilize: - - 1. Create a service principal and output an auth file using `az ad sp create-for-rbac --sdk-auth > client_credentials.json`. - 2. Set environment variable `AZURE_AUTH_LOCATION` to the path of the saved - output file. - 3. Use the authorizer returned by `auth.NewAuthorizerFromFile()` in your - client as described above. - -- The `auth.NewAuthorizerFromCLI()` method creates an authorizer which - uses [Azure CLI][] to obtain its credentials. - - The default audience being requested is `https://management.azure.com` (Azure ARM API). - To specify your own audience, export `AZURE_AD_RESOURCE` as an evironment variable. - This is read by `auth.NewAuthorizerFromCLI()` and passed to Azure CLI to acquire the access token. - - For example, to request an access token for Azure Key Vault, export - ``` - AZURE_AD_RESOURCE="https://vault.azure.net" - ``` - -- `auth.NewAuthorizerFromCLIWithResource(AUDIENCE_URL_OR_APPLICATION_ID)` - this method is self contained and does - not require exporting environment variables. For example, to request an access token for Azure Key Vault: - ``` - auth.NewAuthorizerFromCLIWithResource("https://vault.azure.net") - ``` - - To use `NewAuthorizerFromCLI()` or `NewAuthorizerFromCLIWithResource()`, follow these steps: - - 1. Install [Azure CLI v2.0.12](https://docs.microsoft.com/cli/azure/install-azure-cli) or later. Upgrade earlier versions. - 2. Use `az login` to sign in to Azure. - - If you receive an error, use `az account get-access-token` to verify access. - - If Azure CLI is not installed to the default directory, you may receive an error - reporting that `az` cannot be found. - Use the `AzureCLIPath` environment variable to define the Azure CLI installation folder. - - If you are signed in to Azure CLI using multiple accounts or your account has - access to multiple subscriptions, you need to specify the specific subscription - to be used. To do so, use: - - ``` - az account set --subscription - ``` - - To verify the current account settings, use: - - ``` - az account list - ``` - -[azure cli]: https://github.com/Azure/azure-cli - -- Finally, you can use OAuth's [Device Flow][] by calling - `auth.NewDeviceFlowConfig()` and extracting the Authorizer as follows: - - ```go - config := auth.NewDeviceFlowConfig(clientID, tenantID) - a, err := config.Authorizer() - ``` - -[device flow]: https://oauth.net/2/device-flow/ diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/auth/auth.go b/vendor/github.com/Azure/go-autorest/autorest/azure/auth/auth.go deleted file mode 100644 index e97589dcdc..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/auth/auth.go +++ /dev/null @@ -1,772 +0,0 @@ -package auth - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "context" - "encoding/binary" - "encoding/json" - "errors" - "fmt" - "io/ioutil" - "log" - "os" - "strings" - "unicode/utf16" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/adal" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/Azure/go-autorest/autorest/azure/cli" - "github.com/Azure/go-autorest/logger" - "github.com/dimchansky/utfbom" -) - -// The possible keys in the Values map. -const ( - SubscriptionID = "AZURE_SUBSCRIPTION_ID" - TenantID = "AZURE_TENANT_ID" - AuxiliaryTenantIDs = "AZURE_AUXILIARY_TENANT_IDS" - ClientID = "AZURE_CLIENT_ID" - ClientSecret = "AZURE_CLIENT_SECRET" - CertificatePath = "AZURE_CERTIFICATE_PATH" - CertificatePassword = "AZURE_CERTIFICATE_PASSWORD" - Username = "AZURE_USERNAME" - Password = "AZURE_PASSWORD" - EnvironmentName = "AZURE_ENVIRONMENT" - Resource = "AZURE_AD_RESOURCE" - ActiveDirectoryEndpoint = "ActiveDirectoryEndpoint" - ResourceManagerEndpoint = "ResourceManagerEndpoint" - GraphResourceID = "GraphResourceID" - SQLManagementEndpoint = "SQLManagementEndpoint" - GalleryEndpoint = "GalleryEndpoint" - ManagementEndpoint = "ManagementEndpoint" -) - -// NewAuthorizerFromEnvironment creates an Authorizer configured from environment variables in the order: -// 1. Client credentials -// 2. Client certificate -// 3. Username password -// 4. MSI -func NewAuthorizerFromEnvironment() (autorest.Authorizer, error) { - logger.Instance.Writeln(logger.LogInfo, "NewAuthorizerFromEnvironment() determining authentication mechanism") - settings, err := GetSettingsFromEnvironment() - if err != nil { - return nil, err - } - return settings.GetAuthorizer() -} - -// NewAuthorizerFromEnvironmentWithResource creates an Authorizer configured from environment variables in the order: -// 1. Client credentials -// 2. Client certificate -// 3. Username password -// 4. MSI -func NewAuthorizerFromEnvironmentWithResource(resource string) (autorest.Authorizer, error) { - logger.Instance.Writeln(logger.LogInfo, "NewAuthorizerFromEnvironmentWithResource() determining authentication mechanism") - settings, err := GetSettingsFromEnvironment() - if err != nil { - return nil, err - } - settings.Values[Resource] = resource - return settings.GetAuthorizer() -} - -// EnvironmentSettings contains the available authentication settings. -type EnvironmentSettings struct { - Values map[string]string - Environment azure.Environment -} - -// GetSettingsFromEnvironment returns the available authentication settings from the environment. -func GetSettingsFromEnvironment() (s EnvironmentSettings, err error) { - s = EnvironmentSettings{ - Values: map[string]string{}, - } - s.setValue(SubscriptionID) - s.setValue(TenantID) - s.setValue(AuxiliaryTenantIDs) - s.setValue(ClientID) - s.setValue(ClientSecret) - s.setValue(CertificatePath) - s.setValue(CertificatePassword) - s.setValue(Username) - s.setValue(Password) - s.setValue(EnvironmentName) - s.setValue(Resource) - if v := s.Values[EnvironmentName]; v == "" { - s.Environment = azure.PublicCloud - } else { - s.Environment, err = azure.EnvironmentFromName(v) - } - if s.Values[Resource] == "" { - s.Values[Resource] = s.Environment.ResourceManagerEndpoint - } - return -} - -// GetSubscriptionID returns the available subscription ID or an empty string. -func (settings EnvironmentSettings) GetSubscriptionID() string { - return settings.Values[SubscriptionID] -} - -// adds the specified environment variable value to the Values map if it exists -func (settings EnvironmentSettings) setValue(key string) { - if v := os.Getenv(key); v != "" { - logger.Instance.Writef(logger.LogInfo, "GetSettingsFromEnvironment() found environment var %s\n", key) - settings.Values[key] = v - } -} - -// helper to return client and tenant IDs -func (settings EnvironmentSettings) getClientAndTenant() (string, string) { - clientID := settings.Values[ClientID] - tenantID := settings.Values[TenantID] - return clientID, tenantID -} - -// GetClientCredentials creates a config object from the available client credentials. -// An error is returned if no client credentials are available. -func (settings EnvironmentSettings) GetClientCredentials() (ClientCredentialsConfig, error) { - secret := settings.Values[ClientSecret] - if secret == "" { - logger.Instance.Writeln(logger.LogInfo, "EnvironmentSettings.GetClientCredentials() missing client secret") - return ClientCredentialsConfig{}, errors.New("missing client secret") - } - clientID, tenantID := settings.getClientAndTenant() - config := NewClientCredentialsConfig(clientID, secret, tenantID) - config.AADEndpoint = settings.Environment.ActiveDirectoryEndpoint - config.Resource = settings.Values[Resource] - if auxTenants, ok := settings.Values[AuxiliaryTenantIDs]; ok { - config.AuxTenants = strings.Split(auxTenants, ";") - for i := range config.AuxTenants { - config.AuxTenants[i] = strings.TrimSpace(config.AuxTenants[i]) - } - } - return config, nil -} - -// GetClientCertificate creates a config object from the available certificate credentials. -// An error is returned if no certificate credentials are available. -func (settings EnvironmentSettings) GetClientCertificate() (ClientCertificateConfig, error) { - certPath := settings.Values[CertificatePath] - if certPath == "" { - logger.Instance.Writeln(logger.LogInfo, "EnvironmentSettings.GetClientCertificate() missing certificate path") - return ClientCertificateConfig{}, errors.New("missing certificate path") - } - certPwd := settings.Values[CertificatePassword] - clientID, tenantID := settings.getClientAndTenant() - config := NewClientCertificateConfig(certPath, certPwd, clientID, tenantID) - config.AADEndpoint = settings.Environment.ActiveDirectoryEndpoint - config.Resource = settings.Values[Resource] - return config, nil -} - -// GetUsernamePassword creates a config object from the available username/password credentials. -// An error is returned if no username/password credentials are available. -func (settings EnvironmentSettings) GetUsernamePassword() (UsernamePasswordConfig, error) { - username := settings.Values[Username] - password := settings.Values[Password] - if username == "" || password == "" { - logger.Instance.Writeln(logger.LogInfo, "EnvironmentSettings.GetUsernamePassword() missing username and/or password") - return UsernamePasswordConfig{}, errors.New("missing username/password") - } - clientID, tenantID := settings.getClientAndTenant() - config := NewUsernamePasswordConfig(username, password, clientID, tenantID) - config.AADEndpoint = settings.Environment.ActiveDirectoryEndpoint - config.Resource = settings.Values[Resource] - return config, nil -} - -// GetMSI creates a MSI config object from the available client ID. -func (settings EnvironmentSettings) GetMSI() MSIConfig { - config := NewMSIConfig() - config.Resource = settings.Values[Resource] - config.ClientID = settings.Values[ClientID] - return config -} - -// GetDeviceFlow creates a device-flow config object from the available client and tenant IDs. -func (settings EnvironmentSettings) GetDeviceFlow() DeviceFlowConfig { - clientID, tenantID := settings.getClientAndTenant() - config := NewDeviceFlowConfig(clientID, tenantID) - config.AADEndpoint = settings.Environment.ActiveDirectoryEndpoint - config.Resource = settings.Values[Resource] - return config -} - -// GetAuthorizer creates an Authorizer configured from environment variables in the order: -// 1. Client credentials -// 2. Client certificate -// 3. Username password -// 4. MSI -func (settings EnvironmentSettings) GetAuthorizer() (autorest.Authorizer, error) { - //1.Client Credentials - if c, e := settings.GetClientCredentials(); e == nil { - logger.Instance.Writeln(logger.LogInfo, "EnvironmentSettings.GetAuthorizer() using client secret credentials") - return c.Authorizer() - } - - //2. Client Certificate - if c, e := settings.GetClientCertificate(); e == nil { - logger.Instance.Writeln(logger.LogInfo, "EnvironmentSettings.GetAuthorizer() using client certificate credentials") - return c.Authorizer() - } - - //3. Username Password - if c, e := settings.GetUsernamePassword(); e == nil { - logger.Instance.Writeln(logger.LogInfo, "EnvironmentSettings.GetAuthorizer() using user name/password credentials") - return c.Authorizer() - } - - // 4. MSI - if !adal.MSIAvailable(context.Background(), nil) { - return nil, errors.New("MSI not available") - } - logger.Instance.Writeln(logger.LogInfo, "EnvironmentSettings.GetAuthorizer() using MSI authentication") - return settings.GetMSI().Authorizer() -} - -// NewAuthorizerFromFile creates an Authorizer configured from a configuration file in the following order. -// 1. Client credentials -// 2. Client certificate -// The path to the configuration file must be specified in the AZURE_AUTH_LOCATION environment variable. -// resourceBaseURI - used to determine the resource type -func NewAuthorizerFromFile(resourceBaseURI string) (autorest.Authorizer, error) { - settings, err := GetSettingsFromFile() - if err != nil { - return nil, err - } - return settings.GetAuthorizer(resourceBaseURI) -} - -// GetAuthorizer create an Authorizer in the following order. -// 1. Client credentials -// 2. Client certificate -// resourceBaseURI - used to determine the resource type -func (settings FileSettings) GetAuthorizer(resourceBaseURI string) (autorest.Authorizer, error) { - if resourceBaseURI == "" { - resourceBaseURI = azure.PublicCloud.ServiceManagementEndpoint - } - if a, err := settings.ClientCredentialsAuthorizer(resourceBaseURI); err == nil { - return a, err - } - if a, err := settings.ClientCertificateAuthorizer(resourceBaseURI); err == nil { - return a, err - } - return nil, errors.New("auth file missing client and certificate credentials") -} - -// NewAuthorizerFromFileWithResource creates an Authorizer configured from a configuration file in the following order. -// 1. Client credentials -// 2. Client certificate -// The path to the configuration file must be specified in the AZURE_AUTH_LOCATION environment variable. -func NewAuthorizerFromFileWithResource(resource string) (autorest.Authorizer, error) { - s, err := GetSettingsFromFile() - if err != nil { - return nil, err - } - if a, err := s.ClientCredentialsAuthorizerWithResource(resource); err == nil { - return a, err - } - if a, err := s.ClientCertificateAuthorizerWithResource(resource); err == nil { - return a, err - } - return nil, errors.New("auth file missing client and certificate credentials") -} - -// NewAuthorizerFromCLI creates an Authorizer configured from Azure CLI 2.0 for local development scenarios. -func NewAuthorizerFromCLI() (autorest.Authorizer, error) { - settings, err := GetSettingsFromEnvironment() - if err != nil { - return nil, err - } - - if settings.Values[Resource] == "" { - settings.Values[Resource] = settings.Environment.ResourceManagerEndpoint - } - - return NewAuthorizerFromCLIWithResource(settings.Values[Resource]) -} - -// NewAuthorizerFromCLIWithResource creates an Authorizer configured from Azure CLI 2.0 for local development scenarios. -func NewAuthorizerFromCLIWithResource(resource string) (autorest.Authorizer, error) { - token, err := cli.GetTokenFromCLI(resource) - if err != nil { - return nil, err - } - - adalToken, err := token.ToADALToken() - if err != nil { - return nil, err - } - - return autorest.NewBearerAuthorizer(&adalToken), nil -} - -// GetSettingsFromFile returns the available authentication settings from an Azure CLI authentication file. -func GetSettingsFromFile() (FileSettings, error) { - s := FileSettings{} - fileLocation := os.Getenv("AZURE_AUTH_LOCATION") - if fileLocation == "" { - return s, errors.New("environment variable AZURE_AUTH_LOCATION is not set") - } - - contents, err := ioutil.ReadFile(fileLocation) - if err != nil { - return s, err - } - - // Auth file might be encoded - decoded, err := decode(contents) - if err != nil { - return s, err - } - - authFile := map[string]interface{}{} - err = json.Unmarshal(decoded, &authFile) - if err != nil { - return s, err - } - - s.Values = map[string]string{} - s.setKeyValue(ClientID, authFile["clientId"]) - s.setKeyValue(ClientSecret, authFile["clientSecret"]) - s.setKeyValue(CertificatePath, authFile["clientCertificate"]) - s.setKeyValue(CertificatePassword, authFile["clientCertificatePassword"]) - s.setKeyValue(SubscriptionID, authFile["subscriptionId"]) - s.setKeyValue(TenantID, authFile["tenantId"]) - s.setKeyValue(ActiveDirectoryEndpoint, authFile["activeDirectoryEndpointUrl"]) - s.setKeyValue(ResourceManagerEndpoint, authFile["resourceManagerEndpointUrl"]) - s.setKeyValue(GraphResourceID, authFile["activeDirectoryGraphResourceId"]) - s.setKeyValue(SQLManagementEndpoint, authFile["sqlManagementEndpointUrl"]) - s.setKeyValue(GalleryEndpoint, authFile["galleryEndpointUrl"]) - s.setKeyValue(ManagementEndpoint, authFile["managementEndpointUrl"]) - return s, nil -} - -// FileSettings contains the available authentication settings. -type FileSettings struct { - Values map[string]string -} - -// GetSubscriptionID returns the available subscription ID or an empty string. -func (settings FileSettings) GetSubscriptionID() string { - return settings.Values[SubscriptionID] -} - -// adds the specified value to the Values map if it isn't nil -func (settings FileSettings) setKeyValue(key string, val interface{}) { - if val != nil { - settings.Values[key] = val.(string) - } -} - -// returns the specified AAD endpoint or the public cloud endpoint if unspecified -func (settings FileSettings) getAADEndpoint() string { - if v, ok := settings.Values[ActiveDirectoryEndpoint]; ok { - return v - } - return azure.PublicCloud.ActiveDirectoryEndpoint -} - -// ServicePrincipalTokenFromClientCredentials creates a ServicePrincipalToken from the available client credentials. -func (settings FileSettings) ServicePrincipalTokenFromClientCredentials(baseURI string) (*adal.ServicePrincipalToken, error) { - resource, err := settings.getResourceForToken(baseURI) - if err != nil { - return nil, err - } - return settings.ServicePrincipalTokenFromClientCredentialsWithResource(resource) -} - -// ClientCredentialsAuthorizer creates an authorizer from the available client credentials. -func (settings FileSettings) ClientCredentialsAuthorizer(baseURI string) (autorest.Authorizer, error) { - resource, err := settings.getResourceForToken(baseURI) - if err != nil { - return nil, err - } - return settings.ClientCredentialsAuthorizerWithResource(resource) -} - -// ServicePrincipalTokenFromClientCredentialsWithResource creates a ServicePrincipalToken -// from the available client credentials and the specified resource. -func (settings FileSettings) ServicePrincipalTokenFromClientCredentialsWithResource(resource string) (*adal.ServicePrincipalToken, error) { - if _, ok := settings.Values[ClientSecret]; !ok { - return nil, errors.New("missing client secret") - } - config, err := adal.NewOAuthConfig(settings.getAADEndpoint(), settings.Values[TenantID]) - if err != nil { - return nil, err - } - return adal.NewServicePrincipalToken(*config, settings.Values[ClientID], settings.Values[ClientSecret], resource) -} - -func (settings FileSettings) clientCertificateConfigWithResource(resource string) (ClientCertificateConfig, error) { - if _, ok := settings.Values[CertificatePath]; !ok { - return ClientCertificateConfig{}, errors.New("missing certificate path") - } - cfg := NewClientCertificateConfig(settings.Values[CertificatePath], settings.Values[CertificatePassword], settings.Values[ClientID], settings.Values[TenantID]) - cfg.AADEndpoint = settings.getAADEndpoint() - cfg.Resource = resource - return cfg, nil -} - -// ClientCredentialsAuthorizerWithResource creates an authorizer from the available client credentials and the specified resource. -func (settings FileSettings) ClientCredentialsAuthorizerWithResource(resource string) (autorest.Authorizer, error) { - spToken, err := settings.ServicePrincipalTokenFromClientCredentialsWithResource(resource) - if err != nil { - return nil, err - } - return autorest.NewBearerAuthorizer(spToken), nil -} - -// ServicePrincipalTokenFromClientCertificate creates a ServicePrincipalToken from the available certificate credentials. -func (settings FileSettings) ServicePrincipalTokenFromClientCertificate(baseURI string) (*adal.ServicePrincipalToken, error) { - resource, err := settings.getResourceForToken(baseURI) - if err != nil { - return nil, err - } - return settings.ServicePrincipalTokenFromClientCertificateWithResource(resource) -} - -// ClientCertificateAuthorizer creates an authorizer from the available certificate credentials. -func (settings FileSettings) ClientCertificateAuthorizer(baseURI string) (autorest.Authorizer, error) { - resource, err := settings.getResourceForToken(baseURI) - if err != nil { - return nil, err - } - return settings.ClientCertificateAuthorizerWithResource(resource) -} - -// ServicePrincipalTokenFromClientCertificateWithResource creates a ServicePrincipalToken from the available certificate credentials. -func (settings FileSettings) ServicePrincipalTokenFromClientCertificateWithResource(resource string) (*adal.ServicePrincipalToken, error) { - cfg, err := settings.clientCertificateConfigWithResource(resource) - if err != nil { - return nil, err - } - return cfg.ServicePrincipalToken() -} - -// ClientCertificateAuthorizerWithResource creates an authorizer from the available certificate credentials and the specified resource. -func (settings FileSettings) ClientCertificateAuthorizerWithResource(resource string) (autorest.Authorizer, error) { - cfg, err := settings.clientCertificateConfigWithResource(resource) - if err != nil { - return nil, err - } - return cfg.Authorizer() -} - -func decode(b []byte) ([]byte, error) { - reader, enc := utfbom.Skip(bytes.NewReader(b)) - - switch enc { - case utfbom.UTF16LittleEndian: - u16 := make([]uint16, (len(b)/2)-1) - err := binary.Read(reader, binary.LittleEndian, &u16) - if err != nil { - return nil, err - } - return []byte(string(utf16.Decode(u16))), nil - case utfbom.UTF16BigEndian: - u16 := make([]uint16, (len(b)/2)-1) - err := binary.Read(reader, binary.BigEndian, &u16) - if err != nil { - return nil, err - } - return []byte(string(utf16.Decode(u16))), nil - } - return ioutil.ReadAll(reader) -} - -func (settings FileSettings) getResourceForToken(baseURI string) (string, error) { - // Compare default base URI from the SDK to the endpoints from the public cloud - // Base URI and token resource are the same string. This func finds the authentication - // file field that matches the SDK base URI. The SDK defines the public cloud - // endpoint as its default base URI - if !strings.HasSuffix(baseURI, "/") { - baseURI += "/" - } - switch baseURI { - case azure.PublicCloud.ServiceManagementEndpoint: - return settings.Values[ManagementEndpoint], nil - case azure.PublicCloud.ResourceManagerEndpoint: - return settings.Values[ResourceManagerEndpoint], nil - case azure.PublicCloud.ActiveDirectoryEndpoint: - return settings.Values[ActiveDirectoryEndpoint], nil - case azure.PublicCloud.GalleryEndpoint: - return settings.Values[GalleryEndpoint], nil - case azure.PublicCloud.GraphEndpoint: - return settings.Values[GraphResourceID], nil - } - return "", fmt.Errorf("auth: base URI not found in endpoints") -} - -// NewClientCredentialsConfig creates an AuthorizerConfig object configured to obtain an Authorizer through Client Credentials. -// Defaults to Public Cloud and Resource Manager Endpoint. -func NewClientCredentialsConfig(clientID string, clientSecret string, tenantID string) ClientCredentialsConfig { - return ClientCredentialsConfig{ - ClientID: clientID, - ClientSecret: clientSecret, - TenantID: tenantID, - Resource: azure.PublicCloud.ResourceManagerEndpoint, - AADEndpoint: azure.PublicCloud.ActiveDirectoryEndpoint, - } -} - -// NewClientCertificateConfig creates a ClientCertificateConfig object configured to obtain an Authorizer through client certificate. -// Defaults to Public Cloud and Resource Manager Endpoint. -func NewClientCertificateConfig(certificatePath string, certificatePassword string, clientID string, tenantID string) ClientCertificateConfig { - return ClientCertificateConfig{ - CertificatePath: certificatePath, - CertificatePassword: certificatePassword, - ClientID: clientID, - TenantID: tenantID, - Resource: azure.PublicCloud.ResourceManagerEndpoint, - AADEndpoint: azure.PublicCloud.ActiveDirectoryEndpoint, - } -} - -// NewUsernamePasswordConfig creates an UsernamePasswordConfig object configured to obtain an Authorizer through username and password. -// Defaults to Public Cloud and Resource Manager Endpoint. -func NewUsernamePasswordConfig(username string, password string, clientID string, tenantID string) UsernamePasswordConfig { - return UsernamePasswordConfig{ - Username: username, - Password: password, - ClientID: clientID, - TenantID: tenantID, - Resource: azure.PublicCloud.ResourceManagerEndpoint, - AADEndpoint: azure.PublicCloud.ActiveDirectoryEndpoint, - } -} - -// NewMSIConfig creates an MSIConfig object configured to obtain an Authorizer through MSI. -func NewMSIConfig() MSIConfig { - return MSIConfig{ - Resource: azure.PublicCloud.ResourceManagerEndpoint, - } -} - -// NewDeviceFlowConfig creates a DeviceFlowConfig object configured to obtain an Authorizer through device flow. -// Defaults to Public Cloud and Resource Manager Endpoint. -func NewDeviceFlowConfig(clientID string, tenantID string) DeviceFlowConfig { - return DeviceFlowConfig{ - ClientID: clientID, - TenantID: tenantID, - Resource: azure.PublicCloud.ResourceManagerEndpoint, - AADEndpoint: azure.PublicCloud.ActiveDirectoryEndpoint, - } -} - -// AuthorizerConfig provides an authorizer from the configuration provided. -type AuthorizerConfig interface { - Authorizer() (autorest.Authorizer, error) -} - -// ClientCredentialsConfig provides the options to get a bearer authorizer from client credentials. -type ClientCredentialsConfig struct { - ClientID string - ClientSecret string - TenantID string - AuxTenants []string - AADEndpoint string - Resource string -} - -// ServicePrincipalToken creates a ServicePrincipalToken from client credentials. -func (ccc ClientCredentialsConfig) ServicePrincipalToken() (*adal.ServicePrincipalToken, error) { - oauthConfig, err := adal.NewOAuthConfig(ccc.AADEndpoint, ccc.TenantID) - if err != nil { - return nil, err - } - return adal.NewServicePrincipalToken(*oauthConfig, ccc.ClientID, ccc.ClientSecret, ccc.Resource) -} - -// MultiTenantServicePrincipalToken creates a MultiTenantServicePrincipalToken from client credentials. -func (ccc ClientCredentialsConfig) MultiTenantServicePrincipalToken() (*adal.MultiTenantServicePrincipalToken, error) { - oauthConfig, err := adal.NewMultiTenantOAuthConfig(ccc.AADEndpoint, ccc.TenantID, ccc.AuxTenants, adal.OAuthOptions{}) - if err != nil { - return nil, err - } - return adal.NewMultiTenantServicePrincipalToken(oauthConfig, ccc.ClientID, ccc.ClientSecret, ccc.Resource) -} - -// Authorizer gets the authorizer from client credentials. -func (ccc ClientCredentialsConfig) Authorizer() (autorest.Authorizer, error) { - if len(ccc.AuxTenants) == 0 { - spToken, err := ccc.ServicePrincipalToken() - if err != nil { - return nil, fmt.Errorf("failed to get SPT from client credentials: %v", err) - } - return autorest.NewBearerAuthorizer(spToken), nil - } - mtSPT, err := ccc.MultiTenantServicePrincipalToken() - if err != nil { - return nil, fmt.Errorf("failed to get multitenant SPT from client credentials: %v", err) - } - return autorest.NewMultiTenantServicePrincipalTokenAuthorizer(mtSPT), nil -} - -// ClientCertificateConfig provides the options to get a bearer authorizer from a client certificate. -type ClientCertificateConfig struct { - ClientID string - CertificatePath string - CertificatePassword string - TenantID string - AuxTenants []string - AADEndpoint string - Resource string -} - -// ServicePrincipalToken creates a ServicePrincipalToken from client certificate. -func (ccc ClientCertificateConfig) ServicePrincipalToken() (*adal.ServicePrincipalToken, error) { - oauthConfig, err := adal.NewOAuthConfig(ccc.AADEndpoint, ccc.TenantID) - if err != nil { - return nil, err - } - certData, err := ioutil.ReadFile(ccc.CertificatePath) - if err != nil { - return nil, fmt.Errorf("failed to read the certificate file (%s): %v", ccc.CertificatePath, err) - } - certificate, rsaPrivateKey, err := adal.DecodePfxCertificateData(certData, ccc.CertificatePassword) - if err != nil { - return nil, fmt.Errorf("failed to decode pkcs12 certificate while creating spt: %v", err) - } - return adal.NewServicePrincipalTokenFromCertificate(*oauthConfig, ccc.ClientID, certificate, rsaPrivateKey, ccc.Resource) -} - -// MultiTenantServicePrincipalToken creates a MultiTenantServicePrincipalToken from client certificate. -func (ccc ClientCertificateConfig) MultiTenantServicePrincipalToken() (*adal.MultiTenantServicePrincipalToken, error) { - oauthConfig, err := adal.NewMultiTenantOAuthConfig(ccc.AADEndpoint, ccc.TenantID, ccc.AuxTenants, adal.OAuthOptions{}) - if err != nil { - return nil, err - } - certData, err := ioutil.ReadFile(ccc.CertificatePath) - if err != nil { - return nil, fmt.Errorf("failed to read the certificate file (%s): %v", ccc.CertificatePath, err) - } - certificate, rsaPrivateKey, err := adal.DecodePfxCertificateData(certData, ccc.CertificatePassword) - if err != nil { - return nil, fmt.Errorf("failed to decode pkcs12 certificate while creating spt: %v", err) - } - return adal.NewMultiTenantServicePrincipalTokenFromCertificate(oauthConfig, ccc.ClientID, certificate, rsaPrivateKey, ccc.Resource) -} - -// Authorizer gets an authorizer object from client certificate. -func (ccc ClientCertificateConfig) Authorizer() (autorest.Authorizer, error) { - if len(ccc.AuxTenants) == 0 { - spToken, err := ccc.ServicePrincipalToken() - if err != nil { - return nil, fmt.Errorf("failed to get oauth token from certificate auth: %v", err) - } - return autorest.NewBearerAuthorizer(spToken), nil - } - mtSPT, err := ccc.MultiTenantServicePrincipalToken() - if err != nil { - return nil, fmt.Errorf("failed to get multitenant SPT from certificate auth: %v", err) - } - return autorest.NewMultiTenantServicePrincipalTokenAuthorizer(mtSPT), nil -} - -// DeviceFlowConfig provides the options to get a bearer authorizer using device flow authentication. -type DeviceFlowConfig struct { - ClientID string - TenantID string - AADEndpoint string - Resource string -} - -// Authorizer gets the authorizer from device flow. -func (dfc DeviceFlowConfig) Authorizer() (autorest.Authorizer, error) { - spToken, err := dfc.ServicePrincipalToken() - if err != nil { - return nil, fmt.Errorf("failed to get oauth token from device flow: %v", err) - } - return autorest.NewBearerAuthorizer(spToken), nil -} - -// ServicePrincipalToken gets the service principal token from device flow. -func (dfc DeviceFlowConfig) ServicePrincipalToken() (*adal.ServicePrincipalToken, error) { - oauthConfig, err := adal.NewOAuthConfig(dfc.AADEndpoint, dfc.TenantID) - if err != nil { - return nil, err - } - oauthClient := &autorest.Client{} - deviceCode, err := adal.InitiateDeviceAuth(oauthClient, *oauthConfig, dfc.ClientID, dfc.Resource) - if err != nil { - return nil, fmt.Errorf("failed to start device auth flow: %s", err) - } - log.Println(*deviceCode.Message) - token, err := adal.WaitForUserCompletion(oauthClient, deviceCode) - if err != nil { - return nil, fmt.Errorf("failed to finish device auth flow: %s", err) - } - return adal.NewServicePrincipalTokenFromManualToken(*oauthConfig, dfc.ClientID, dfc.Resource, *token) -} - -// UsernamePasswordConfig provides the options to get a bearer authorizer from a username and a password. -type UsernamePasswordConfig struct { - ClientID string - Username string - Password string - TenantID string - AADEndpoint string - Resource string -} - -// ServicePrincipalToken creates a ServicePrincipalToken from username and password. -func (ups UsernamePasswordConfig) ServicePrincipalToken() (*adal.ServicePrincipalToken, error) { - oauthConfig, err := adal.NewOAuthConfig(ups.AADEndpoint, ups.TenantID) - if err != nil { - return nil, err - } - return adal.NewServicePrincipalTokenFromUsernamePassword(*oauthConfig, ups.ClientID, ups.Username, ups.Password, ups.Resource) -} - -// Authorizer gets the authorizer from a username and a password. -func (ups UsernamePasswordConfig) Authorizer() (autorest.Authorizer, error) { - spToken, err := ups.ServicePrincipalToken() - if err != nil { - return nil, fmt.Errorf("failed to get oauth token from username and password auth: %v", err) - } - return autorest.NewBearerAuthorizer(spToken), nil -} - -// MSIConfig provides the options to get a bearer authorizer through MSI. -type MSIConfig struct { - Resource string - ClientID string -} - -// ServicePrincipalToken creates a ServicePrincipalToken from MSI. -func (mc MSIConfig) ServicePrincipalToken() (*adal.ServicePrincipalToken, error) { - spToken, err := adal.NewServicePrincipalTokenFromManagedIdentity(mc.Resource, &adal.ManagedIdentityOptions{ - ClientID: mc.ClientID, - }) - if err != nil { - return nil, fmt.Errorf("failed to get oauth token from MSI: %v", err) - } - return spToken, nil -} - -// Authorizer gets the authorizer from MSI. -func (mc MSIConfig) Authorizer() (autorest.Authorizer, error) { - spToken, err := mc.ServicePrincipalToken() - if err != nil { - return nil, err - } - - return autorest.NewBearerAuthorizer(spToken), nil -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/auth/go_mod_tidy_hack.go b/vendor/github.com/Azure/go-autorest/autorest/azure/auth/go_mod_tidy_hack.go deleted file mode 100644 index f7eb26fd36..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/auth/go_mod_tidy_hack.go +++ /dev/null @@ -1,25 +0,0 @@ -//go:build modhack -// +build modhack - -package auth - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file, and the github.com/Azure/go-autorest import, won't actually become part of -// the resultant binary. - -// Necessary for safely adding multi-module repo. -// See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository -import _ "github.com/Azure/go-autorest" diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go b/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go deleted file mode 100644 index 1328f1764c..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/azure.go +++ /dev/null @@ -1,388 +0,0 @@ -// Package azure provides Azure-specific implementations used with AutoRest. -// See the included examples for more detail. -package azure - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "regexp" - "strconv" - "strings" - - "github.com/Azure/go-autorest/autorest" -) - -const ( - // HeaderClientID is the Azure extension header to set a user-specified request ID. - HeaderClientID = "x-ms-client-request-id" - - // HeaderReturnClientID is the Azure extension header to set if the user-specified request ID - // should be included in the response. - HeaderReturnClientID = "x-ms-return-client-request-id" - - // HeaderContentType is the type of the content in the HTTP response. - HeaderContentType = "Content-Type" - - // HeaderRequestID is the Azure extension header of the service generated request ID returned - // in the response. - HeaderRequestID = "x-ms-request-id" -) - -// ServiceError encapsulates the error response from an Azure service. -// It adhears to the OData v4 specification for error responses. -type ServiceError struct { - Code string `json:"code"` - Message string `json:"message"` - Target *string `json:"target"` - Details []map[string]interface{} `json:"details"` - InnerError map[string]interface{} `json:"innererror"` - AdditionalInfo []map[string]interface{} `json:"additionalInfo"` -} - -func (se ServiceError) Error() string { - result := fmt.Sprintf("Code=%q Message=%q", se.Code, se.Message) - - if se.Target != nil { - result += fmt.Sprintf(" Target=%q", *se.Target) - } - - if se.Details != nil { - d, err := json.Marshal(se.Details) - if err != nil { - result += fmt.Sprintf(" Details=%v", se.Details) - } - result += fmt.Sprintf(" Details=%s", d) - } - - if se.InnerError != nil { - d, err := json.Marshal(se.InnerError) - if err != nil { - result += fmt.Sprintf(" InnerError=%v", se.InnerError) - } - result += fmt.Sprintf(" InnerError=%s", d) - } - - if se.AdditionalInfo != nil { - d, err := json.Marshal(se.AdditionalInfo) - if err != nil { - result += fmt.Sprintf(" AdditionalInfo=%v", se.AdditionalInfo) - } - result += fmt.Sprintf(" AdditionalInfo=%s", d) - } - - return result -} - -// UnmarshalJSON implements the json.Unmarshaler interface for the ServiceError type. -func (se *ServiceError) UnmarshalJSON(b []byte) error { - // http://docs.oasis-open.org/odata/odata-json-format/v4.0/os/odata-json-format-v4.0-os.html#_Toc372793091 - - type serviceErrorInternal struct { - Code string `json:"code"` - Message string `json:"message"` - Target *string `json:"target,omitempty"` - AdditionalInfo []map[string]interface{} `json:"additionalInfo,omitempty"` - // not all services conform to the OData v4 spec. - // the following fields are where we've seen discrepancies - - // spec calls for []map[string]interface{} but have seen map[string]interface{} - Details interface{} `json:"details,omitempty"` - - // spec calls for map[string]interface{} but have seen []map[string]interface{} and string - InnerError interface{} `json:"innererror,omitempty"` - } - - sei := serviceErrorInternal{} - if err := json.Unmarshal(b, &sei); err != nil { - return err - } - - // copy the fields we know to be correct - se.AdditionalInfo = sei.AdditionalInfo - se.Code = sei.Code - se.Message = sei.Message - se.Target = sei.Target - - // converts an []interface{} to []map[string]interface{} - arrayOfObjs := func(v interface{}) ([]map[string]interface{}, bool) { - arrayOf, ok := v.([]interface{}) - if !ok { - return nil, false - } - final := []map[string]interface{}{} - for _, item := range arrayOf { - as, ok := item.(map[string]interface{}) - if !ok { - return nil, false - } - final = append(final, as) - } - return final, true - } - - // convert the remaining fields, falling back to raw JSON if necessary - - if c, ok := arrayOfObjs(sei.Details); ok { - se.Details = c - } else if c, ok := sei.Details.(map[string]interface{}); ok { - se.Details = []map[string]interface{}{c} - } else if sei.Details != nil { - // stuff into Details - se.Details = []map[string]interface{}{ - {"raw": sei.Details}, - } - } - - if c, ok := sei.InnerError.(map[string]interface{}); ok { - se.InnerError = c - } else if c, ok := arrayOfObjs(sei.InnerError); ok { - // if there's only one error extract it - if len(c) == 1 { - se.InnerError = c[0] - } else { - // multiple errors, stuff them into the value - se.InnerError = map[string]interface{}{ - "multi": c, - } - } - } else if c, ok := sei.InnerError.(string); ok { - se.InnerError = map[string]interface{}{"error": c} - } else if sei.InnerError != nil { - // stuff into InnerError - se.InnerError = map[string]interface{}{ - "raw": sei.InnerError, - } - } - return nil -} - -// RequestError describes an error response returned by Azure service. -type RequestError struct { - autorest.DetailedError - - // The error returned by the Azure service. - ServiceError *ServiceError `json:"error" xml:"Error"` - - // The request id (from the x-ms-request-id-header) of the request. - RequestID string -} - -// Error returns a human-friendly error message from service error. -func (e RequestError) Error() string { - return fmt.Sprintf("autorest/azure: Service returned an error. Status=%v %v", - e.StatusCode, e.ServiceError) -} - -// IsAzureError returns true if the passed error is an Azure Service error; false otherwise. -func IsAzureError(e error) bool { - _, ok := e.(*RequestError) - return ok -} - -// Resource contains details about an Azure resource. -type Resource struct { - SubscriptionID string - ResourceGroup string - Provider string - ResourceType string - ResourceName string -} - -// String function returns a string in form of azureResourceID -func (r Resource) String() string { - return fmt.Sprintf("/subscriptions/%s/resourceGroups/%s/providers/%s/%s/%s", r.SubscriptionID, r.ResourceGroup, r.Provider, r.ResourceType, r.ResourceName) -} - -// ParseResourceID parses a resource ID into a ResourceDetails struct. -// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/template-functions-resource?tabs=json#resourceid. -func ParseResourceID(resourceID string) (Resource, error) { - - const resourceIDPatternText = `(?i)subscriptions/(.+)/resourceGroups/(.+)/providers/(.+?)/(.+?)/(.+)` - resourceIDPattern := regexp.MustCompile(resourceIDPatternText) - match := resourceIDPattern.FindStringSubmatch(resourceID) - - if len(match) == 0 { - return Resource{}, fmt.Errorf("parsing failed for %s. Invalid resource Id format", resourceID) - } - - v := strings.Split(match[5], "/") - resourceName := v[len(v)-1] - - result := Resource{ - SubscriptionID: match[1], - ResourceGroup: match[2], - Provider: match[3], - ResourceType: match[4], - ResourceName: resourceName, - } - - return result, nil -} - -// NewErrorWithError creates a new Error conforming object from the -// passed packageType, method, statusCode of the given resp (UndefinedStatusCode -// if resp is nil), message, and original error. message is treated as a format -// string to which the optional args apply. -func NewErrorWithError(original error, packageType string, method string, resp *http.Response, message string, args ...interface{}) RequestError { - if v, ok := original.(*RequestError); ok { - return *v - } - - statusCode := autorest.UndefinedStatusCode - if resp != nil { - statusCode = resp.StatusCode - } - return RequestError{ - DetailedError: autorest.DetailedError{ - Original: original, - PackageType: packageType, - Method: method, - StatusCode: statusCode, - Message: fmt.Sprintf(message, args...), - }, - } -} - -// WithReturningClientID returns a PrepareDecorator that adds an HTTP extension header of -// x-ms-client-request-id whose value is the passed, undecorated UUID (e.g., -// "0F39878C-5F76-4DB8-A25D-61D2C193C3CA"). It also sets the x-ms-return-client-request-id -// header to true such that UUID accompanies the http.Response. -func WithReturningClientID(uuid string) autorest.PrepareDecorator { - preparer := autorest.CreatePreparer( - WithClientID(uuid), - WithReturnClientID(true)) - - return func(p autorest.Preparer) autorest.Preparer { - return autorest.PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err != nil { - return r, err - } - return preparer.Prepare(r) - }) - } -} - -// WithClientID returns a PrepareDecorator that adds an HTTP extension header of -// x-ms-client-request-id whose value is passed, undecorated UUID (e.g., -// "0F39878C-5F76-4DB8-A25D-61D2C193C3CA"). -func WithClientID(uuid string) autorest.PrepareDecorator { - return autorest.WithHeader(HeaderClientID, uuid) -} - -// WithReturnClientID returns a PrepareDecorator that adds an HTTP extension header of -// x-ms-return-client-request-id whose boolean value indicates if the value of the -// x-ms-client-request-id header should be included in the http.Response. -func WithReturnClientID(b bool) autorest.PrepareDecorator { - return autorest.WithHeader(HeaderReturnClientID, strconv.FormatBool(b)) -} - -// ExtractClientID extracts the client identifier from the x-ms-client-request-id header set on the -// http.Request sent to the service (and returned in the http.Response) -func ExtractClientID(resp *http.Response) string { - return autorest.ExtractHeaderValue(HeaderClientID, resp) -} - -// ExtractRequestID extracts the Azure server generated request identifier from the -// x-ms-request-id header. -func ExtractRequestID(resp *http.Response) string { - return autorest.ExtractHeaderValue(HeaderRequestID, resp) -} - -// WithErrorUnlessStatusCode returns a RespondDecorator that emits an -// azure.RequestError by reading the response body unless the response HTTP status code -// is among the set passed. -// -// If there is a chance service may return responses other than the Azure error -// format and the response cannot be parsed into an error, a decoding error will -// be returned containing the response body. In any case, the Responder will -// return an error if the status code is not satisfied. -// -// If this Responder returns an error, the response body will be replaced with -// an in-memory reader, which needs no further closing. -func WithErrorUnlessStatusCode(codes ...int) autorest.RespondDecorator { - return func(r autorest.Responder) autorest.Responder { - return autorest.ResponderFunc(func(resp *http.Response) error { - err := r.Respond(resp) - if err == nil && !autorest.ResponseHasStatusCode(resp, codes...) { - var e RequestError - defer resp.Body.Close() - - encodedAs := autorest.EncodedAsJSON - if strings.Contains(resp.Header.Get("Content-Type"), "xml") { - encodedAs = autorest.EncodedAsXML - } - - // Copy and replace the Body in case it does not contain an error object. - // This will leave the Body available to the caller. - b, decodeErr := autorest.CopyAndDecode(encodedAs, resp.Body, &e) - resp.Body = ioutil.NopCloser(&b) - if decodeErr != nil { - return fmt.Errorf("autorest/azure: error response cannot be parsed: %q error: %v", b, decodeErr) - } - if e.ServiceError == nil { - // Check if error is unwrapped ServiceError - decoder := autorest.NewDecoder(encodedAs, bytes.NewReader(b.Bytes())) - if err := decoder.Decode(&e.ServiceError); err != nil { - return fmt.Errorf("autorest/azure: error response cannot be parsed: %q error: %v", b, err) - } - - // for example, should the API return the literal value `null` as the response - if e.ServiceError == nil { - e.ServiceError = &ServiceError{ - Code: "Unknown", - Message: "Unknown service error", - Details: []map[string]interface{}{ - { - "HttpResponse.Body": b.String(), - }, - }, - } - } - } - - if e.ServiceError != nil && e.ServiceError.Message == "" { - // if we're here it means the returned error wasn't OData v4 compliant. - // try to unmarshal the body in hopes of getting something. - rawBody := map[string]interface{}{} - decoder := autorest.NewDecoder(encodedAs, bytes.NewReader(b.Bytes())) - if err := decoder.Decode(&rawBody); err != nil { - return fmt.Errorf("autorest/azure: error response cannot be parsed: %q error: %v", b, err) - } - - e.ServiceError = &ServiceError{ - Code: "Unknown", - Message: "Unknown service error", - } - if len(rawBody) > 0 { - e.ServiceError.Details = []map[string]interface{}{rawBody} - } - } - e.Response = resp - e.RequestID = ExtractRequestID(resp) - if e.StatusCode == nil { - e.StatusCode = resp.StatusCode - } - err = &e - } - return err - }) - } -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/cli/LICENSE b/vendor/github.com/Azure/go-autorest/autorest/azure/cli/LICENSE deleted file mode 100644 index b9d6a27ea9..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/cli/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2015 Microsoft Corporation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/cli/go_mod_tidy_hack.go b/vendor/github.com/Azure/go-autorest/autorest/azure/cli/go_mod_tidy_hack.go deleted file mode 100644 index 50d6f0391a..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/cli/go_mod_tidy_hack.go +++ /dev/null @@ -1,25 +0,0 @@ -//go:build modhack -// +build modhack - -package cli - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file, and the github.com/Azure/go-autorest import, won't actually become part of -// the resultant binary. - -// Necessary for safely adding multi-module repo. -// See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository -import _ "github.com/Azure/go-autorest" diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/cli/profile.go b/vendor/github.com/Azure/go-autorest/autorest/azure/cli/profile.go deleted file mode 100644 index f45c3a516d..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/cli/profile.go +++ /dev/null @@ -1,83 +0,0 @@ -package cli - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "encoding/json" - "fmt" - "io/ioutil" - "os" - "path/filepath" - - "github.com/dimchansky/utfbom" - "github.com/mitchellh/go-homedir" -) - -// Profile represents a Profile from the Azure CLI -type Profile struct { - InstallationID string `json:"installationId"` - Subscriptions []Subscription `json:"subscriptions"` -} - -// Subscription represents a Subscription from the Azure CLI -type Subscription struct { - EnvironmentName string `json:"environmentName"` - ID string `json:"id"` - IsDefault bool `json:"isDefault"` - Name string `json:"name"` - State string `json:"state"` - TenantID string `json:"tenantId"` - User *User `json:"user"` -} - -// User represents a User from the Azure CLI -type User struct { - Name string `json:"name"` - Type string `json:"type"` -} - -const azureProfileJSON = "azureProfile.json" - -func configDir() string { - return os.Getenv("AZURE_CONFIG_DIR") -} - -// ProfilePath returns the path where the Azure Profile is stored from the Azure CLI -func ProfilePath() (string, error) { - if cfgDir := configDir(); cfgDir != "" { - return filepath.Join(cfgDir, azureProfileJSON), nil - } - return homedir.Expand("~/.azure/" + azureProfileJSON) -} - -// LoadProfile restores a Profile object from a file located at 'path'. -func LoadProfile(path string) (result Profile, err error) { - var contents []byte - contents, err = ioutil.ReadFile(path) - if err != nil { - err = fmt.Errorf("failed to open file (%s) while loading token: %v", path, err) - return - } - reader := utfbom.SkipOnly(bytes.NewReader(contents)) - - dec := json.NewDecoder(reader) - if err = dec.Decode(&result); err != nil { - err = fmt.Errorf("failed to decode contents of file (%s) into a Profile representation: %v", path, err) - return - } - - return -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/cli/token.go b/vendor/github.com/Azure/go-autorest/autorest/azure/cli/token.go deleted file mode 100644 index 486619111c..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/cli/token.go +++ /dev/null @@ -1,227 +0,0 @@ -package cli - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "encoding/json" - "fmt" - "os" - "os/exec" - "path/filepath" - "regexp" - "runtime" - "strconv" - "time" - - "github.com/Azure/go-autorest/autorest/adal" - "github.com/Azure/go-autorest/autorest/date" - "github.com/mitchellh/go-homedir" -) - -// Token represents an AccessToken from the Azure CLI -type Token struct { - AccessToken string `json:"accessToken"` - Authority string `json:"_authority"` - ClientID string `json:"_clientId"` - ExpiresOn string `json:"expiresOn"` - IdentityProvider string `json:"identityProvider"` - IsMRRT bool `json:"isMRRT"` - RefreshToken string `json:"refreshToken"` - Resource string `json:"resource"` - TokenType string `json:"tokenType"` - UserID string `json:"userId"` -} - -const accessTokensJSON = "accessTokens.json" - -// ToADALToken converts an Azure CLI `Token`` to an `adal.Token`` -func (t Token) ToADALToken() (converted adal.Token, err error) { - tokenExpirationDate, err := ParseExpirationDate(t.ExpiresOn) - if err != nil { - err = fmt.Errorf("Error parsing Token Expiration Date %q: %+v", t.ExpiresOn, err) - return - } - - difference := tokenExpirationDate.Sub(date.UnixEpoch()) - - converted = adal.Token{ - AccessToken: t.AccessToken, - Type: t.TokenType, - ExpiresIn: "3600", - ExpiresOn: json.Number(strconv.Itoa(int(difference.Seconds()))), - RefreshToken: t.RefreshToken, - Resource: t.Resource, - } - return -} - -// AccessTokensPath returns the path where access tokens are stored from the Azure CLI -// TODO(#199): add unit test. -func AccessTokensPath() (string, error) { - // Azure-CLI allows user to customize the path of access tokens through environment variable. - if accessTokenPath := os.Getenv("AZURE_ACCESS_TOKEN_FILE"); accessTokenPath != "" { - return accessTokenPath, nil - } - - // Azure-CLI allows user to customize the path to Azure config directory through environment variable. - if cfgDir := configDir(); cfgDir != "" { - return filepath.Join(cfgDir, accessTokensJSON), nil - } - - // Fallback logic to default path on non-cloud-shell environment. - // TODO(#200): remove the dependency on hard-coding path. - return homedir.Expand("~/.azure/" + accessTokensJSON) -} - -// ParseExpirationDate parses either a Azure CLI or CloudShell date into a time object -func ParseExpirationDate(input string) (*time.Time, error) { - // CloudShell (and potentially the Azure CLI in future) - expirationDate, cloudShellErr := time.Parse(time.RFC3339, input) - if cloudShellErr != nil { - // Azure CLI (Python) e.g. 2017-08-31 19:48:57.998857 (plus the local timezone) - const cliFormat = "2006-01-02 15:04:05.999999" - expirationDate, cliErr := time.ParseInLocation(cliFormat, input, time.Local) - if cliErr == nil { - return &expirationDate, nil - } - - return nil, fmt.Errorf("Error parsing expiration date %q.\n\nCloudShell Error: \n%+v\n\nCLI Error:\n%+v", input, cloudShellErr, cliErr) - } - - return &expirationDate, nil -} - -// LoadTokens restores a set of Token objects from a file located at 'path'. -func LoadTokens(path string) ([]Token, error) { - file, err := os.Open(path) - if err != nil { - return nil, fmt.Errorf("failed to open file (%s) while loading token: %v", path, err) - } - defer file.Close() - - var tokens []Token - - dec := json.NewDecoder(file) - if err = dec.Decode(&tokens); err != nil { - return nil, fmt.Errorf("failed to decode contents of file (%s) into a `cli.Token` representation: %v", path, err) - } - - return tokens, nil -} - -// GetTokenFromCLI gets a token using Azure CLI 2.0 for local development scenarios. -func GetTokenFromCLI(resource string) (*Token, error) { - return GetTokenFromCLIWithParams(GetAccessTokenParams{Resource: resource}) -} - -// GetAccessTokenParams is the parameter struct of GetTokenFromCLIWithParams -type GetAccessTokenParams struct { - Resource string - ResourceType string - Subscription string - Tenant string -} - -// GetTokenFromCLIWithParams gets a token using Azure CLI 2.0 for local development scenarios. -func GetTokenFromCLIWithParams(params GetAccessTokenParams) (*Token, error) { - cliCmd := GetAzureCLICommand() - - cliCmd.Args = append(cliCmd.Args, "account", "get-access-token", "-o", "json") - if params.Resource != "" { - if err := validateParameter(params.Resource); err != nil { - return nil, err - } - cliCmd.Args = append(cliCmd.Args, "--resource", params.Resource) - } - if params.ResourceType != "" { - if err := validateParameter(params.ResourceType); err != nil { - return nil, err - } - cliCmd.Args = append(cliCmd.Args, "--resource-type", params.ResourceType) - } - if params.Subscription != "" { - if err := validateParameter(params.Subscription); err != nil { - return nil, err - } - cliCmd.Args = append(cliCmd.Args, "--subscription", params.Subscription) - } - if params.Tenant != "" { - if err := validateParameter(params.Tenant); err != nil { - return nil, err - } - cliCmd.Args = append(cliCmd.Args, "--tenant", params.Tenant) - } - - var stderr bytes.Buffer - cliCmd.Stderr = &stderr - - output, err := cliCmd.Output() - if err != nil { - if stderr.Len() > 0 { - return nil, fmt.Errorf("Invoking Azure CLI failed with the following error: %s", stderr.String()) - } - - return nil, fmt.Errorf("Invoking Azure CLI failed with the following error: %s", err.Error()) - } - - tokenResponse := Token{} - err = json.Unmarshal(output, &tokenResponse) - if err != nil { - return nil, err - } - - return &tokenResponse, err -} - -func validateParameter(param string) error { - // Validate parameters, since it gets sent as a command line argument to Azure CLI - const invalidResourceErrorTemplate = "Parameter %s is not in expected format. Only alphanumeric characters, [dot], [colon], [hyphen], and [forward slash] are allowed." - match, err := regexp.MatchString("^[0-9a-zA-Z-.:/]+$", param) - if err != nil { - return err - } - if !match { - return fmt.Errorf(invalidResourceErrorTemplate, param) - } - return nil -} - -// GetAzureCLICommand can be used to run arbitrary Azure CLI command -func GetAzureCLICommand() *exec.Cmd { - // This is the path that a developer can set to tell this class what the install path for Azure CLI is. - const azureCLIPath = "AzureCLIPath" - - // The default install paths are used to find Azure CLI. This is for security, so that any path in the calling program's Path environment is not used to execute Azure CLI. - azureCLIDefaultPathWindows := fmt.Sprintf("%s\\Microsoft SDKs\\Azure\\CLI2\\wbin; %s\\Microsoft SDKs\\Azure\\CLI2\\wbin", os.Getenv("ProgramFiles(x86)"), os.Getenv("ProgramFiles")) - - // Default path for non-Windows. - const azureCLIDefaultPath = "/bin:/sbin:/usr/bin:/usr/local/bin" - - // Execute Azure CLI to get token - var cliCmd *exec.Cmd - if runtime.GOOS == "windows" { - cliCmd = exec.Command(fmt.Sprintf("%s\\system32\\cmd.exe", os.Getenv("windir"))) - cliCmd.Env = os.Environ() - cliCmd.Env = append(cliCmd.Env, fmt.Sprintf("PATH=%s;%s", os.Getenv(azureCLIPath), azureCLIDefaultPathWindows)) - cliCmd.Args = append(cliCmd.Args, "/c", "az") - } else { - cliCmd = exec.Command("az") - cliCmd.Env = os.Environ() - cliCmd.Env = append(cliCmd.Env, fmt.Sprintf("PATH=%s:%s", os.Getenv(azureCLIPath), azureCLIDefaultPath)) - } - - return cliCmd -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go b/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go deleted file mode 100644 index b0a53769f2..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/environments.go +++ /dev/null @@ -1,331 +0,0 @@ -package azure - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "os" - "strings" -) - -const ( - // EnvironmentFilepathName captures the name of the environment variable containing the path to the file - // to be used while populating the Azure Environment. - EnvironmentFilepathName = "AZURE_ENVIRONMENT_FILEPATH" - - // NotAvailable is used for endpoints and resource IDs that are not available for a given cloud. - NotAvailable = "N/A" -) - -var environments = map[string]Environment{ - "AZURECHINACLOUD": ChinaCloud, - "AZUREGERMANCLOUD": GermanCloud, - "AZURECLOUD": PublicCloud, - "AZUREPUBLICCLOUD": PublicCloud, - "AZUREUSGOVERNMENT": USGovernmentCloud, - "AZUREUSGOVERNMENTCLOUD": USGovernmentCloud, //TODO: deprecate -} - -// ResourceIdentifier contains a set of Azure resource IDs. -type ResourceIdentifier struct { - Graph string `json:"graph"` - KeyVault string `json:"keyVault"` - Datalake string `json:"datalake"` - Batch string `json:"batch"` - OperationalInsights string `json:"operationalInsights"` - OSSRDBMS string `json:"ossRDBMS"` - Storage string `json:"storage"` - Synapse string `json:"synapse"` - ServiceBus string `json:"serviceBus"` - SQLDatabase string `json:"sqlDatabase"` - CosmosDB string `json:"cosmosDB"` - ManagedHSM string `json:"managedHSM"` - MicrosoftGraph string `json:"microsoftGraph"` -} - -// Environment represents a set of endpoints for each of Azure's Clouds. -type Environment struct { - Name string `json:"name"` - ManagementPortalURL string `json:"managementPortalURL"` - PublishSettingsURL string `json:"publishSettingsURL"` - ServiceManagementEndpoint string `json:"serviceManagementEndpoint"` - ResourceManagerEndpoint string `json:"resourceManagerEndpoint"` - ActiveDirectoryEndpoint string `json:"activeDirectoryEndpoint"` - GalleryEndpoint string `json:"galleryEndpoint"` - KeyVaultEndpoint string `json:"keyVaultEndpoint"` - ManagedHSMEndpoint string `json:"managedHSMEndpoint"` - GraphEndpoint string `json:"graphEndpoint"` - ServiceBusEndpoint string `json:"serviceBusEndpoint"` - BatchManagementEndpoint string `json:"batchManagementEndpoint"` - MicrosoftGraphEndpoint string `json:"microsoftGraphEndpoint"` - StorageEndpointSuffix string `json:"storageEndpointSuffix"` - CosmosDBDNSSuffix string `json:"cosmosDBDNSSuffix"` - MariaDBDNSSuffix string `json:"mariaDBDNSSuffix"` - MySQLDatabaseDNSSuffix string `json:"mySqlDatabaseDNSSuffix"` - PostgresqlDatabaseDNSSuffix string `json:"postgresqlDatabaseDNSSuffix"` - SQLDatabaseDNSSuffix string `json:"sqlDatabaseDNSSuffix"` - TrafficManagerDNSSuffix string `json:"trafficManagerDNSSuffix"` - KeyVaultDNSSuffix string `json:"keyVaultDNSSuffix"` - ManagedHSMDNSSuffix string `json:"managedHSMDNSSuffix"` - ServiceBusEndpointSuffix string `json:"serviceBusEndpointSuffix"` - ServiceManagementVMDNSSuffix string `json:"serviceManagementVMDNSSuffix"` - ResourceManagerVMDNSSuffix string `json:"resourceManagerVMDNSSuffix"` - ContainerRegistryDNSSuffix string `json:"containerRegistryDNSSuffix"` - TokenAudience string `json:"tokenAudience"` - APIManagementHostNameSuffix string `json:"apiManagementHostNameSuffix"` - SynapseEndpointSuffix string `json:"synapseEndpointSuffix"` - DatalakeSuffix string `json:"datalakeSuffix"` - ResourceIdentifiers ResourceIdentifier `json:"resourceIdentifiers"` -} - -var ( - // PublicCloud is the default public Azure cloud environment - PublicCloud = Environment{ - Name: "AzurePublicCloud", - ManagementPortalURL: "https://manage.windowsazure.com/", - PublishSettingsURL: "https://manage.windowsazure.com/publishsettings/index", - ServiceManagementEndpoint: "https://management.core.windows.net/", - ResourceManagerEndpoint: "https://management.azure.com/", - ActiveDirectoryEndpoint: "https://login.microsoftonline.com/", - GalleryEndpoint: "https://gallery.azure.com/", - KeyVaultEndpoint: "https://vault.azure.net/", - ManagedHSMEndpoint: "https://managedhsm.azure.net/", - GraphEndpoint: "https://graph.windows.net/", - ServiceBusEndpoint: "https://servicebus.windows.net/", - BatchManagementEndpoint: "https://batch.core.windows.net/", - MicrosoftGraphEndpoint: "https://graph.microsoft.com/", - StorageEndpointSuffix: "core.windows.net", - CosmosDBDNSSuffix: "documents.azure.com", - MariaDBDNSSuffix: "mariadb.database.azure.com", - MySQLDatabaseDNSSuffix: "mysql.database.azure.com", - PostgresqlDatabaseDNSSuffix: "postgres.database.azure.com", - SQLDatabaseDNSSuffix: "database.windows.net", - TrafficManagerDNSSuffix: "trafficmanager.net", - KeyVaultDNSSuffix: "vault.azure.net", - ManagedHSMDNSSuffix: "managedhsm.azure.net", - ServiceBusEndpointSuffix: "servicebus.windows.net", - ServiceManagementVMDNSSuffix: "cloudapp.net", - ResourceManagerVMDNSSuffix: "cloudapp.azure.com", - ContainerRegistryDNSSuffix: "azurecr.io", - TokenAudience: "https://management.azure.com/", - APIManagementHostNameSuffix: "azure-api.net", - SynapseEndpointSuffix: "dev.azuresynapse.net", - DatalakeSuffix: "azuredatalakestore.net", - ResourceIdentifiers: ResourceIdentifier{ - Graph: "https://graph.windows.net/", - KeyVault: "https://vault.azure.net", - Datalake: "https://datalake.azure.net/", - Batch: "https://batch.core.windows.net/", - OperationalInsights: "https://api.loganalytics.io", - OSSRDBMS: "https://ossrdbms-aad.database.windows.net", - Storage: "https://storage.azure.com/", - Synapse: "https://dev.azuresynapse.net", - ServiceBus: "https://servicebus.azure.net/", - SQLDatabase: "https://database.windows.net/", - CosmosDB: "https://cosmos.azure.com", - ManagedHSM: "https://managedhsm.azure.net", - MicrosoftGraph: "https://graph.microsoft.com/", - }, - } - - // USGovernmentCloud is the cloud environment for the US Government - USGovernmentCloud = Environment{ - Name: "AzureUSGovernmentCloud", - ManagementPortalURL: "https://manage.windowsazure.us/", - PublishSettingsURL: "https://manage.windowsazure.us/publishsettings/index", - ServiceManagementEndpoint: "https://management.core.usgovcloudapi.net/", - ResourceManagerEndpoint: "https://management.usgovcloudapi.net/", - ActiveDirectoryEndpoint: "https://login.microsoftonline.us/", - GalleryEndpoint: "https://gallery.usgovcloudapi.net/", - KeyVaultEndpoint: "https://vault.usgovcloudapi.net/", - ManagedHSMEndpoint: NotAvailable, - GraphEndpoint: "https://graph.windows.net/", - ServiceBusEndpoint: "https://servicebus.usgovcloudapi.net/", - BatchManagementEndpoint: "https://batch.core.usgovcloudapi.net/", - MicrosoftGraphEndpoint: "https://graph.microsoft.us/", - StorageEndpointSuffix: "core.usgovcloudapi.net", - CosmosDBDNSSuffix: "documents.azure.us", - MariaDBDNSSuffix: "mariadb.database.usgovcloudapi.net", - MySQLDatabaseDNSSuffix: "mysql.database.usgovcloudapi.net", - PostgresqlDatabaseDNSSuffix: "postgres.database.usgovcloudapi.net", - SQLDatabaseDNSSuffix: "database.usgovcloudapi.net", - TrafficManagerDNSSuffix: "usgovtrafficmanager.net", - KeyVaultDNSSuffix: "vault.usgovcloudapi.net", - ManagedHSMDNSSuffix: NotAvailable, - ServiceBusEndpointSuffix: "servicebus.usgovcloudapi.net", - ServiceManagementVMDNSSuffix: "usgovcloudapp.net", - ResourceManagerVMDNSSuffix: "cloudapp.usgovcloudapi.net", - ContainerRegistryDNSSuffix: "azurecr.us", - TokenAudience: "https://management.usgovcloudapi.net/", - APIManagementHostNameSuffix: "azure-api.us", - SynapseEndpointSuffix: "dev.azuresynapse.usgovcloudapi.net", - DatalakeSuffix: NotAvailable, - ResourceIdentifiers: ResourceIdentifier{ - Graph: "https://graph.windows.net/", - KeyVault: "https://vault.usgovcloudapi.net", - Datalake: NotAvailable, - Batch: "https://batch.core.usgovcloudapi.net/", - OperationalInsights: "https://api.loganalytics.us", - OSSRDBMS: "https://ossrdbms-aad.database.usgovcloudapi.net", - Storage: "https://storage.azure.com/", - Synapse: "https://dev.azuresynapse.usgovcloudapi.net", - ServiceBus: "https://servicebus.azure.net/", - SQLDatabase: "https://database.usgovcloudapi.net/", - CosmosDB: "https://cosmos.azure.com", - ManagedHSM: NotAvailable, - MicrosoftGraph: "https://graph.microsoft.us/", - }, - } - - // ChinaCloud is the cloud environment operated in China - ChinaCloud = Environment{ - Name: "AzureChinaCloud", - ManagementPortalURL: "https://manage.chinacloudapi.com/", - PublishSettingsURL: "https://manage.chinacloudapi.com/publishsettings/index", - ServiceManagementEndpoint: "https://management.core.chinacloudapi.cn/", - ResourceManagerEndpoint: "https://management.chinacloudapi.cn/", - ActiveDirectoryEndpoint: "https://login.chinacloudapi.cn/", - GalleryEndpoint: "https://gallery.chinacloudapi.cn/", - KeyVaultEndpoint: "https://vault.azure.cn/", - ManagedHSMEndpoint: NotAvailable, - GraphEndpoint: "https://graph.chinacloudapi.cn/", - ServiceBusEndpoint: "https://servicebus.chinacloudapi.cn/", - BatchManagementEndpoint: "https://batch.chinacloudapi.cn/", - MicrosoftGraphEndpoint: "https://microsoftgraph.chinacloudapi.cn/", - StorageEndpointSuffix: "core.chinacloudapi.cn", - CosmosDBDNSSuffix: "documents.azure.cn", - MariaDBDNSSuffix: "mariadb.database.chinacloudapi.cn", - MySQLDatabaseDNSSuffix: "mysql.database.chinacloudapi.cn", - PostgresqlDatabaseDNSSuffix: "postgres.database.chinacloudapi.cn", - SQLDatabaseDNSSuffix: "database.chinacloudapi.cn", - TrafficManagerDNSSuffix: "trafficmanager.cn", - KeyVaultDNSSuffix: "vault.azure.cn", - ManagedHSMDNSSuffix: NotAvailable, - ServiceBusEndpointSuffix: "servicebus.chinacloudapi.cn", - ServiceManagementVMDNSSuffix: "chinacloudapp.cn", - ResourceManagerVMDNSSuffix: "cloudapp.chinacloudapi.cn", - ContainerRegistryDNSSuffix: "azurecr.cn", - TokenAudience: "https://management.chinacloudapi.cn/", - APIManagementHostNameSuffix: "azure-api.cn", - SynapseEndpointSuffix: "dev.azuresynapse.azure.cn", - DatalakeSuffix: NotAvailable, - ResourceIdentifiers: ResourceIdentifier{ - Graph: "https://graph.chinacloudapi.cn/", - KeyVault: "https://vault.azure.cn", - Datalake: NotAvailable, - Batch: "https://batch.chinacloudapi.cn/", - OperationalInsights: NotAvailable, - OSSRDBMS: "https://ossrdbms-aad.database.chinacloudapi.cn", - Storage: "https://storage.azure.com/", - Synapse: "https://dev.azuresynapse.net", - ServiceBus: "https://servicebus.azure.net/", - SQLDatabase: "https://database.chinacloudapi.cn/", - CosmosDB: "https://cosmos.azure.com", - ManagedHSM: NotAvailable, - MicrosoftGraph: "https://microsoftgraph.chinacloudapi.cn", - }, - } - - // GermanCloud is the cloud environment operated in Germany - GermanCloud = Environment{ - Name: "AzureGermanCloud", - ManagementPortalURL: "http://portal.microsoftazure.de/", - PublishSettingsURL: "https://manage.microsoftazure.de/publishsettings/index", - ServiceManagementEndpoint: "https://management.core.cloudapi.de/", - ResourceManagerEndpoint: "https://management.microsoftazure.de/", - ActiveDirectoryEndpoint: "https://login.microsoftonline.de/", - GalleryEndpoint: "https://gallery.cloudapi.de/", - KeyVaultEndpoint: "https://vault.microsoftazure.de/", - ManagedHSMEndpoint: NotAvailable, - GraphEndpoint: "https://graph.cloudapi.de/", - ServiceBusEndpoint: "https://servicebus.cloudapi.de/", - BatchManagementEndpoint: "https://batch.cloudapi.de/", - MicrosoftGraphEndpoint: NotAvailable, - StorageEndpointSuffix: "core.cloudapi.de", - CosmosDBDNSSuffix: "documents.microsoftazure.de", - MariaDBDNSSuffix: "mariadb.database.cloudapi.de", - MySQLDatabaseDNSSuffix: "mysql.database.cloudapi.de", - PostgresqlDatabaseDNSSuffix: "postgres.database.cloudapi.de", - SQLDatabaseDNSSuffix: "database.cloudapi.de", - TrafficManagerDNSSuffix: "azuretrafficmanager.de", - KeyVaultDNSSuffix: "vault.microsoftazure.de", - ManagedHSMDNSSuffix: NotAvailable, - ServiceBusEndpointSuffix: "servicebus.cloudapi.de", - ServiceManagementVMDNSSuffix: "azurecloudapp.de", - ResourceManagerVMDNSSuffix: "cloudapp.microsoftazure.de", - ContainerRegistryDNSSuffix: NotAvailable, - TokenAudience: "https://management.microsoftazure.de/", - APIManagementHostNameSuffix: NotAvailable, - SynapseEndpointSuffix: NotAvailable, - DatalakeSuffix: NotAvailable, - ResourceIdentifiers: ResourceIdentifier{ - Graph: "https://graph.cloudapi.de/", - KeyVault: "https://vault.microsoftazure.de", - Datalake: NotAvailable, - Batch: "https://batch.cloudapi.de/", - OperationalInsights: NotAvailable, - OSSRDBMS: "https://ossrdbms-aad.database.cloudapi.de", - Storage: "https://storage.azure.com/", - Synapse: NotAvailable, - ServiceBus: "https://servicebus.azure.net/", - SQLDatabase: "https://database.cloudapi.de/", - CosmosDB: "https://cosmos.azure.com", - ManagedHSM: NotAvailable, - MicrosoftGraph: NotAvailable, - }, - } -) - -// EnvironmentFromName returns an Environment based on the common name specified. -func EnvironmentFromName(name string) (Environment, error) { - // IMPORTANT - // As per @radhikagupta5: - // This is technical debt, fundamentally here because Kubernetes is not currently accepting - // contributions to the providers. Once that is an option, the provider should be updated to - // directly call `EnvironmentFromFile`. Until then, we rely on dispatching Azure Stack environment creation - // from this method based on the name that is provided to us. - if strings.EqualFold(name, "AZURESTACKCLOUD") { - return EnvironmentFromFile(os.Getenv(EnvironmentFilepathName)) - } - - name = strings.ToUpper(name) - env, ok := environments[name] - if !ok { - return env, fmt.Errorf("autorest/azure: There is no cloud environment matching the name %q", name) - } - - return env, nil -} - -// EnvironmentFromFile loads an Environment from a configuration file available on disk. -// This function is particularly useful in the Hybrid Cloud model, where one must define their own -// endpoints. -func EnvironmentFromFile(location string) (unmarshaled Environment, err error) { - fileContents, err := ioutil.ReadFile(location) - if err != nil { - return - } - - err = json.Unmarshal(fileContents, &unmarshaled) - - return -} - -// SetEnvironment updates the environment map with the specified values. -func SetEnvironment(name string, env Environment) { - environments[strings.ToUpper(name)] = env -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/metadata_environment.go b/vendor/github.com/Azure/go-autorest/autorest/azure/metadata_environment.go deleted file mode 100644 index 507f9e95cf..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/metadata_environment.go +++ /dev/null @@ -1,245 +0,0 @@ -package azure - -import ( - "encoding/json" - "fmt" - "io/ioutil" - "net/http" - "strings" - - "github.com/Azure/go-autorest/autorest" -) - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -type audience []string - -type authentication struct { - LoginEndpoint string `json:"loginEndpoint"` - Audiences audience `json:"audiences"` -} - -type environmentMetadataInfo struct { - GalleryEndpoint string `json:"galleryEndpoint"` - GraphEndpoint string `json:"graphEndpoint"` - PortalEndpoint string `json:"portalEndpoint"` - Authentication authentication `json:"authentication"` -} - -// EnvironmentProperty represent property names that clients can override -type EnvironmentProperty string - -const ( - // EnvironmentName ... - EnvironmentName EnvironmentProperty = "name" - // EnvironmentManagementPortalURL .. - EnvironmentManagementPortalURL EnvironmentProperty = "managementPortalURL" - // EnvironmentPublishSettingsURL ... - EnvironmentPublishSettingsURL EnvironmentProperty = "publishSettingsURL" - // EnvironmentServiceManagementEndpoint ... - EnvironmentServiceManagementEndpoint EnvironmentProperty = "serviceManagementEndpoint" - // EnvironmentResourceManagerEndpoint ... - EnvironmentResourceManagerEndpoint EnvironmentProperty = "resourceManagerEndpoint" - // EnvironmentActiveDirectoryEndpoint ... - EnvironmentActiveDirectoryEndpoint EnvironmentProperty = "activeDirectoryEndpoint" - // EnvironmentGalleryEndpoint ... - EnvironmentGalleryEndpoint EnvironmentProperty = "galleryEndpoint" - // EnvironmentKeyVaultEndpoint ... - EnvironmentKeyVaultEndpoint EnvironmentProperty = "keyVaultEndpoint" - // EnvironmentGraphEndpoint ... - EnvironmentGraphEndpoint EnvironmentProperty = "graphEndpoint" - // EnvironmentServiceBusEndpoint ... - EnvironmentServiceBusEndpoint EnvironmentProperty = "serviceBusEndpoint" - // EnvironmentBatchManagementEndpoint ... - EnvironmentBatchManagementEndpoint EnvironmentProperty = "batchManagementEndpoint" - // EnvironmentStorageEndpointSuffix ... - EnvironmentStorageEndpointSuffix EnvironmentProperty = "storageEndpointSuffix" - // EnvironmentSQLDatabaseDNSSuffix ... - EnvironmentSQLDatabaseDNSSuffix EnvironmentProperty = "sqlDatabaseDNSSuffix" - // EnvironmentTrafficManagerDNSSuffix ... - EnvironmentTrafficManagerDNSSuffix EnvironmentProperty = "trafficManagerDNSSuffix" - // EnvironmentKeyVaultDNSSuffix ... - EnvironmentKeyVaultDNSSuffix EnvironmentProperty = "keyVaultDNSSuffix" - // EnvironmentServiceBusEndpointSuffix ... - EnvironmentServiceBusEndpointSuffix EnvironmentProperty = "serviceBusEndpointSuffix" - // EnvironmentServiceManagementVMDNSSuffix ... - EnvironmentServiceManagementVMDNSSuffix EnvironmentProperty = "serviceManagementVMDNSSuffix" - // EnvironmentResourceManagerVMDNSSuffix ... - EnvironmentResourceManagerVMDNSSuffix EnvironmentProperty = "resourceManagerVMDNSSuffix" - // EnvironmentContainerRegistryDNSSuffix ... - EnvironmentContainerRegistryDNSSuffix EnvironmentProperty = "containerRegistryDNSSuffix" - // EnvironmentTokenAudience ... - EnvironmentTokenAudience EnvironmentProperty = "tokenAudience" -) - -// OverrideProperty represents property name and value that clients can override -type OverrideProperty struct { - Key EnvironmentProperty - Value string -} - -// EnvironmentFromURL loads an Environment from a URL -// This function is particularly useful in the Hybrid Cloud model, where one may define their own -// endpoints. -func EnvironmentFromURL(resourceManagerEndpoint string, properties ...OverrideProperty) (environment Environment, err error) { - var metadataEnvProperties environmentMetadataInfo - - if resourceManagerEndpoint == "" { - return environment, fmt.Errorf("Metadata resource manager endpoint is empty") - } - - if metadataEnvProperties, err = retrieveMetadataEnvironment(resourceManagerEndpoint); err != nil { - return environment, err - } - - // Give priority to user's override values - overrideProperties(&environment, properties) - - if environment.Name == "" { - environment.Name = "HybridEnvironment" - } - stampDNSSuffix := environment.StorageEndpointSuffix - if stampDNSSuffix == "" { - stampDNSSuffix = strings.TrimSuffix(strings.TrimPrefix(strings.Replace(resourceManagerEndpoint, strings.Split(resourceManagerEndpoint, ".")[0], "", 1), "."), "/") - environment.StorageEndpointSuffix = stampDNSSuffix - } - if environment.KeyVaultDNSSuffix == "" { - environment.KeyVaultDNSSuffix = fmt.Sprintf("%s.%s", "vault", stampDNSSuffix) - } - if environment.KeyVaultEndpoint == "" { - environment.KeyVaultEndpoint = fmt.Sprintf("%s%s", "https://", environment.KeyVaultDNSSuffix) - } - if environment.TokenAudience == "" { - environment.TokenAudience = metadataEnvProperties.Authentication.Audiences[0] - } - if environment.ActiveDirectoryEndpoint == "" { - environment.ActiveDirectoryEndpoint = metadataEnvProperties.Authentication.LoginEndpoint - } - if environment.ResourceManagerEndpoint == "" { - environment.ResourceManagerEndpoint = resourceManagerEndpoint - } - if environment.GalleryEndpoint == "" { - environment.GalleryEndpoint = metadataEnvProperties.GalleryEndpoint - } - if environment.GraphEndpoint == "" { - environment.GraphEndpoint = metadataEnvProperties.GraphEndpoint - } - - return environment, nil -} - -func overrideProperties(environment *Environment, properties []OverrideProperty) { - for _, property := range properties { - switch property.Key { - case EnvironmentName: - { - environment.Name = property.Value - } - case EnvironmentManagementPortalURL: - { - environment.ManagementPortalURL = property.Value - } - case EnvironmentPublishSettingsURL: - { - environment.PublishSettingsURL = property.Value - } - case EnvironmentServiceManagementEndpoint: - { - environment.ServiceManagementEndpoint = property.Value - } - case EnvironmentResourceManagerEndpoint: - { - environment.ResourceManagerEndpoint = property.Value - } - case EnvironmentActiveDirectoryEndpoint: - { - environment.ActiveDirectoryEndpoint = property.Value - } - case EnvironmentGalleryEndpoint: - { - environment.GalleryEndpoint = property.Value - } - case EnvironmentKeyVaultEndpoint: - { - environment.KeyVaultEndpoint = property.Value - } - case EnvironmentGraphEndpoint: - { - environment.GraphEndpoint = property.Value - } - case EnvironmentServiceBusEndpoint: - { - environment.ServiceBusEndpoint = property.Value - } - case EnvironmentBatchManagementEndpoint: - { - environment.BatchManagementEndpoint = property.Value - } - case EnvironmentStorageEndpointSuffix: - { - environment.StorageEndpointSuffix = property.Value - } - case EnvironmentSQLDatabaseDNSSuffix: - { - environment.SQLDatabaseDNSSuffix = property.Value - } - case EnvironmentTrafficManagerDNSSuffix: - { - environment.TrafficManagerDNSSuffix = property.Value - } - case EnvironmentKeyVaultDNSSuffix: - { - environment.KeyVaultDNSSuffix = property.Value - } - case EnvironmentServiceBusEndpointSuffix: - { - environment.ServiceBusEndpointSuffix = property.Value - } - case EnvironmentServiceManagementVMDNSSuffix: - { - environment.ServiceManagementVMDNSSuffix = property.Value - } - case EnvironmentResourceManagerVMDNSSuffix: - { - environment.ResourceManagerVMDNSSuffix = property.Value - } - case EnvironmentContainerRegistryDNSSuffix: - { - environment.ContainerRegistryDNSSuffix = property.Value - } - case EnvironmentTokenAudience: - { - environment.TokenAudience = property.Value - } - } - } -} - -func retrieveMetadataEnvironment(endpoint string) (environment environmentMetadataInfo, err error) { - client := autorest.NewClientWithUserAgent("") - managementEndpoint := fmt.Sprintf("%s%s", strings.TrimSuffix(endpoint, "/"), "/metadata/endpoints?api-version=1.0") - req, _ := http.NewRequest("GET", managementEndpoint, nil) - response, err := client.Do(req) - if err != nil { - return environment, err - } - defer response.Body.Close() - jsonResponse, err := ioutil.ReadAll(response.Body) - if err != nil { - return environment, err - } - err = json.Unmarshal(jsonResponse, &environment) - return environment, err -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go b/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go deleted file mode 100644 index 5b52357f95..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/azure/rp.go +++ /dev/null @@ -1,204 +0,0 @@ -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package azure - -import ( - "errors" - "fmt" - "net/http" - "net/url" - "strings" - "time" - - "github.com/Azure/go-autorest/autorest" -) - -// DoRetryWithRegistration tries to register the resource provider in case it is unregistered. -// It also handles request retries -func DoRetryWithRegistration(client autorest.Client) autorest.SendDecorator { - return func(s autorest.Sender) autorest.Sender { - return autorest.SenderFunc(func(r *http.Request) (resp *http.Response, err error) { - rr := autorest.NewRetriableRequest(r) - for currentAttempt := 0; currentAttempt < client.RetryAttempts; currentAttempt++ { - err = rr.Prepare() - if err != nil { - return resp, err - } - - resp, err = autorest.SendWithSender(s, rr.Request(), - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...), - ) - if err != nil { - return resp, err - } - - if resp.StatusCode != http.StatusConflict || client.SkipResourceProviderRegistration { - return resp, err - } - - var re RequestError - if strings.Contains(r.Header.Get("Content-Type"), "xml") { - // XML errors (e.g. Storage Data Plane) only return the inner object - err = autorest.Respond(resp, autorest.ByUnmarshallingXML(&re.ServiceError)) - } else { - err = autorest.Respond(resp, autorest.ByUnmarshallingJSON(&re)) - } - - if err != nil { - return resp, err - } - err = re - - if re.ServiceError != nil && re.ServiceError.Code == "MissingSubscriptionRegistration" { - regErr := register(client, r, re) - if regErr != nil { - return resp, fmt.Errorf("failed auto registering Resource Provider: %s. Original error: %w", regErr, err) - } - } - } - return resp, err - }) - } -} - -func getProvider(re RequestError) (string, error) { - if re.ServiceError != nil && len(re.ServiceError.Details) > 0 { - return re.ServiceError.Details[0]["target"].(string), nil - } - return "", errors.New("provider was not found in the response") -} - -func register(client autorest.Client, originalReq *http.Request, re RequestError) error { - subID := getSubscription(originalReq.URL.Path) - if subID == "" { - return errors.New("missing parameter subscriptionID to register resource provider") - } - providerName, err := getProvider(re) - if err != nil { - return fmt.Errorf("missing parameter provider to register resource provider: %s", err) - } - newURL := url.URL{ - Scheme: originalReq.URL.Scheme, - Host: originalReq.URL.Host, - } - - // taken from the resources SDK - // with almost identical code, this sections are easier to mantain - // It is also not a good idea to import the SDK here - // https://github.com/Azure/azure-sdk-for-go/blob/9f366792afa3e0ddaecdc860e793ba9d75e76c27/arm/resources/resources/providers.go#L252 - pathParameters := map[string]interface{}{ - "resourceProviderNamespace": autorest.Encode("path", providerName), - "subscriptionId": autorest.Encode("path", subID), - } - - const APIVersion = "2016-09-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(newURL.String()), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}/register", pathParameters), - autorest.WithQueryParameters(queryParameters), - ) - - req, err := preparer.Prepare(&http.Request{}) - if err != nil { - return err - } - req = req.WithContext(originalReq.Context()) - - resp, err := autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...), - ) - if err != nil { - return err - } - - type Provider struct { - RegistrationState *string `json:"registrationState,omitempty"` - } - var provider Provider - - err = autorest.Respond( - resp, - WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&provider), - autorest.ByClosing(), - ) - if err != nil { - return err - } - - // poll for registered provisioning state - registrationStartTime := time.Now() - for err == nil && (client.PollingDuration == 0 || (client.PollingDuration != 0 && time.Since(registrationStartTime) < client.PollingDuration)) { - // taken from the resources SDK - // https://github.com/Azure/azure-sdk-for-go/blob/9f366792afa3e0ddaecdc860e793ba9d75e76c27/arm/resources/resources/providers.go#L45 - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(newURL.String()), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/{resourceProviderNamespace}", pathParameters), - autorest.WithQueryParameters(queryParameters), - ) - req, err = preparer.Prepare(&http.Request{}) - if err != nil { - return err - } - req = req.WithContext(originalReq.Context()) - - resp, err := autorest.SendWithSender(client, req, - autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...), - ) - if err != nil { - return err - } - - err = autorest.Respond( - resp, - WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&provider), - autorest.ByClosing(), - ) - if err != nil { - return err - } - - if provider.RegistrationState != nil && - *provider.RegistrationState == "Registered" { - break - } - - delayed := autorest.DelayWithRetryAfter(resp, originalReq.Context().Done()) - if !delayed && !autorest.DelayForBackoff(client.PollingDelay, 0, originalReq.Context().Done()) { - return originalReq.Context().Err() - } - } - if client.PollingDuration != 0 && !(time.Since(registrationStartTime) < client.PollingDuration) { - return errors.New("polling for resource provider registration has exceeded the polling duration") - } - return err -} - -func getSubscription(path string) string { - parts := strings.Split(path, "/") - for i, v := range parts { - if v == "subscriptions" && (i+1) < len(parts) { - return parts[i+1] - } - } - return "" -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/client.go b/vendor/github.com/Azure/go-autorest/autorest/client.go deleted file mode 100644 index bb5f9396e9..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/client.go +++ /dev/null @@ -1,328 +0,0 @@ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "crypto/tls" - "errors" - "fmt" - "io" - "io/ioutil" - "log" - "net/http" - "strings" - "time" - - "github.com/Azure/go-autorest/logger" -) - -const ( - // DefaultPollingDelay is a reasonable delay between polling requests. - DefaultPollingDelay = 30 * time.Second - - // DefaultPollingDuration is a reasonable total polling duration. - DefaultPollingDuration = 15 * time.Minute - - // DefaultRetryAttempts is number of attempts for retry status codes (5xx). - DefaultRetryAttempts = 3 - - // DefaultRetryDuration is the duration to wait between retries. - DefaultRetryDuration = 30 * time.Second -) - -var ( - // StatusCodesForRetry are a defined group of status code for which the client will retry - StatusCodesForRetry = []int{ - http.StatusRequestTimeout, // 408 - http.StatusTooManyRequests, // 429 - http.StatusInternalServerError, // 500 - http.StatusBadGateway, // 502 - http.StatusServiceUnavailable, // 503 - http.StatusGatewayTimeout, // 504 - } -) - -const ( - requestFormat = `HTTP Request Begin =================================================== -%s -===================================================== HTTP Request End -` - responseFormat = `HTTP Response Begin =================================================== -%s -===================================================== HTTP Response End -` -) - -// Response serves as the base for all responses from generated clients. It provides access to the -// last http.Response. -type Response struct { - *http.Response `json:"-"` -} - -// IsHTTPStatus returns true if the returned HTTP status code matches the provided status code. -// If there was no response (i.e. the underlying http.Response is nil) the return value is false. -func (r Response) IsHTTPStatus(statusCode int) bool { - if r.Response == nil { - return false - } - return r.Response.StatusCode == statusCode -} - -// HasHTTPStatus returns true if the returned HTTP status code matches one of the provided status codes. -// If there was no response (i.e. the underlying http.Response is nil) or not status codes are provided -// the return value is false. -func (r Response) HasHTTPStatus(statusCodes ...int) bool { - return ResponseHasStatusCode(r.Response, statusCodes...) -} - -// LoggingInspector implements request and response inspectors that log the full request and -// response to a supplied log. -type LoggingInspector struct { - Logger *log.Logger -} - -// WithInspection returns a PrepareDecorator that emits the http.Request to the supplied logger. The -// body is restored after being emitted. -// -// Note: Since it reads the entire Body, this decorator should not be used where body streaming is -// important. It is best used to trace JSON or similar body values. -func (li LoggingInspector) WithInspection() PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - var body, b bytes.Buffer - - defer r.Body.Close() - - r.Body = ioutil.NopCloser(io.TeeReader(r.Body, &body)) - if err := r.Write(&b); err != nil { - return nil, fmt.Errorf("Failed to write response: %v", err) - } - - li.Logger.Printf(requestFormat, b.String()) - - r.Body = ioutil.NopCloser(&body) - return p.Prepare(r) - }) - } -} - -// ByInspecting returns a RespondDecorator that emits the http.Response to the supplied logger. The -// body is restored after being emitted. -// -// Note: Since it reads the entire Body, this decorator should not be used where body streaming is -// important. It is best used to trace JSON or similar body values. -func (li LoggingInspector) ByInspecting() RespondDecorator { - return func(r Responder) Responder { - return ResponderFunc(func(resp *http.Response) error { - var body, b bytes.Buffer - defer resp.Body.Close() - resp.Body = ioutil.NopCloser(io.TeeReader(resp.Body, &body)) - if err := resp.Write(&b); err != nil { - return fmt.Errorf("Failed to write response: %v", err) - } - - li.Logger.Printf(responseFormat, b.String()) - - resp.Body = ioutil.NopCloser(&body) - return r.Respond(resp) - }) - } -} - -// Client is the base for autorest generated clients. It provides default, "do nothing" -// implementations of an Authorizer, RequestInspector, and ResponseInspector. It also returns the -// standard, undecorated http.Client as a default Sender. -// -// Generated clients should also use Error (see NewError and NewErrorWithError) for errors and -// return responses that compose with Response. -// -// Most customization of generated clients is best achieved by supplying a custom Authorizer, custom -// RequestInspector, and / or custom ResponseInspector. Users may log requests, implement circuit -// breakers (see https://msdn.microsoft.com/en-us/library/dn589784.aspx) or otherwise influence -// sending the request by providing a decorated Sender. -type Client struct { - Authorizer Authorizer - Sender Sender - RequestInspector PrepareDecorator - ResponseInspector RespondDecorator - - // PollingDelay sets the polling frequency used in absence of a Retry-After HTTP header - PollingDelay time.Duration - - // PollingDuration sets the maximum polling time after which an error is returned. - // Setting this to zero will use the provided context to control the duration. - PollingDuration time.Duration - - // RetryAttempts sets the total number of times the client will attempt to make an HTTP request. - // Set the value to 1 to disable retries. DO NOT set the value to less than 1. - RetryAttempts int - - // RetryDuration sets the delay duration for retries. - RetryDuration time.Duration - - // UserAgent, if not empty, will be set as the HTTP User-Agent header on all requests sent - // through the Do method. - UserAgent string - - Jar http.CookieJar - - // Set to true to skip attempted registration of resource providers (false by default). - SkipResourceProviderRegistration bool - - // SendDecorators can be used to override the default chain of SendDecorators. - // This can be used to specify things like a custom retry SendDecorator. - // Set this to an empty slice to use no SendDecorators. - SendDecorators []SendDecorator -} - -// NewClientWithUserAgent returns an instance of a Client with the UserAgent set to the passed -// string. -func NewClientWithUserAgent(ua string) Client { - return newClient(ua, tls.RenegotiateNever) -} - -// ClientOptions contains various Client configuration options. -type ClientOptions struct { - // UserAgent is an optional user-agent string to append to the default user agent. - UserAgent string - - // Renegotiation is an optional setting to control client-side TLS renegotiation. - Renegotiation tls.RenegotiationSupport -} - -// NewClientWithOptions returns an instance of a Client with the specified values. -func NewClientWithOptions(options ClientOptions) Client { - return newClient(options.UserAgent, options.Renegotiation) -} - -func newClient(ua string, renegotiation tls.RenegotiationSupport) Client { - c := Client{ - PollingDelay: DefaultPollingDelay, - PollingDuration: DefaultPollingDuration, - RetryAttempts: DefaultRetryAttempts, - RetryDuration: DefaultRetryDuration, - UserAgent: UserAgent(), - } - c.Sender = c.sender(renegotiation) - c.AddToUserAgent(ua) - return c -} - -// AddToUserAgent adds an extension to the current user agent -func (c *Client) AddToUserAgent(extension string) error { - if extension != "" { - c.UserAgent = fmt.Sprintf("%s %s", c.UserAgent, extension) - return nil - } - return fmt.Errorf("Extension was empty, User Agent stayed as %s", c.UserAgent) -} - -// Do implements the Sender interface by invoking the active Sender after applying authorization. -// If Sender is not set, it uses a new instance of http.Client. In both cases it will, if UserAgent -// is set, apply set the User-Agent header. -func (c Client) Do(r *http.Request) (*http.Response, error) { - if r.UserAgent() == "" { - r, _ = Prepare(r, - WithUserAgent(c.UserAgent)) - } - // NOTE: c.WithInspection() must be last in the list so that it can inspect all preceding operations - r, err := Prepare(r, - c.WithAuthorization(), - c.WithInspection()) - if err != nil { - var resp *http.Response - if detErr, ok := err.(DetailedError); ok { - // if the authorization failed (e.g. invalid credentials) there will - // be a response associated with the error, be sure to return it. - resp = detErr.Response - } - return resp, NewErrorWithError(err, "autorest/Client", "Do", nil, "Preparing request failed") - } - logger.Instance.WriteRequest(r, logger.Filter{ - Header: func(k string, v []string) (bool, []string) { - // remove the auth token from the log - if strings.EqualFold(k, "Authorization") || strings.EqualFold(k, "Ocp-Apim-Subscription-Key") { - v = []string{"**REDACTED**"} - } - return true, v - }, - }) - resp, err := SendWithSender(c.sender(tls.RenegotiateNever), r) - if resp == nil && err == nil { - err = errors.New("autorest: received nil response and error") - } - logger.Instance.WriteResponse(resp, logger.Filter{}) - Respond(resp, c.ByInspecting()) - return resp, err -} - -// sender returns the Sender to which to send requests. -func (c Client) sender(renengotiation tls.RenegotiationSupport) Sender { - if c.Sender == nil { - return sender(renengotiation) - } - return c.Sender -} - -// WithAuthorization is a convenience method that returns the WithAuthorization PrepareDecorator -// from the current Authorizer. If not Authorizer is set, it uses the NullAuthorizer. -func (c Client) WithAuthorization() PrepareDecorator { - return c.authorizer().WithAuthorization() -} - -// authorizer returns the Authorizer to use. -func (c Client) authorizer() Authorizer { - if c.Authorizer == nil { - return NullAuthorizer{} - } - return c.Authorizer -} - -// WithInspection is a convenience method that passes the request to the supplied RequestInspector, -// if present, or returns the WithNothing PrepareDecorator otherwise. -func (c Client) WithInspection() PrepareDecorator { - if c.RequestInspector == nil { - return WithNothing() - } - return c.RequestInspector -} - -// ByInspecting is a convenience method that passes the response to the supplied ResponseInspector, -// if present, or returns the ByIgnoring RespondDecorator otherwise. -func (c Client) ByInspecting() RespondDecorator { - if c.ResponseInspector == nil { - return ByIgnoring() - } - return c.ResponseInspector -} - -// Send sends the provided http.Request using the client's Sender or the default sender. -// It returns the http.Response and possible error. It also accepts a, possibly empty, -// default set of SendDecorators used when sending the request. -// SendDecorators have the following precedence: -// 1. In a request's context via WithSendDecorators() -// 2. Specified on the client in SendDecorators -// 3. The default values specified in this method -func (c Client) Send(req *http.Request, decorators ...SendDecorator) (*http.Response, error) { - if c.SendDecorators != nil { - decorators = c.SendDecorators - } - inCtx := req.Context().Value(ctxSendDecorators{}) - if sd, ok := inCtx.([]SendDecorator); ok { - decorators = sd - } - return SendWithSender(c, req, decorators...) -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/LICENSE b/vendor/github.com/Azure/go-autorest/autorest/date/LICENSE deleted file mode 100644 index b9d6a27ea9..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/date/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2015 Microsoft Corporation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/date.go b/vendor/github.com/Azure/go-autorest/autorest/date/date.go deleted file mode 100644 index c457106568..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/date/date.go +++ /dev/null @@ -1,96 +0,0 @@ -/* -Package date provides time.Time derivatives that conform to the Swagger.io (https://swagger.io/) -defined date formats: Date and DateTime. Both types may, in most cases, be used in lieu of -time.Time types. And both convert to time.Time through a ToTime method. -*/ -package date - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "fmt" - "time" -) - -const ( - fullDate = "2006-01-02" - fullDateJSON = `"2006-01-02"` - dateFormat = "%04d-%02d-%02d" - jsonFormat = `"%04d-%02d-%02d"` -) - -// Date defines a type similar to time.Time but assumes a layout of RFC3339 full-date (i.e., -// 2006-01-02). -type Date struct { - time.Time -} - -// ParseDate create a new Date from the passed string. -func ParseDate(date string) (d Date, err error) { - return parseDate(date, fullDate) -} - -func parseDate(date string, format string) (Date, error) { - d, err := time.Parse(format, date) - return Date{Time: d}, err -} - -// MarshalBinary preserves the Date as a byte array conforming to RFC3339 full-date (i.e., -// 2006-01-02). -func (d Date) MarshalBinary() ([]byte, error) { - return d.MarshalText() -} - -// UnmarshalBinary reconstitutes a Date saved as a byte array conforming to RFC3339 full-date (i.e., -// 2006-01-02). -func (d *Date) UnmarshalBinary(data []byte) error { - return d.UnmarshalText(data) -} - -// MarshalJSON preserves the Date as a JSON string conforming to RFC3339 full-date (i.e., -// 2006-01-02). -func (d Date) MarshalJSON() (json []byte, err error) { - return []byte(fmt.Sprintf(jsonFormat, d.Year(), d.Month(), d.Day())), nil -} - -// UnmarshalJSON reconstitutes the Date from a JSON string conforming to RFC3339 full-date (i.e., -// 2006-01-02). -func (d *Date) UnmarshalJSON(data []byte) (err error) { - d.Time, err = time.Parse(fullDateJSON, string(data)) - return err -} - -// MarshalText preserves the Date as a byte array conforming to RFC3339 full-date (i.e., -// 2006-01-02). -func (d Date) MarshalText() (text []byte, err error) { - return []byte(fmt.Sprintf(dateFormat, d.Year(), d.Month(), d.Day())), nil -} - -// UnmarshalText reconstitutes a Date saved as a byte array conforming to RFC3339 full-date (i.e., -// 2006-01-02). -func (d *Date) UnmarshalText(data []byte) (err error) { - d.Time, err = time.Parse(fullDate, string(data)) - return err -} - -// String returns the Date formatted as an RFC3339 full-date string (i.e., 2006-01-02). -func (d Date) String() string { - return fmt.Sprintf(dateFormat, d.Year(), d.Month(), d.Day()) -} - -// ToTime returns a Date as a time.Time -func (d Date) ToTime() time.Time { - return d.Time -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/go_mod_tidy_hack.go b/vendor/github.com/Azure/go-autorest/autorest/date/go_mod_tidy_hack.go deleted file mode 100644 index 4e05432071..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/date/go_mod_tidy_hack.go +++ /dev/null @@ -1,24 +0,0 @@ -// +build modhack - -package date - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file, and the github.com/Azure/go-autorest import, won't actually become part of -// the resultant binary. - -// Necessary for safely adding multi-module repo. -// See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository -import _ "github.com/Azure/go-autorest" diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/time.go b/vendor/github.com/Azure/go-autorest/autorest/date/time.go deleted file mode 100644 index b453fad049..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/date/time.go +++ /dev/null @@ -1,103 +0,0 @@ -package date - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "regexp" - "time" -) - -// Azure reports time in UTC but it doesn't include the 'Z' time zone suffix in some cases. -const ( - azureUtcFormatJSON = `"2006-01-02T15:04:05.999999999"` - azureUtcFormat = "2006-01-02T15:04:05.999999999" - rfc3339JSON = `"` + time.RFC3339Nano + `"` - rfc3339 = time.RFC3339Nano - tzOffsetRegex = `(Z|z|\+|-)(\d+:\d+)*"*$` -) - -// Time defines a type similar to time.Time but assumes a layout of RFC3339 date-time (i.e., -// 2006-01-02T15:04:05Z). -type Time struct { - time.Time -} - -// MarshalBinary preserves the Time as a byte array conforming to RFC3339 date-time (i.e., -// 2006-01-02T15:04:05Z). -func (t Time) MarshalBinary() ([]byte, error) { - return t.Time.MarshalText() -} - -// UnmarshalBinary reconstitutes a Time saved as a byte array conforming to RFC3339 date-time -// (i.e., 2006-01-02T15:04:05Z). -func (t *Time) UnmarshalBinary(data []byte) error { - return t.UnmarshalText(data) -} - -// MarshalJSON preserves the Time as a JSON string conforming to RFC3339 date-time (i.e., -// 2006-01-02T15:04:05Z). -func (t Time) MarshalJSON() (json []byte, err error) { - return t.Time.MarshalJSON() -} - -// UnmarshalJSON reconstitutes the Time from a JSON string conforming to RFC3339 date-time -// (i.e., 2006-01-02T15:04:05Z). -func (t *Time) UnmarshalJSON(data []byte) (err error) { - timeFormat := azureUtcFormatJSON - match, err := regexp.Match(tzOffsetRegex, data) - if err != nil { - return err - } else if match { - timeFormat = rfc3339JSON - } - t.Time, err = ParseTime(timeFormat, string(data)) - return err -} - -// MarshalText preserves the Time as a byte array conforming to RFC3339 date-time (i.e., -// 2006-01-02T15:04:05Z). -func (t Time) MarshalText() (text []byte, err error) { - return t.Time.MarshalText() -} - -// UnmarshalText reconstitutes a Time saved as a byte array conforming to RFC3339 date-time -// (i.e., 2006-01-02T15:04:05Z). -func (t *Time) UnmarshalText(data []byte) (err error) { - timeFormat := azureUtcFormat - match, err := regexp.Match(tzOffsetRegex, data) - if err != nil { - return err - } else if match { - timeFormat = rfc3339 - } - t.Time, err = ParseTime(timeFormat, string(data)) - return err -} - -// String returns the Time formatted as an RFC3339 date-time string (i.e., -// 2006-01-02T15:04:05Z). -func (t Time) String() string { - // Note: time.Time.String does not return an RFC3339 compliant string, time.Time.MarshalText does. - b, err := t.MarshalText() - if err != nil { - return "" - } - return string(b) -} - -// ToTime returns a Time as a time.Time -func (t Time) ToTime() time.Time { - return t.Time -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/timerfc1123.go b/vendor/github.com/Azure/go-autorest/autorest/date/timerfc1123.go deleted file mode 100644 index 48fb39ba9b..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/date/timerfc1123.go +++ /dev/null @@ -1,100 +0,0 @@ -package date - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "errors" - "time" -) - -const ( - rfc1123JSON = `"` + time.RFC1123 + `"` - rfc1123 = time.RFC1123 -) - -// TimeRFC1123 defines a type similar to time.Time but assumes a layout of RFC1123 date-time (i.e., -// Mon, 02 Jan 2006 15:04:05 MST). -type TimeRFC1123 struct { - time.Time -} - -// UnmarshalJSON reconstitutes the Time from a JSON string conforming to RFC1123 date-time -// (i.e., Mon, 02 Jan 2006 15:04:05 MST). -func (t *TimeRFC1123) UnmarshalJSON(data []byte) (err error) { - t.Time, err = ParseTime(rfc1123JSON, string(data)) - if err != nil { - return err - } - return nil -} - -// MarshalJSON preserves the Time as a JSON string conforming to RFC1123 date-time (i.e., -// Mon, 02 Jan 2006 15:04:05 MST). -func (t TimeRFC1123) MarshalJSON() ([]byte, error) { - if y := t.Year(); y < 0 || y >= 10000 { - return nil, errors.New("Time.MarshalJSON: year outside of range [0,9999]") - } - b := []byte(t.Format(rfc1123JSON)) - return b, nil -} - -// MarshalText preserves the Time as a byte array conforming to RFC1123 date-time (i.e., -// Mon, 02 Jan 2006 15:04:05 MST). -func (t TimeRFC1123) MarshalText() ([]byte, error) { - if y := t.Year(); y < 0 || y >= 10000 { - return nil, errors.New("Time.MarshalText: year outside of range [0,9999]") - } - - b := []byte(t.Format(rfc1123)) - return b, nil -} - -// UnmarshalText reconstitutes a Time saved as a byte array conforming to RFC1123 date-time -// (i.e., Mon, 02 Jan 2006 15:04:05 MST). -func (t *TimeRFC1123) UnmarshalText(data []byte) (err error) { - t.Time, err = ParseTime(rfc1123, string(data)) - if err != nil { - return err - } - return nil -} - -// MarshalBinary preserves the Time as a byte array conforming to RFC1123 date-time (i.e., -// Mon, 02 Jan 2006 15:04:05 MST). -func (t TimeRFC1123) MarshalBinary() ([]byte, error) { - return t.MarshalText() -} - -// UnmarshalBinary reconstitutes a Time saved as a byte array conforming to RFC1123 date-time -// (i.e., Mon, 02 Jan 2006 15:04:05 MST). -func (t *TimeRFC1123) UnmarshalBinary(data []byte) error { - return t.UnmarshalText(data) -} - -// ToTime returns a Time as a time.Time -func (t TimeRFC1123) ToTime() time.Time { - return t.Time -} - -// String returns the Time formatted as an RFC1123 date-time string (i.e., -// Mon, 02 Jan 2006 15:04:05 MST). -func (t TimeRFC1123) String() string { - // Note: time.Time.String does not return an RFC1123 compliant string, time.Time.MarshalText does. - b, err := t.MarshalText() - if err != nil { - return "" - } - return string(b) -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/unixtime.go b/vendor/github.com/Azure/go-autorest/autorest/date/unixtime.go deleted file mode 100644 index 7073959b2a..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/date/unixtime.go +++ /dev/null @@ -1,123 +0,0 @@ -package date - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "encoding/binary" - "encoding/json" - "time" -) - -// unixEpoch is the moment in time that should be treated as timestamp 0. -var unixEpoch = time.Date(1970, time.January, 1, 0, 0, 0, 0, time.UTC) - -// UnixTime marshals and unmarshals a time that is represented as the number -// of seconds (ignoring skip-seconds) since the Unix Epoch. -type UnixTime time.Time - -// Duration returns the time as a Duration since the UnixEpoch. -func (t UnixTime) Duration() time.Duration { - return time.Time(t).Sub(unixEpoch) -} - -// NewUnixTimeFromSeconds creates a UnixTime as a number of seconds from the UnixEpoch. -func NewUnixTimeFromSeconds(seconds float64) UnixTime { - return NewUnixTimeFromDuration(time.Duration(seconds * float64(time.Second))) -} - -// NewUnixTimeFromNanoseconds creates a UnixTime as a number of nanoseconds from the UnixEpoch. -func NewUnixTimeFromNanoseconds(nanoseconds int64) UnixTime { - return NewUnixTimeFromDuration(time.Duration(nanoseconds)) -} - -// NewUnixTimeFromDuration creates a UnixTime as a duration of time since the UnixEpoch. -func NewUnixTimeFromDuration(dur time.Duration) UnixTime { - return UnixTime(unixEpoch.Add(dur)) -} - -// UnixEpoch retreives the moment considered the Unix Epoch. I.e. The time represented by '0' -func UnixEpoch() time.Time { - return unixEpoch -} - -// MarshalJSON preserves the UnixTime as a JSON number conforming to Unix Timestamp requirements. -// (i.e. the number of seconds since midnight January 1st, 1970 not considering leap seconds.) -func (t UnixTime) MarshalJSON() ([]byte, error) { - buffer := &bytes.Buffer{} - enc := json.NewEncoder(buffer) - err := enc.Encode(float64(time.Time(t).UnixNano()) / 1e9) - if err != nil { - return nil, err - } - return buffer.Bytes(), nil -} - -// UnmarshalJSON reconstitures a UnixTime saved as a JSON number of the number of seconds since -// midnight January 1st, 1970. -func (t *UnixTime) UnmarshalJSON(text []byte) error { - dec := json.NewDecoder(bytes.NewReader(text)) - - var secondsSinceEpoch float64 - if err := dec.Decode(&secondsSinceEpoch); err != nil { - return err - } - - *t = NewUnixTimeFromSeconds(secondsSinceEpoch) - - return nil -} - -// MarshalText stores the number of seconds since the Unix Epoch as a textual floating point number. -func (t UnixTime) MarshalText() ([]byte, error) { - cast := time.Time(t) - return cast.MarshalText() -} - -// UnmarshalText populates a UnixTime with a value stored textually as a floating point number of seconds since the Unix Epoch. -func (t *UnixTime) UnmarshalText(raw []byte) error { - var unmarshaled time.Time - - if err := unmarshaled.UnmarshalText(raw); err != nil { - return err - } - - *t = UnixTime(unmarshaled) - return nil -} - -// MarshalBinary converts a UnixTime into a binary.LittleEndian float64 of nanoseconds since the epoch. -func (t UnixTime) MarshalBinary() ([]byte, error) { - buf := &bytes.Buffer{} - - payload := int64(t.Duration()) - - if err := binary.Write(buf, binary.LittleEndian, &payload); err != nil { - return nil, err - } - - return buf.Bytes(), nil -} - -// UnmarshalBinary converts a from a binary.LittleEndian float64 of nanoseconds since the epoch into a UnixTime. -func (t *UnixTime) UnmarshalBinary(raw []byte) error { - var nanosecondsSinceEpoch int64 - - if err := binary.Read(bytes.NewReader(raw), binary.LittleEndian, &nanosecondsSinceEpoch); err != nil { - return err - } - *t = NewUnixTimeFromNanoseconds(nanosecondsSinceEpoch) - return nil -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/date/utility.go b/vendor/github.com/Azure/go-autorest/autorest/date/utility.go deleted file mode 100644 index 12addf0ebb..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/date/utility.go +++ /dev/null @@ -1,25 +0,0 @@ -package date - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "strings" - "time" -) - -// ParseTime to parse Time string to specified format. -func ParseTime(format string, t string) (d time.Time, err error) { - return time.Parse(format, strings.ToUpper(t)) -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/error.go b/vendor/github.com/Azure/go-autorest/autorest/error.go deleted file mode 100644 index 35098eda8e..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/error.go +++ /dev/null @@ -1,103 +0,0 @@ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "fmt" - "net/http" -) - -const ( - // UndefinedStatusCode is used when HTTP status code is not available for an error. - UndefinedStatusCode = 0 -) - -// DetailedError encloses a error with details of the package, method, and associated HTTP -// status code (if any). -type DetailedError struct { - Original error - - // PackageType is the package type of the object emitting the error. For types, the value - // matches that produced the the '%T' format specifier of the fmt package. For other elements, - // such as functions, it is just the package name (e.g., "autorest"). - PackageType string - - // Method is the name of the method raising the error. - Method string - - // StatusCode is the HTTP Response StatusCode (if non-zero) that led to the error. - StatusCode interface{} - - // Message is the error message. - Message string - - // Service Error is the response body of failed API in bytes - ServiceError []byte - - // Response is the response object that was returned during failure if applicable. - Response *http.Response -} - -// NewError creates a new Error conforming object from the passed packageType, method, and -// message. message is treated as a format string to which the optional args apply. -func NewError(packageType string, method string, message string, args ...interface{}) DetailedError { - return NewErrorWithError(nil, packageType, method, nil, message, args...) -} - -// NewErrorWithResponse creates a new Error conforming object from the passed -// packageType, method, statusCode of the given resp (UndefinedStatusCode if -// resp is nil), and message. message is treated as a format string to which the -// optional args apply. -func NewErrorWithResponse(packageType string, method string, resp *http.Response, message string, args ...interface{}) DetailedError { - return NewErrorWithError(nil, packageType, method, resp, message, args...) -} - -// NewErrorWithError creates a new Error conforming object from the -// passed packageType, method, statusCode of the given resp (UndefinedStatusCode -// if resp is nil), message, and original error. message is treated as a format -// string to which the optional args apply. -func NewErrorWithError(original error, packageType string, method string, resp *http.Response, message string, args ...interface{}) DetailedError { - if v, ok := original.(DetailedError); ok { - return v - } - - statusCode := UndefinedStatusCode - if resp != nil { - statusCode = resp.StatusCode - } - - return DetailedError{ - Original: original, - PackageType: packageType, - Method: method, - StatusCode: statusCode, - Message: fmt.Sprintf(message, args...), - Response: resp, - } -} - -// Error returns a formatted containing all available details (i.e., PackageType, Method, -// StatusCode, Message, and original error (if any)). -func (e DetailedError) Error() string { - if e.Original == nil { - return fmt.Sprintf("%s#%s: %s: StatusCode=%d", e.PackageType, e.Method, e.Message, e.StatusCode) - } - return fmt.Sprintf("%s#%s: %s: StatusCode=%d -- Original Error: %v", e.PackageType, e.Method, e.Message, e.StatusCode, e.Original) -} - -// Unwrap returns the original error. -func (e DetailedError) Unwrap() error { - return e.Original -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/go_mod_tidy_hack.go b/vendor/github.com/Azure/go-autorest/autorest/go_mod_tidy_hack.go deleted file mode 100644 index 792f82d4b6..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/go_mod_tidy_hack.go +++ /dev/null @@ -1,25 +0,0 @@ -//go:build modhack -// +build modhack - -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file, and the github.com/Azure/go-autorest import, won't actually become part of -// the resultant binary. - -// Necessary for safely adding multi-module repo. -// See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository -import _ "github.com/Azure/go-autorest" diff --git a/vendor/github.com/Azure/go-autorest/autorest/preparer.go b/vendor/github.com/Azure/go-autorest/autorest/preparer.go deleted file mode 100644 index 121a66fa88..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/preparer.go +++ /dev/null @@ -1,549 +0,0 @@ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "context" - "encoding/json" - "encoding/xml" - "fmt" - "io" - "io/ioutil" - "mime/multipart" - "net/http" - "net/url" - "strings" -) - -const ( - mimeTypeJSON = "application/json" - mimeTypeOctetStream = "application/octet-stream" - mimeTypeFormPost = "application/x-www-form-urlencoded" - - headerAuthorization = "Authorization" - headerAuxAuthorization = "x-ms-authorization-auxiliary" - headerContentType = "Content-Type" - headerUserAgent = "User-Agent" -) - -// used as a key type in context.WithValue() -type ctxPrepareDecorators struct{} - -// WithPrepareDecorators adds the specified PrepareDecorators to the provided context. -// If no PrepareDecorators are provided the context is unchanged. -func WithPrepareDecorators(ctx context.Context, prepareDecorator []PrepareDecorator) context.Context { - if len(prepareDecorator) == 0 { - return ctx - } - return context.WithValue(ctx, ctxPrepareDecorators{}, prepareDecorator) -} - -// GetPrepareDecorators returns the PrepareDecorators in the provided context or the provided default PrepareDecorators. -func GetPrepareDecorators(ctx context.Context, defaultPrepareDecorators ...PrepareDecorator) []PrepareDecorator { - inCtx := ctx.Value(ctxPrepareDecorators{}) - if pd, ok := inCtx.([]PrepareDecorator); ok { - return pd - } - return defaultPrepareDecorators -} - -// Preparer is the interface that wraps the Prepare method. -// -// Prepare accepts and possibly modifies an http.Request (e.g., adding Headers). Implementations -// must ensure to not share or hold per-invocation state since Preparers may be shared and re-used. -type Preparer interface { - Prepare(*http.Request) (*http.Request, error) -} - -// PreparerFunc is a method that implements the Preparer interface. -type PreparerFunc func(*http.Request) (*http.Request, error) - -// Prepare implements the Preparer interface on PreparerFunc. -func (pf PreparerFunc) Prepare(r *http.Request) (*http.Request, error) { - return pf(r) -} - -// PrepareDecorator takes and possibly decorates, by wrapping, a Preparer. Decorators may affect the -// http.Request and pass it along or, first, pass the http.Request along then affect the result. -type PrepareDecorator func(Preparer) Preparer - -// CreatePreparer creates, decorates, and returns a Preparer. -// Without decorators, the returned Preparer returns the passed http.Request unmodified. -// Preparers are safe to share and re-use. -func CreatePreparer(decorators ...PrepareDecorator) Preparer { - return DecoratePreparer( - Preparer(PreparerFunc(func(r *http.Request) (*http.Request, error) { return r, nil })), - decorators...) -} - -// DecoratePreparer accepts a Preparer and a, possibly empty, set of PrepareDecorators, which it -// applies to the Preparer. Decorators are applied in the order received, but their affect upon the -// request depends on whether they are a pre-decorator (change the http.Request and then pass it -// along) or a post-decorator (pass the http.Request along and alter it on return). -func DecoratePreparer(p Preparer, decorators ...PrepareDecorator) Preparer { - for _, decorate := range decorators { - p = decorate(p) - } - return p -} - -// Prepare accepts an http.Request and a, possibly empty, set of PrepareDecorators. -// It creates a Preparer from the decorators which it then applies to the passed http.Request. -func Prepare(r *http.Request, decorators ...PrepareDecorator) (*http.Request, error) { - if r == nil { - return nil, NewError("autorest", "Prepare", "Invoked without an http.Request") - } - return CreatePreparer(decorators...).Prepare(r) -} - -// WithNothing returns a "do nothing" PrepareDecorator that makes no changes to the passed -// http.Request. -func WithNothing() PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - return p.Prepare(r) - }) - } -} - -// WithHeader returns a PrepareDecorator that sets the specified HTTP header of the http.Request to -// the passed value. It canonicalizes the passed header name (via http.CanonicalHeaderKey) before -// adding the header. -func WithHeader(header string, value string) PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - setHeader(r, http.CanonicalHeaderKey(header), value) - } - return r, err - }) - } -} - -// WithHeaders returns a PrepareDecorator that sets the specified HTTP headers of the http.Request to -// the passed value. It canonicalizes the passed headers name (via http.CanonicalHeaderKey) before -// adding them. -func WithHeaders(headers map[string]interface{}) PrepareDecorator { - h := ensureValueStrings(headers) - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - if r.Header == nil { - r.Header = make(http.Header) - } - - for name, value := range h { - r.Header.Set(http.CanonicalHeaderKey(name), value) - } - } - return r, err - }) - } -} - -// WithBearerAuthorization returns a PrepareDecorator that adds an HTTP Authorization header whose -// value is "Bearer " followed by the supplied token. -func WithBearerAuthorization(token string) PrepareDecorator { - return WithHeader(headerAuthorization, fmt.Sprintf("Bearer %s", token)) -} - -// AsContentType returns a PrepareDecorator that adds an HTTP Content-Type header whose value -// is the passed contentType. -func AsContentType(contentType string) PrepareDecorator { - return WithHeader(headerContentType, contentType) -} - -// WithUserAgent returns a PrepareDecorator that adds an HTTP User-Agent header whose value is the -// passed string. -func WithUserAgent(ua string) PrepareDecorator { - return WithHeader(headerUserAgent, ua) -} - -// AsFormURLEncoded returns a PrepareDecorator that adds an HTTP Content-Type header whose value is -// "application/x-www-form-urlencoded". -func AsFormURLEncoded() PrepareDecorator { - return AsContentType(mimeTypeFormPost) -} - -// AsJSON returns a PrepareDecorator that adds an HTTP Content-Type header whose value is -// "application/json". -func AsJSON() PrepareDecorator { - return AsContentType(mimeTypeJSON) -} - -// AsOctetStream returns a PrepareDecorator that adds the "application/octet-stream" Content-Type header. -func AsOctetStream() PrepareDecorator { - return AsContentType(mimeTypeOctetStream) -} - -// WithMethod returns a PrepareDecorator that sets the HTTP method of the passed request. The -// decorator does not validate that the passed method string is a known HTTP method. -func WithMethod(method string) PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r.Method = method - return p.Prepare(r) - }) - } -} - -// AsDelete returns a PrepareDecorator that sets the HTTP method to DELETE. -func AsDelete() PrepareDecorator { return WithMethod("DELETE") } - -// AsGet returns a PrepareDecorator that sets the HTTP method to GET. -func AsGet() PrepareDecorator { return WithMethod("GET") } - -// AsHead returns a PrepareDecorator that sets the HTTP method to HEAD. -func AsHead() PrepareDecorator { return WithMethod("HEAD") } - -// AsMerge returns a PrepareDecorator that sets the HTTP method to MERGE. -func AsMerge() PrepareDecorator { return WithMethod("MERGE") } - -// AsOptions returns a PrepareDecorator that sets the HTTP method to OPTIONS. -func AsOptions() PrepareDecorator { return WithMethod("OPTIONS") } - -// AsPatch returns a PrepareDecorator that sets the HTTP method to PATCH. -func AsPatch() PrepareDecorator { return WithMethod("PATCH") } - -// AsPost returns a PrepareDecorator that sets the HTTP method to POST. -func AsPost() PrepareDecorator { return WithMethod("POST") } - -// AsPut returns a PrepareDecorator that sets the HTTP method to PUT. -func AsPut() PrepareDecorator { return WithMethod("PUT") } - -// WithBaseURL returns a PrepareDecorator that populates the http.Request with a url.URL constructed -// from the supplied baseUrl. Query parameters will be encoded as required. -func WithBaseURL(baseURL string) PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - var u *url.URL - if u, err = url.Parse(baseURL); err != nil { - return r, err - } - if u.Scheme == "" { - return r, fmt.Errorf("autorest: No scheme detected in URL %s", baseURL) - } - if u.RawQuery != "" { - // handle unencoded semicolons (ideally the server would send them already encoded) - u.RawQuery = strings.Replace(u.RawQuery, ";", "%3B", -1) - q, err := url.ParseQuery(u.RawQuery) - if err != nil { - return r, err - } - u.RawQuery = q.Encode() - } - r.URL = u - } - return r, err - }) - } -} - -// WithBytes returns a PrepareDecorator that takes a list of bytes -// which passes the bytes directly to the body -func WithBytes(input *[]byte) PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - if input == nil { - return r, fmt.Errorf("Input Bytes was nil") - } - - r.ContentLength = int64(len(*input)) - r.Body = ioutil.NopCloser(bytes.NewReader(*input)) - } - return r, err - }) - } -} - -// WithCustomBaseURL returns a PrepareDecorator that replaces brace-enclosed keys within the -// request base URL (i.e., http.Request.URL) with the corresponding values from the passed map. -func WithCustomBaseURL(baseURL string, urlParameters map[string]interface{}) PrepareDecorator { - parameters := ensureValueStrings(urlParameters) - for key, value := range parameters { - baseURL = strings.Replace(baseURL, "{"+key+"}", value, -1) - } - return WithBaseURL(baseURL) -} - -// WithFormData returns a PrepareDecoratore that "URL encodes" (e.g., bar=baz&foo=quux) into the -// http.Request body. -func WithFormData(v url.Values) PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - s := v.Encode() - - setHeader(r, http.CanonicalHeaderKey(headerContentType), mimeTypeFormPost) - r.ContentLength = int64(len(s)) - r.Body = ioutil.NopCloser(strings.NewReader(s)) - } - return r, err - }) - } -} - -// WithMultiPartFormData returns a PrepareDecoratore that "URL encodes" (e.g., bar=baz&foo=quux) form parameters -// into the http.Request body. -func WithMultiPartFormData(formDataParameters map[string]interface{}) PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - var body bytes.Buffer - writer := multipart.NewWriter(&body) - for key, value := range formDataParameters { - if rc, ok := value.(io.ReadCloser); ok { - var fd io.Writer - if fd, err = writer.CreateFormFile(key, key); err != nil { - return r, err - } - if _, err = io.Copy(fd, rc); err != nil { - return r, err - } - } else { - if err = writer.WriteField(key, ensureValueString(value)); err != nil { - return r, err - } - } - } - if err = writer.Close(); err != nil { - return r, err - } - setHeader(r, http.CanonicalHeaderKey(headerContentType), writer.FormDataContentType()) - r.Body = ioutil.NopCloser(bytes.NewReader(body.Bytes())) - r.ContentLength = int64(body.Len()) - return r, err - } - return r, err - }) - } -} - -// WithFile returns a PrepareDecorator that sends file in request body. -func WithFile(f io.ReadCloser) PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - b, err := ioutil.ReadAll(f) - if err != nil { - return r, err - } - r.Body = ioutil.NopCloser(bytes.NewReader(b)) - r.ContentLength = int64(len(b)) - } - return r, err - }) - } -} - -// WithBool returns a PrepareDecorator that encodes the passed bool into the body of the request -// and sets the Content-Length header. -func WithBool(v bool) PrepareDecorator { - return WithString(fmt.Sprintf("%v", v)) -} - -// WithFloat32 returns a PrepareDecorator that encodes the passed float32 into the body of the -// request and sets the Content-Length header. -func WithFloat32(v float32) PrepareDecorator { - return WithString(fmt.Sprintf("%v", v)) -} - -// WithFloat64 returns a PrepareDecorator that encodes the passed float64 into the body of the -// request and sets the Content-Length header. -func WithFloat64(v float64) PrepareDecorator { - return WithString(fmt.Sprintf("%v", v)) -} - -// WithInt32 returns a PrepareDecorator that encodes the passed int32 into the body of the request -// and sets the Content-Length header. -func WithInt32(v int32) PrepareDecorator { - return WithString(fmt.Sprintf("%v", v)) -} - -// WithInt64 returns a PrepareDecorator that encodes the passed int64 into the body of the request -// and sets the Content-Length header. -func WithInt64(v int64) PrepareDecorator { - return WithString(fmt.Sprintf("%v", v)) -} - -// WithString returns a PrepareDecorator that encodes the passed string into the body of the request -// and sets the Content-Length header. -func WithString(v string) PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - r.ContentLength = int64(len(v)) - r.Body = ioutil.NopCloser(strings.NewReader(v)) - } - return r, err - }) - } -} - -// WithJSON returns a PrepareDecorator that encodes the data passed as JSON into the body of the -// request and sets the Content-Length header. -func WithJSON(v interface{}) PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - b, err := json.Marshal(v) - if err == nil { - r.ContentLength = int64(len(b)) - r.Body = ioutil.NopCloser(bytes.NewReader(b)) - } - } - return r, err - }) - } -} - -// WithXML returns a PrepareDecorator that encodes the data passed as XML into the body of the -// request and sets the Content-Length header. -func WithXML(v interface{}) PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - b, err := xml.Marshal(v) - if err == nil { - // we have to tack on an XML header - withHeader := xml.Header + string(b) - bytesWithHeader := []byte(withHeader) - - r.ContentLength = int64(len(bytesWithHeader)) - setHeader(r, headerContentLength, fmt.Sprintf("%d", len(bytesWithHeader))) - r.Body = ioutil.NopCloser(bytes.NewReader(bytesWithHeader)) - } - } - return r, err - }) - } -} - -// WithPath returns a PrepareDecorator that adds the supplied path to the request URL. If the path -// is absolute (that is, it begins with a "/"), it replaces the existing path. -func WithPath(path string) PrepareDecorator { - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - if r.URL == nil { - return r, NewError("autorest", "WithPath", "Invoked with a nil URL") - } - if r.URL, err = parseURL(r.URL, path); err != nil { - return r, err - } - } - return r, err - }) - } -} - -// WithEscapedPathParameters returns a PrepareDecorator that replaces brace-enclosed keys within the -// request path (i.e., http.Request.URL.Path) with the corresponding values from the passed map. The -// values will be escaped (aka URL encoded) before insertion into the path. -func WithEscapedPathParameters(path string, pathParameters map[string]interface{}) PrepareDecorator { - parameters := escapeValueStrings(ensureValueStrings(pathParameters)) - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - if r.URL == nil { - return r, NewError("autorest", "WithEscapedPathParameters", "Invoked with a nil URL") - } - for key, value := range parameters { - path = strings.Replace(path, "{"+key+"}", value, -1) - } - if r.URL, err = parseURL(r.URL, path); err != nil { - return r, err - } - } - return r, err - }) - } -} - -// WithPathParameters returns a PrepareDecorator that replaces brace-enclosed keys within the -// request path (i.e., http.Request.URL.Path) with the corresponding values from the passed map. -func WithPathParameters(path string, pathParameters map[string]interface{}) PrepareDecorator { - parameters := ensureValueStrings(pathParameters) - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - if r.URL == nil { - return r, NewError("autorest", "WithPathParameters", "Invoked with a nil URL") - } - for key, value := range parameters { - path = strings.Replace(path, "{"+key+"}", value, -1) - } - - if r.URL, err = parseURL(r.URL, path); err != nil { - return r, err - } - } - return r, err - }) - } -} - -func parseURL(u *url.URL, path string) (*url.URL, error) { - p := strings.TrimRight(u.String(), "/") - if !strings.HasPrefix(path, "/") { - path = "/" + path - } - return url.Parse(p + path) -} - -// WithQueryParameters returns a PrepareDecorators that encodes and applies the query parameters -// given in the supplied map (i.e., key=value). -func WithQueryParameters(queryParameters map[string]interface{}) PrepareDecorator { - parameters := MapToValues(queryParameters) - return func(p Preparer) Preparer { - return PreparerFunc(func(r *http.Request) (*http.Request, error) { - r, err := p.Prepare(r) - if err == nil { - if r.URL == nil { - return r, NewError("autorest", "WithQueryParameters", "Invoked with a nil URL") - } - v := r.URL.Query() - for key, value := range parameters { - for i := range value { - d, err := url.QueryUnescape(value[i]) - if err != nil { - return r, err - } - value[i] = d - } - v[key] = value - } - r.URL.RawQuery = v.Encode() - } - return r, err - }) - } -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/responder.go b/vendor/github.com/Azure/go-autorest/autorest/responder.go deleted file mode 100644 index 349e1963a2..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/responder.go +++ /dev/null @@ -1,269 +0,0 @@ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "encoding/json" - "encoding/xml" - "fmt" - "io" - "io/ioutil" - "net/http" - "strings" -) - -// Responder is the interface that wraps the Respond method. -// -// Respond accepts and reacts to an http.Response. Implementations must ensure to not share or hold -// state since Responders may be shared and re-used. -type Responder interface { - Respond(*http.Response) error -} - -// ResponderFunc is a method that implements the Responder interface. -type ResponderFunc func(*http.Response) error - -// Respond implements the Responder interface on ResponderFunc. -func (rf ResponderFunc) Respond(r *http.Response) error { - return rf(r) -} - -// RespondDecorator takes and possibly decorates, by wrapping, a Responder. Decorators may react to -// the http.Response and pass it along or, first, pass the http.Response along then react. -type RespondDecorator func(Responder) Responder - -// CreateResponder creates, decorates, and returns a Responder. Without decorators, the returned -// Responder returns the passed http.Response unmodified. Responders may or may not be safe to share -// and re-used: It depends on the applied decorators. For example, a standard decorator that closes -// the response body is fine to share whereas a decorator that reads the body into a passed struct -// is not. -// -// To prevent memory leaks, ensure that at least one Responder closes the response body. -func CreateResponder(decorators ...RespondDecorator) Responder { - return DecorateResponder( - Responder(ResponderFunc(func(r *http.Response) error { return nil })), - decorators...) -} - -// DecorateResponder accepts a Responder and a, possibly empty, set of RespondDecorators, which it -// applies to the Responder. Decorators are applied in the order received, but their affect upon the -// request depends on whether they are a pre-decorator (react to the http.Response and then pass it -// along) or a post-decorator (pass the http.Response along and then react). -func DecorateResponder(r Responder, decorators ...RespondDecorator) Responder { - for _, decorate := range decorators { - r = decorate(r) - } - return r -} - -// Respond accepts an http.Response and a, possibly empty, set of RespondDecorators. -// It creates a Responder from the decorators it then applies to the passed http.Response. -func Respond(r *http.Response, decorators ...RespondDecorator) error { - if r == nil { - return nil - } - return CreateResponder(decorators...).Respond(r) -} - -// ByIgnoring returns a RespondDecorator that ignores the passed http.Response passing it unexamined -// to the next RespondDecorator. -func ByIgnoring() RespondDecorator { - return func(r Responder) Responder { - return ResponderFunc(func(resp *http.Response) error { - return r.Respond(resp) - }) - } -} - -// ByCopying copies the contents of the http.Response Body into the passed bytes.Buffer as -// the Body is read. -func ByCopying(b *bytes.Buffer) RespondDecorator { - return func(r Responder) Responder { - return ResponderFunc(func(resp *http.Response) error { - err := r.Respond(resp) - if err == nil && resp != nil && resp.Body != nil { - resp.Body = TeeReadCloser(resp.Body, b) - } - return err - }) - } -} - -// ByDiscardingBody returns a RespondDecorator that first invokes the passed Responder after which -// it copies the remaining bytes (if any) in the response body to ioutil.Discard. Since the passed -// Responder is invoked prior to discarding the response body, the decorator may occur anywhere -// within the set. -func ByDiscardingBody() RespondDecorator { - return func(r Responder) Responder { - return ResponderFunc(func(resp *http.Response) error { - err := r.Respond(resp) - if err == nil && resp != nil && resp.Body != nil { - if _, err := io.Copy(ioutil.Discard, resp.Body); err != nil { - return fmt.Errorf("Error discarding the response body: %v", err) - } - } - return err - }) - } -} - -// ByClosing returns a RespondDecorator that first invokes the passed Responder after which it -// closes the response body. Since the passed Responder is invoked prior to closing the response -// body, the decorator may occur anywhere within the set. -func ByClosing() RespondDecorator { - return func(r Responder) Responder { - return ResponderFunc(func(resp *http.Response) error { - err := r.Respond(resp) - if resp != nil && resp.Body != nil { - if err := resp.Body.Close(); err != nil { - return fmt.Errorf("Error closing the response body: %v", err) - } - } - return err - }) - } -} - -// ByClosingIfError returns a RespondDecorator that first invokes the passed Responder after which -// it closes the response if the passed Responder returns an error and the response body exists. -func ByClosingIfError() RespondDecorator { - return func(r Responder) Responder { - return ResponderFunc(func(resp *http.Response) error { - err := r.Respond(resp) - if err != nil && resp != nil && resp.Body != nil { - if err := resp.Body.Close(); err != nil { - return fmt.Errorf("Error closing the response body: %v", err) - } - } - return err - }) - } -} - -// ByUnmarshallingBytes returns a RespondDecorator that copies the Bytes returned in the -// response Body into the value pointed to by v. -func ByUnmarshallingBytes(v *[]byte) RespondDecorator { - return func(r Responder) Responder { - return ResponderFunc(func(resp *http.Response) error { - err := r.Respond(resp) - if err == nil { - bytes, errInner := ioutil.ReadAll(resp.Body) - if errInner != nil { - err = fmt.Errorf("Error occurred reading http.Response#Body - Error = '%v'", errInner) - } else { - *v = bytes - } - } - return err - }) - } -} - -// ByUnmarshallingJSON returns a RespondDecorator that decodes a JSON document returned in the -// response Body into the value pointed to by v. -func ByUnmarshallingJSON(v interface{}) RespondDecorator { - return func(r Responder) Responder { - return ResponderFunc(func(resp *http.Response) error { - err := r.Respond(resp) - if err == nil { - b, errInner := ioutil.ReadAll(resp.Body) - // Some responses might include a BOM, remove for successful unmarshalling - b = bytes.TrimPrefix(b, []byte("\xef\xbb\xbf")) - if errInner != nil { - err = fmt.Errorf("Error occurred reading http.Response#Body - Error = '%v'", errInner) - } else if len(strings.Trim(string(b), " ")) > 0 { - errInner = json.Unmarshal(b, v) - if errInner != nil { - err = fmt.Errorf("Error occurred unmarshalling JSON - Error = '%v' JSON = '%s'", errInner, string(b)) - } - } - } - return err - }) - } -} - -// ByUnmarshallingXML returns a RespondDecorator that decodes a XML document returned in the -// response Body into the value pointed to by v. -func ByUnmarshallingXML(v interface{}) RespondDecorator { - return func(r Responder) Responder { - return ResponderFunc(func(resp *http.Response) error { - err := r.Respond(resp) - if err == nil { - b, errInner := ioutil.ReadAll(resp.Body) - if errInner != nil { - err = fmt.Errorf("Error occurred reading http.Response#Body - Error = '%v'", errInner) - } else { - errInner = xml.Unmarshal(b, v) - if errInner != nil { - err = fmt.Errorf("Error occurred unmarshalling Xml - Error = '%v' Xml = '%s'", errInner, string(b)) - } - } - } - return err - }) - } -} - -// WithErrorUnlessStatusCode returns a RespondDecorator that emits an error unless the response -// StatusCode is among the set passed. On error, response body is fully read into a buffer and -// presented in the returned error, as well as in the response body. -func WithErrorUnlessStatusCode(codes ...int) RespondDecorator { - return func(r Responder) Responder { - return ResponderFunc(func(resp *http.Response) error { - err := r.Respond(resp) - if err == nil && !ResponseHasStatusCode(resp, codes...) { - derr := NewErrorWithResponse("autorest", "WithErrorUnlessStatusCode", resp, "%v %v failed with %s", - resp.Request.Method, - resp.Request.URL, - resp.Status) - if resp.Body != nil { - defer resp.Body.Close() - b, _ := ioutil.ReadAll(resp.Body) - derr.ServiceError = b - resp.Body = ioutil.NopCloser(bytes.NewReader(b)) - } - err = derr - } - return err - }) - } -} - -// WithErrorUnlessOK returns a RespondDecorator that emits an error if the response StatusCode is -// anything other than HTTP 200. -func WithErrorUnlessOK() RespondDecorator { - return WithErrorUnlessStatusCode(http.StatusOK) -} - -// ExtractHeader extracts all values of the specified header from the http.Response. It returns an -// empty string slice if the passed http.Response is nil or the header does not exist. -func ExtractHeader(header string, resp *http.Response) []string { - if resp != nil && resp.Header != nil { - return resp.Header[http.CanonicalHeaderKey(header)] - } - return nil -} - -// ExtractHeaderValue extracts the first value of the specified header from the http.Response. It -// returns an empty string if the passed http.Response is nil or the header does not exist. -func ExtractHeaderValue(header string, resp *http.Response) string { - h := ExtractHeader(header, resp) - if len(h) > 0 { - return h[0] - } - return "" -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/retriablerequest.go b/vendor/github.com/Azure/go-autorest/autorest/retriablerequest.go deleted file mode 100644 index fa11dbed79..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/retriablerequest.go +++ /dev/null @@ -1,52 +0,0 @@ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "io" - "io/ioutil" - "net/http" -) - -// NewRetriableRequest returns a wrapper around an HTTP request that support retry logic. -func NewRetriableRequest(req *http.Request) *RetriableRequest { - return &RetriableRequest{req: req} -} - -// Request returns the wrapped HTTP request. -func (rr *RetriableRequest) Request() *http.Request { - return rr.req -} - -func (rr *RetriableRequest) prepareFromByteReader() (err error) { - // fall back to making a copy (only do this once) - b := []byte{} - if rr.req.ContentLength > 0 { - b = make([]byte, rr.req.ContentLength) - _, err = io.ReadFull(rr.req.Body, b) - if err != nil { - return err - } - } else { - b, err = ioutil.ReadAll(rr.req.Body) - if err != nil { - return err - } - } - rr.br = bytes.NewReader(b) - rr.req.Body = ioutil.NopCloser(rr.br) - return err -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.7.go b/vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.7.go deleted file mode 100644 index 4c87030e81..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.7.go +++ /dev/null @@ -1,55 +0,0 @@ -//go:build !go1.8 -// +build !go1.8 - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package autorest - -import ( - "bytes" - "io/ioutil" - "net/http" -) - -// RetriableRequest provides facilities for retrying an HTTP request. -type RetriableRequest struct { - req *http.Request - br *bytes.Reader -} - -// Prepare signals that the request is about to be sent. -func (rr *RetriableRequest) Prepare() (err error) { - // preserve the request body; this is to support retry logic as - // the underlying transport will always close the reqeust body - if rr.req.Body != nil { - if rr.br != nil { - _, err = rr.br.Seek(0, 0 /*io.SeekStart*/) - rr.req.Body = ioutil.NopCloser(rr.br) - } - if err != nil { - return err - } - if rr.br == nil { - // fall back to making a copy (only do this once) - err = rr.prepareFromByteReader() - } - } - return err -} - -func removeRequestBody(req *http.Request) { - req.Body = nil - req.ContentLength = 0 -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.8.go b/vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.8.go deleted file mode 100644 index 05847c08ba..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/retriablerequest_1.8.go +++ /dev/null @@ -1,67 +0,0 @@ -//go:build go1.8 -// +build go1.8 - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package autorest - -import ( - "bytes" - "io" - "io/ioutil" - "net/http" -) - -// RetriableRequest provides facilities for retrying an HTTP request. -type RetriableRequest struct { - req *http.Request - rc io.ReadCloser - br *bytes.Reader -} - -// Prepare signals that the request is about to be sent. -func (rr *RetriableRequest) Prepare() (err error) { - // preserve the request body; this is to support retry logic as - // the underlying transport will always close the reqeust body - if rr.req.Body != nil { - if rr.rc != nil { - rr.req.Body = rr.rc - } else if rr.br != nil { - _, err = rr.br.Seek(0, io.SeekStart) - rr.req.Body = ioutil.NopCloser(rr.br) - } - if err != nil { - return err - } - if rr.req.GetBody != nil { - // this will allow us to preserve the body without having to - // make a copy. note we need to do this on each iteration - rr.rc, err = rr.req.GetBody() - if err != nil { - return err - } - } else if rr.br == nil { - // fall back to making a copy (only do this once) - err = rr.prepareFromByteReader() - } - } - return err -} - -func removeRequestBody(req *http.Request) { - req.Body = nil - req.GetBody = nil - req.ContentLength = 0 -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/sender.go b/vendor/github.com/Azure/go-autorest/autorest/sender.go deleted file mode 100644 index 118de81411..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/sender.go +++ /dev/null @@ -1,458 +0,0 @@ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "context" - "crypto/tls" - "fmt" - "log" - "math" - "net" - "net/http" - "net/http/cookiejar" - "strconv" - "sync" - "time" - - "github.com/Azure/go-autorest/logger" - "github.com/Azure/go-autorest/tracing" -) - -// there is one sender per TLS renegotiation type, i.e. count of tls.RenegotiationSupport enums -const defaultSendersCount = 3 - -type defaultSender struct { - sender Sender - init *sync.Once -} - -// each type of sender will be created on demand in sender() -var defaultSenders [defaultSendersCount]defaultSender - -func init() { - for i := 0; i < defaultSendersCount; i++ { - defaultSenders[i].init = &sync.Once{} - } -} - -// used as a key type in context.WithValue() -type ctxSendDecorators struct{} - -// WithSendDecorators adds the specified SendDecorators to the provided context. -// If no SendDecorators are provided the context is unchanged. -func WithSendDecorators(ctx context.Context, sendDecorator []SendDecorator) context.Context { - if len(sendDecorator) == 0 { - return ctx - } - return context.WithValue(ctx, ctxSendDecorators{}, sendDecorator) -} - -// GetSendDecorators returns the SendDecorators in the provided context or the provided default SendDecorators. -func GetSendDecorators(ctx context.Context, defaultSendDecorators ...SendDecorator) []SendDecorator { - inCtx := ctx.Value(ctxSendDecorators{}) - if sd, ok := inCtx.([]SendDecorator); ok { - return sd - } - return defaultSendDecorators -} - -// Sender is the interface that wraps the Do method to send HTTP requests. -// -// The standard http.Client conforms to this interface. -type Sender interface { - Do(*http.Request) (*http.Response, error) -} - -// SenderFunc is a method that implements the Sender interface. -type SenderFunc func(*http.Request) (*http.Response, error) - -// Do implements the Sender interface on SenderFunc. -func (sf SenderFunc) Do(r *http.Request) (*http.Response, error) { - return sf(r) -} - -// SendDecorator takes and possibly decorates, by wrapping, a Sender. Decorators may affect the -// http.Request and pass it along or, first, pass the http.Request along then react to the -// http.Response result. -type SendDecorator func(Sender) Sender - -// CreateSender creates, decorates, and returns, as a Sender, the default http.Client. -func CreateSender(decorators ...SendDecorator) Sender { - return DecorateSender(sender(tls.RenegotiateNever), decorators...) -} - -// DecorateSender accepts a Sender and a, possibly empty, set of SendDecorators, which is applies to -// the Sender. Decorators are applied in the order received, but their affect upon the request -// depends on whether they are a pre-decorator (change the http.Request and then pass it along) or a -// post-decorator (pass the http.Request along and react to the results in http.Response). -func DecorateSender(s Sender, decorators ...SendDecorator) Sender { - for _, decorate := range decorators { - s = decorate(s) - } - return s -} - -// Send sends, by means of the default http.Client, the passed http.Request, returning the -// http.Response and possible error. It also accepts a, possibly empty, set of SendDecorators which -// it will apply the http.Client before invoking the Do method. -// -// Send is a convenience method and not recommended for production. Advanced users should use -// SendWithSender, passing and sharing their own Sender (e.g., instance of http.Client). -// -// Send will not poll or retry requests. -func Send(r *http.Request, decorators ...SendDecorator) (*http.Response, error) { - return SendWithSender(sender(tls.RenegotiateNever), r, decorators...) -} - -// SendWithSender sends the passed http.Request, through the provided Sender, returning the -// http.Response and possible error. It also accepts a, possibly empty, set of SendDecorators which -// it will apply the http.Client before invoking the Do method. -// -// SendWithSender will not poll or retry requests. -func SendWithSender(s Sender, r *http.Request, decorators ...SendDecorator) (*http.Response, error) { - return DecorateSender(s, decorators...).Do(r) -} - -func sender(renengotiation tls.RenegotiationSupport) Sender { - // note that we can't init defaultSenders in init() since it will - // execute before calling code has had a chance to enable tracing - defaultSenders[renengotiation].init.Do(func() { - // copied from http.DefaultTransport with a TLS minimum version. - transport := &http.Transport{ - Proxy: http.ProxyFromEnvironment, - DialContext: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - }).DialContext, - ForceAttemptHTTP2: true, - MaxIdleConns: 100, - IdleConnTimeout: 90 * time.Second, - TLSHandshakeTimeout: 10 * time.Second, - ExpectContinueTimeout: 1 * time.Second, - TLSClientConfig: &tls.Config{ - MinVersion: tls.VersionTLS12, - Renegotiation: renengotiation, - }, - } - var roundTripper http.RoundTripper = transport - if tracing.IsEnabled() { - roundTripper = tracing.NewTransport(transport) - } - j, _ := cookiejar.New(nil) - defaultSenders[renengotiation].sender = &http.Client{Jar: j, Transport: roundTripper} - }) - return defaultSenders[renengotiation].sender -} - -// AfterDelay returns a SendDecorator that delays for the passed time.Duration before -// invoking the Sender. The delay may be terminated by closing the optional channel on the -// http.Request. If canceled, no further Senders are invoked. -func AfterDelay(d time.Duration) SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (*http.Response, error) { - if !DelayForBackoff(d, 0, r.Context().Done()) { - return nil, fmt.Errorf("autorest: AfterDelay canceled before full delay") - } - return s.Do(r) - }) - } -} - -// AsIs returns a SendDecorator that invokes the passed Sender without modifying the http.Request. -func AsIs() SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (*http.Response, error) { - return s.Do(r) - }) - } -} - -// DoCloseIfError returns a SendDecorator that first invokes the passed Sender after which -// it closes the response if the passed Sender returns an error and the response body exists. -func DoCloseIfError() SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (*http.Response, error) { - resp, err := s.Do(r) - if err != nil { - Respond(resp, ByDiscardingBody(), ByClosing()) - } - return resp, err - }) - } -} - -// DoErrorIfStatusCode returns a SendDecorator that emits an error if the response StatusCode is -// among the set passed. Since these are artificial errors, the response body may still require -// closing. -func DoErrorIfStatusCode(codes ...int) SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (*http.Response, error) { - resp, err := s.Do(r) - if err == nil && ResponseHasStatusCode(resp, codes...) { - err = NewErrorWithResponse("autorest", "DoErrorIfStatusCode", resp, "%v %v failed with %s", - resp.Request.Method, - resp.Request.URL, - resp.Status) - } - return resp, err - }) - } -} - -// DoErrorUnlessStatusCode returns a SendDecorator that emits an error unless the response -// StatusCode is among the set passed. Since these are artificial errors, the response body -// may still require closing. -func DoErrorUnlessStatusCode(codes ...int) SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (*http.Response, error) { - resp, err := s.Do(r) - if err == nil && !ResponseHasStatusCode(resp, codes...) { - err = NewErrorWithResponse("autorest", "DoErrorUnlessStatusCode", resp, "%v %v failed with %s", - resp.Request.Method, - resp.Request.URL, - resp.Status) - } - return resp, err - }) - } -} - -// DoPollForStatusCodes returns a SendDecorator that polls if the http.Response contains one of the -// passed status codes. It expects the http.Response to contain a Location header providing the -// URL at which to poll (using GET) and will poll until the time passed is equal to or greater than -// the supplied duration. It will delay between requests for the duration specified in the -// RetryAfter header or, if the header is absent, the passed delay. Polling may be canceled by -// closing the optional channel on the http.Request. -func DoPollForStatusCodes(duration time.Duration, delay time.Duration, codes ...int) SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (resp *http.Response, err error) { - resp, err = s.Do(r) - - if err == nil && ResponseHasStatusCode(resp, codes...) { - r, err = NewPollingRequestWithContext(r.Context(), resp) - - for err == nil && ResponseHasStatusCode(resp, codes...) { - Respond(resp, - ByDiscardingBody(), - ByClosing()) - resp, err = SendWithSender(s, r, - AfterDelay(GetRetryAfter(resp, delay))) - } - } - - return resp, err - }) - } -} - -// DoRetryForAttempts returns a SendDecorator that retries a failed request for up to the specified -// number of attempts, exponentially backing off between requests using the supplied backoff -// time.Duration (which may be zero). Retrying may be canceled by closing the optional channel on -// the http.Request. -func DoRetryForAttempts(attempts int, backoff time.Duration) SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (resp *http.Response, err error) { - rr := NewRetriableRequest(r) - for attempt := 0; attempt < attempts; attempt++ { - err = rr.Prepare() - if err != nil { - return resp, err - } - DrainResponseBody(resp) - resp, err = s.Do(rr.Request()) - if err == nil { - return resp, err - } - logger.Instance.Writef(logger.LogError, "DoRetryForAttempts: received error for attempt %d: %v\n", attempt+1, err) - if !DelayForBackoff(backoff, attempt, r.Context().Done()) { - return nil, r.Context().Err() - } - } - return resp, err - }) - } -} - -// Count429AsRetry indicates that a 429 response should be included as a retry attempt. -var Count429AsRetry = true - -// Max429Delay is the maximum duration to wait between retries on a 429 if no Retry-After header was received. -var Max429Delay time.Duration - -// DoRetryForStatusCodes returns a SendDecorator that retries for specified statusCodes for up to the specified -// number of attempts, exponentially backing off between requests using the supplied backoff -// time.Duration (which may be zero). Retrying may be canceled by cancelling the context on the http.Request. -// NOTE: Code http.StatusTooManyRequests (429) will *not* be counted against the number of attempts. -func DoRetryForStatusCodes(attempts int, backoff time.Duration, codes ...int) SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (*http.Response, error) { - return doRetryForStatusCodesImpl(s, r, Count429AsRetry, attempts, backoff, 0, codes...) - }) - } -} - -// DoRetryForStatusCodesWithCap returns a SendDecorator that retries for specified statusCodes for up to the -// specified number of attempts, exponentially backing off between requests using the supplied backoff -// time.Duration (which may be zero). To cap the maximum possible delay between iterations specify a value greater -// than zero for cap. Retrying may be canceled by cancelling the context on the http.Request. -func DoRetryForStatusCodesWithCap(attempts int, backoff, cap time.Duration, codes ...int) SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (*http.Response, error) { - return doRetryForStatusCodesImpl(s, r, Count429AsRetry, attempts, backoff, cap, codes...) - }) - } -} - -func doRetryForStatusCodesImpl(s Sender, r *http.Request, count429 bool, attempts int, backoff, cap time.Duration, codes ...int) (resp *http.Response, err error) { - rr := NewRetriableRequest(r) - // Increment to add the first call (attempts denotes number of retries) - for attempt, delayCount := 0, 0; attempt < attempts+1; { - err = rr.Prepare() - if err != nil { - return - } - DrainResponseBody(resp) - resp, err = s.Do(rr.Request()) - // we want to retry if err is not nil (e.g. transient network failure). note that for failed authentication - // resp and err will both have a value, so in this case we don't want to retry as it will never succeed. - if err == nil && !ResponseHasStatusCode(resp, codes...) || IsTokenRefreshError(err) { - return resp, err - } - if err != nil { - logger.Instance.Writef(logger.LogError, "DoRetryForStatusCodes: received error for attempt %d: %v\n", attempt+1, err) - } - delayed := DelayWithRetryAfter(resp, r.Context().Done()) - // if this was a 429 set the delay cap as specified. - // applicable only in the absence of a retry-after header. - if resp != nil && resp.StatusCode == http.StatusTooManyRequests { - cap = Max429Delay - } - if !delayed && !DelayForBackoffWithCap(backoff, cap, delayCount, r.Context().Done()) { - return resp, r.Context().Err() - } - // when count429 == false don't count a 429 against the number - // of attempts so that we continue to retry until it succeeds - if count429 || (resp == nil || resp.StatusCode != http.StatusTooManyRequests) { - attempt++ - } - // delay count is tracked separately from attempts to - // ensure that 429 participates in exponential back-off - delayCount++ - } - return resp, err -} - -// DelayWithRetryAfter invokes time.After for the duration specified in the "Retry-After" header. -// The value of Retry-After can be either the number of seconds or a date in RFC1123 format. -// The function returns true after successfully waiting for the specified duration. If there is -// no Retry-After header or the wait is cancelled the return value is false. -func DelayWithRetryAfter(resp *http.Response, cancel <-chan struct{}) bool { - if resp == nil { - return false - } - var dur time.Duration - ra := resp.Header.Get("Retry-After") - if retryAfter, _ := strconv.Atoi(ra); retryAfter > 0 { - dur = time.Duration(retryAfter) * time.Second - } else if t, err := time.Parse(time.RFC1123, ra); err == nil { - dur = t.Sub(time.Now()) - } - if dur > 0 { - select { - case <-time.After(dur): - return true - case <-cancel: - return false - } - } - return false -} - -// DoRetryForDuration returns a SendDecorator that retries the request until the total time is equal -// to or greater than the specified duration, exponentially backing off between requests using the -// supplied backoff time.Duration (which may be zero). Retrying may be canceled by closing the -// optional channel on the http.Request. -func DoRetryForDuration(d time.Duration, backoff time.Duration) SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (resp *http.Response, err error) { - rr := NewRetriableRequest(r) - end := time.Now().Add(d) - for attempt := 0; time.Now().Before(end); attempt++ { - err = rr.Prepare() - if err != nil { - return resp, err - } - DrainResponseBody(resp) - resp, err = s.Do(rr.Request()) - if err == nil { - return resp, err - } - logger.Instance.Writef(logger.LogError, "DoRetryForDuration: received error for attempt %d: %v\n", attempt+1, err) - if !DelayForBackoff(backoff, attempt, r.Context().Done()) { - return nil, r.Context().Err() - } - } - return resp, err - }) - } -} - -// WithLogging returns a SendDecorator that implements simple before and after logging of the -// request. -func WithLogging(logger *log.Logger) SendDecorator { - return func(s Sender) Sender { - return SenderFunc(func(r *http.Request) (*http.Response, error) { - logger.Printf("Sending %s %s", r.Method, r.URL) - resp, err := s.Do(r) - if err != nil { - logger.Printf("%s %s received error '%v'", r.Method, r.URL, err) - } else { - logger.Printf("%s %s received %s", r.Method, r.URL, resp.Status) - } - return resp, err - }) - } -} - -// DelayForBackoff invokes time.After for the supplied backoff duration raised to the power of -// passed attempt (i.e., an exponential backoff delay). Backoff duration is in seconds and can set -// to zero for no delay. The delay may be canceled by closing the passed channel. If terminated early, -// returns false. -// Note: Passing attempt 1 will result in doubling "backoff" duration. Treat this as a zero-based attempt -// count. -func DelayForBackoff(backoff time.Duration, attempt int, cancel <-chan struct{}) bool { - return DelayForBackoffWithCap(backoff, 0, attempt, cancel) -} - -// DelayForBackoffWithCap invokes time.After for the supplied backoff duration raised to the power of -// passed attempt (i.e., an exponential backoff delay). Backoff duration is in seconds and can set -// to zero for no delay. To cap the maximum possible delay specify a value greater than zero for cap. -// The delay may be canceled by closing the passed channel. If terminated early, returns false. -// Note: Passing attempt 1 will result in doubling "backoff" duration. Treat this as a zero-based attempt -// count. -func DelayForBackoffWithCap(backoff, cap time.Duration, attempt int, cancel <-chan struct{}) bool { - d := time.Duration(backoff.Seconds()*math.Pow(2, float64(attempt))) * time.Second - if cap > 0 && d > cap { - d = cap - } - logger.Instance.Writef(logger.LogInfo, "DelayForBackoffWithCap: sleeping for %s\n", d) - select { - case <-time.After(d): - return true - case <-cancel: - return false - } -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/utility.go b/vendor/github.com/Azure/go-autorest/autorest/utility.go deleted file mode 100644 index 3467b8fa60..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/utility.go +++ /dev/null @@ -1,232 +0,0 @@ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "encoding/json" - "encoding/xml" - "fmt" - "io" - "io/ioutil" - "net" - "net/http" - "net/url" - "reflect" - "strings" -) - -// EncodedAs is a series of constants specifying various data encodings -type EncodedAs string - -const ( - // EncodedAsJSON states that data is encoded as JSON - EncodedAsJSON EncodedAs = "JSON" - - // EncodedAsXML states that data is encoded as Xml - EncodedAsXML EncodedAs = "XML" -) - -// Decoder defines the decoding method json.Decoder and xml.Decoder share -type Decoder interface { - Decode(v interface{}) error -} - -// NewDecoder creates a new decoder appropriate to the passed encoding. -// encodedAs specifies the type of encoding and r supplies the io.Reader containing the -// encoded data. -func NewDecoder(encodedAs EncodedAs, r io.Reader) Decoder { - if encodedAs == EncodedAsJSON { - return json.NewDecoder(r) - } else if encodedAs == EncodedAsXML { - return xml.NewDecoder(r) - } - return nil -} - -// CopyAndDecode decodes the data from the passed io.Reader while making a copy. Having a copy -// is especially useful if there is a chance the data will fail to decode. -// encodedAs specifies the expected encoding, r provides the io.Reader to the data, and v -// is the decoding destination. -func CopyAndDecode(encodedAs EncodedAs, r io.Reader, v interface{}) (bytes.Buffer, error) { - b := bytes.Buffer{} - return b, NewDecoder(encodedAs, io.TeeReader(r, &b)).Decode(v) -} - -// TeeReadCloser returns a ReadCloser that writes to w what it reads from rc. -// It utilizes io.TeeReader to copy the data read and has the same behavior when reading. -// Further, when it is closed, it ensures that rc is closed as well. -func TeeReadCloser(rc io.ReadCloser, w io.Writer) io.ReadCloser { - return &teeReadCloser{rc, io.TeeReader(rc, w)} -} - -type teeReadCloser struct { - rc io.ReadCloser - r io.Reader -} - -func (t *teeReadCloser) Read(p []byte) (int, error) { - return t.r.Read(p) -} - -func (t *teeReadCloser) Close() error { - return t.rc.Close() -} - -func containsInt(ints []int, n int) bool { - for _, i := range ints { - if i == n { - return true - } - } - return false -} - -func escapeValueStrings(m map[string]string) map[string]string { - for key, value := range m { - m[key] = url.QueryEscape(value) - } - return m -} - -func ensureValueStrings(mapOfInterface map[string]interface{}) map[string]string { - mapOfStrings := make(map[string]string) - for key, value := range mapOfInterface { - mapOfStrings[key] = ensureValueString(value) - } - return mapOfStrings -} - -func ensureValueString(value interface{}) string { - if value == nil { - return "" - } - switch v := value.(type) { - case string: - return v - case []byte: - return string(v) - default: - return fmt.Sprintf("%v", v) - } -} - -// MapToValues method converts map[string]interface{} to url.Values. -func MapToValues(m map[string]interface{}) url.Values { - v := url.Values{} - for key, value := range m { - x := reflect.ValueOf(value) - if x.Kind() == reflect.Array || x.Kind() == reflect.Slice { - for i := 0; i < x.Len(); i++ { - v.Add(key, ensureValueString(x.Index(i))) - } - } else { - v.Add(key, ensureValueString(value)) - } - } - return v -} - -// AsStringSlice method converts interface{} to []string. -// s must be of type slice or array or an error is returned. -// Each element of s will be converted to its string representation. -func AsStringSlice(s interface{}) ([]string, error) { - v := reflect.ValueOf(s) - if v.Kind() != reflect.Slice && v.Kind() != reflect.Array { - return nil, NewError("autorest", "AsStringSlice", "the value's type is not a slice or array.") - } - stringSlice := make([]string, 0, v.Len()) - - for i := 0; i < v.Len(); i++ { - stringSlice = append(stringSlice, fmt.Sprintf("%v", v.Index(i))) - } - return stringSlice, nil -} - -// String method converts interface v to string. If interface is a list, it -// joins list elements using the separator. Note that only sep[0] will be used for -// joining if any separator is specified. -func String(v interface{}, sep ...string) string { - if len(sep) == 0 { - return ensureValueString(v) - } - stringSlice, ok := v.([]string) - if ok == false { - var err error - stringSlice, err = AsStringSlice(v) - if err != nil { - panic(fmt.Sprintf("autorest: Couldn't convert value to a string %s.", err)) - } - } - return ensureValueString(strings.Join(stringSlice, sep[0])) -} - -// Encode method encodes url path and query parameters. -func Encode(location string, v interface{}, sep ...string) string { - s := String(v, sep...) - switch strings.ToLower(location) { - case "path": - return pathEscape(s) - case "query": - return queryEscape(s) - default: - return s - } -} - -func pathEscape(s string) string { - return strings.Replace(url.QueryEscape(s), "+", "%20", -1) -} - -func queryEscape(s string) string { - return url.QueryEscape(s) -} - -// ChangeToGet turns the specified http.Request into a GET (it assumes it wasn't). -// This is mainly useful for long-running operations that use the Azure-AsyncOperation -// header, so we change the initial PUT into a GET to retrieve the final result. -func ChangeToGet(req *http.Request) *http.Request { - req.Method = "GET" - req.Body = nil - req.ContentLength = 0 - req.Header.Del("Content-Length") - return req -} - -// IsTemporaryNetworkError returns true if the specified error is a temporary network error or false -// if it's not. If the error doesn't implement the net.Error interface the return value is true. -func IsTemporaryNetworkError(err error) bool { - if netErr, ok := err.(net.Error); !ok || (ok && netErr.Temporary()) { - return true - } - return false -} - -// DrainResponseBody reads the response body then closes it. -func DrainResponseBody(resp *http.Response) error { - if resp != nil && resp.Body != nil { - _, err := io.Copy(ioutil.Discard, resp.Body) - resp.Body.Close() - return err - } - return nil -} - -func setHeader(r *http.Request, key, value string) { - if r.Header == nil { - r.Header = make(http.Header) - } - r.Header.Set(key, value) -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/utility_1.13.go b/vendor/github.com/Azure/go-autorest/autorest/utility_1.13.go deleted file mode 100644 index 3133fcc08e..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/utility_1.13.go +++ /dev/null @@ -1,30 +0,0 @@ -//go:build go1.13 -// +build go1.13 - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package autorest - -import ( - "errors" - - "github.com/Azure/go-autorest/autorest/adal" -) - -// IsTokenRefreshError returns true if the specified error implements the TokenRefreshError interface. -func IsTokenRefreshError(err error) bool { - var tre adal.TokenRefreshError - return errors.As(err, &tre) -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/utility_legacy.go b/vendor/github.com/Azure/go-autorest/autorest/utility_legacy.go deleted file mode 100644 index 851e152db4..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/utility_legacy.go +++ /dev/null @@ -1,32 +0,0 @@ -//go:build !go1.13 -// +build !go1.13 - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package autorest - -import "github.com/Azure/go-autorest/autorest/adal" - -// IsTokenRefreshError returns true if the specified error implements the TokenRefreshError -// interface. If err is a DetailedError it will walk the chain of Original errors. -func IsTokenRefreshError(err error) bool { - if _, ok := err.(adal.TokenRefreshError); ok { - return true - } - if de, ok := err.(DetailedError); ok { - return IsTokenRefreshError(de.Original) - } - return false -} diff --git a/vendor/github.com/Azure/go-autorest/autorest/version.go b/vendor/github.com/Azure/go-autorest/autorest/version.go deleted file mode 100644 index 713e23581d..0000000000 --- a/vendor/github.com/Azure/go-autorest/autorest/version.go +++ /dev/null @@ -1,41 +0,0 @@ -package autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "fmt" - "runtime" -) - -const number = "v14.2.1" - -var ( - userAgent = fmt.Sprintf("Go/%s (%s-%s) go-autorest/%s", - runtime.Version(), - runtime.GOARCH, - runtime.GOOS, - number, - ) -) - -// UserAgent returns a string containing the Go version, system architecture and OS, and the go-autorest version. -func UserAgent() string { - return userAgent -} - -// Version returns the semantic version (see http://semver.org). -func Version() string { - return number -} diff --git a/vendor/github.com/Azure/go-autorest/azure-pipelines.yml b/vendor/github.com/Azure/go-autorest/azure-pipelines.yml deleted file mode 100644 index 6fb8404fd0..0000000000 --- a/vendor/github.com/Azure/go-autorest/azure-pipelines.yml +++ /dev/null @@ -1,105 +0,0 @@ -variables: - GOPATH: '$(system.defaultWorkingDirectory)/work' - sdkPath: '$(GOPATH)/src/github.com/$(build.repository.name)' - -jobs: - - job: 'goautorest' - displayName: 'Run go-autorest CI Checks' - - strategy: - matrix: - Linux_Go113: - vm.image: 'ubuntu-18.04' - go.version: '1.13' - Linux_Go114: - vm.image: 'ubuntu-18.04' - go.version: '1.14' - - pool: - vmImage: '$(vm.image)' - - steps: - - task: GoTool@0 - inputs: - version: '$(go.version)' - displayName: "Select Go Version" - - - script: | - set -e - mkdir -p '$(GOPATH)/bin' - mkdir -p '$(sdkPath)' - shopt -s extglob - mv !(work) '$(sdkPath)' - echo '##vso[task.prependpath]$(GOPATH)/bin' - displayName: 'Create Go Workspace' - - - script: | - set -e - curl -sSL https://raw.githubusercontent.com/golang/dep/master/install.sh | sh - dep ensure -v - go install ./vendor/golang.org/x/lint/golint - go get github.com/jstemmer/go-junit-report - go get github.com/axw/gocov/gocov - go get github.com/AlekSi/gocov-xml - go get -u github.com/matm/gocov-html - workingDirectory: '$(sdkPath)' - displayName: 'Install Dependencies' - - - script: | - go vet ./autorest/... - go vet ./logger/... - go vet ./tracing/... - workingDirectory: '$(sdkPath)' - displayName: 'Vet' - - - script: | - go build -v ./autorest/... - go build -v ./logger/... - go build -v ./tracing/... - workingDirectory: '$(sdkPath)' - displayName: 'Build' - - - script: | - set -e - go test -race -v -coverprofile=coverage.txt -covermode atomic ./autorest/... ./logger/... ./tracing/... 2>&1 | go-junit-report > report.xml - gocov convert coverage.txt > coverage.json - gocov-xml < coverage.json > coverage.xml - gocov-html < coverage.json > coverage.html - workingDirectory: '$(sdkPath)' - displayName: 'Run Tests' - - - script: grep -L -r --include *.go --exclude-dir vendor -P "Copyright (\d{4}|\(c\)) Microsoft" ./ | tee >&2 - workingDirectory: '$(sdkPath)' - displayName: 'Copyright Header Check' - failOnStderr: true - condition: succeededOrFailed() - - - script: | - gofmt -s -l -w ./autorest/. >&2 - gofmt -s -l -w ./logger/. >&2 - gofmt -s -l -w ./tracing/. >&2 - workingDirectory: '$(sdkPath)' - displayName: 'Format Check' - failOnStderr: true - condition: succeededOrFailed() - - - script: | - golint ./autorest/... >&2 - golint ./logger/... >&2 - golint ./tracing/... >&2 - workingDirectory: '$(sdkPath)' - displayName: 'Linter Check' - failOnStderr: true - condition: succeededOrFailed() - - - task: PublishTestResults@2 - inputs: - testRunner: JUnit - testResultsFiles: $(sdkPath)/report.xml - failTaskOnFailedTests: true - - - task: PublishCodeCoverageResults@1 - inputs: - codeCoverageTool: Cobertura - summaryFileLocation: $(sdkPath)/coverage.xml - additionalCodeCoverageFiles: $(sdkPath)/coverage.html diff --git a/vendor/github.com/Azure/go-autorest/doc.go b/vendor/github.com/Azure/go-autorest/doc.go deleted file mode 100644 index 99ae6ca988..0000000000 --- a/vendor/github.com/Azure/go-autorest/doc.go +++ /dev/null @@ -1,18 +0,0 @@ -/* -Package go-autorest provides an HTTP request client for use with Autorest-generated API client packages. -*/ -package go_autorest - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. diff --git a/vendor/github.com/Azure/go-autorest/logger/LICENSE b/vendor/github.com/Azure/go-autorest/logger/LICENSE deleted file mode 100644 index b9d6a27ea9..0000000000 --- a/vendor/github.com/Azure/go-autorest/logger/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2015 Microsoft Corporation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/Azure/go-autorest/logger/go_mod_tidy_hack.go b/vendor/github.com/Azure/go-autorest/logger/go_mod_tidy_hack.go deleted file mode 100644 index 0aa27680db..0000000000 --- a/vendor/github.com/Azure/go-autorest/logger/go_mod_tidy_hack.go +++ /dev/null @@ -1,24 +0,0 @@ -// +build modhack - -package logger - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file, and the github.com/Azure/go-autorest import, won't actually become part of -// the resultant binary. - -// Necessary for safely adding multi-module repo. -// See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository -import _ "github.com/Azure/go-autorest" diff --git a/vendor/github.com/Azure/go-autorest/logger/logger.go b/vendor/github.com/Azure/go-autorest/logger/logger.go deleted file mode 100644 index 2f5d8cc1a1..0000000000 --- a/vendor/github.com/Azure/go-autorest/logger/logger.go +++ /dev/null @@ -1,337 +0,0 @@ -package logger - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "bytes" - "fmt" - "io" - "io/ioutil" - "net/http" - "net/url" - "os" - "strings" - "sync" - "time" -) - -// LevelType tells a logger the minimum level to log. When code reports a log entry, -// the LogLevel indicates the level of the log entry. The logger only records entries -// whose level is at least the level it was told to log. See the Log* constants. -// For example, if a logger is configured with LogError, then LogError, LogPanic, -// and LogFatal entries will be logged; lower level entries are ignored. -type LevelType uint32 - -const ( - // LogNone tells a logger not to log any entries passed to it. - LogNone LevelType = iota - - // LogFatal tells a logger to log all LogFatal entries passed to it. - LogFatal - - // LogPanic tells a logger to log all LogPanic and LogFatal entries passed to it. - LogPanic - - // LogError tells a logger to log all LogError, LogPanic and LogFatal entries passed to it. - LogError - - // LogWarning tells a logger to log all LogWarning, LogError, LogPanic and LogFatal entries passed to it. - LogWarning - - // LogInfo tells a logger to log all LogInfo, LogWarning, LogError, LogPanic and LogFatal entries passed to it. - LogInfo - - // LogDebug tells a logger to log all LogDebug, LogInfo, LogWarning, LogError, LogPanic and LogFatal entries passed to it. - LogDebug - - // LogAuth is a special case of LogDebug, it tells a logger to also log the body of an authentication request and response. - // NOTE: this can disclose sensitive information, use with care. - LogAuth -) - -const ( - logNone = "NONE" - logFatal = "FATAL" - logPanic = "PANIC" - logError = "ERROR" - logWarning = "WARNING" - logInfo = "INFO" - logDebug = "DEBUG" - logAuth = "AUTH" - logUnknown = "UNKNOWN" -) - -// ParseLevel converts the specified string into the corresponding LevelType. -func ParseLevel(s string) (lt LevelType, err error) { - switch strings.ToUpper(s) { - case logFatal: - lt = LogFatal - case logPanic: - lt = LogPanic - case logError: - lt = LogError - case logWarning: - lt = LogWarning - case logInfo: - lt = LogInfo - case logDebug: - lt = LogDebug - case logAuth: - lt = LogAuth - default: - err = fmt.Errorf("bad log level '%s'", s) - } - return -} - -// String implements the stringer interface for LevelType. -func (lt LevelType) String() string { - switch lt { - case LogNone: - return logNone - case LogFatal: - return logFatal - case LogPanic: - return logPanic - case LogError: - return logError - case LogWarning: - return logWarning - case LogInfo: - return logInfo - case LogDebug: - return logDebug - case LogAuth: - return logAuth - default: - return logUnknown - } -} - -// Filter defines functions for filtering HTTP request/response content. -type Filter struct { - // URL returns a potentially modified string representation of a request URL. - URL func(u *url.URL) string - - // Header returns a potentially modified set of values for the specified key. - // To completely exclude the header key/values return false. - Header func(key string, val []string) (bool, []string) - - // Body returns a potentially modified request/response body. - Body func(b []byte) []byte -} - -func (f Filter) processURL(u *url.URL) string { - if f.URL == nil { - return u.String() - } - return f.URL(u) -} - -func (f Filter) processHeader(k string, val []string) (bool, []string) { - if f.Header == nil { - return true, val - } - return f.Header(k, val) -} - -func (f Filter) processBody(b []byte) []byte { - if f.Body == nil { - return b - } - return f.Body(b) -} - -// Writer defines methods for writing to a logging facility. -type Writer interface { - // Writeln writes the specified message with the standard log entry header and new-line character. - Writeln(level LevelType, message string) - - // Writef writes the specified format specifier with the standard log entry header and no new-line character. - Writef(level LevelType, format string, a ...interface{}) - - // WriteRequest writes the specified HTTP request to the logger if the log level is greater than - // or equal to LogInfo. The request body, if set, is logged at level LogDebug or higher. - // Custom filters can be specified to exclude URL, header, and/or body content from the log. - // By default no request content is excluded. - WriteRequest(req *http.Request, filter Filter) - - // WriteResponse writes the specified HTTP response to the logger if the log level is greater than - // or equal to LogInfo. The response body, if set, is logged at level LogDebug or higher. - // Custom filters can be specified to exclude URL, header, and/or body content from the log. - // By default no response content is excluded. - WriteResponse(resp *http.Response, filter Filter) -} - -// Instance is the default log writer initialized during package init. -// This can be replaced with a custom implementation as required. -var Instance Writer - -// default log level -var logLevel = LogNone - -// Level returns the value specified in AZURE_GO_AUTOREST_LOG_LEVEL. -// If no value was specified the default value is LogNone. -// Custom loggers can call this to retrieve the configured log level. -func Level() LevelType { - return logLevel -} - -func init() { - // separated for testing purposes - initDefaultLogger() -} - -func initDefaultLogger() { - // init with nilLogger so callers don't have to do a nil check on Default - Instance = nilLogger{} - llStr := strings.ToLower(os.Getenv("AZURE_GO_SDK_LOG_LEVEL")) - if llStr == "" { - return - } - var err error - logLevel, err = ParseLevel(llStr) - if err != nil { - fmt.Fprintf(os.Stderr, "go-autorest: failed to parse log level: %s\n", err.Error()) - return - } - if logLevel == LogNone { - return - } - // default to stderr - dest := os.Stderr - lfStr := os.Getenv("AZURE_GO_SDK_LOG_FILE") - if strings.EqualFold(lfStr, "stdout") { - dest = os.Stdout - } else if lfStr != "" { - lf, err := os.Create(lfStr) - if err == nil { - dest = lf - } else { - fmt.Fprintf(os.Stderr, "go-autorest: failed to create log file, using stderr: %s\n", err.Error()) - } - } - Instance = fileLogger{ - logLevel: logLevel, - mu: &sync.Mutex{}, - logFile: dest, - } -} - -// the nil logger does nothing -type nilLogger struct{} - -func (nilLogger) Writeln(LevelType, string) {} - -func (nilLogger) Writef(LevelType, string, ...interface{}) {} - -func (nilLogger) WriteRequest(*http.Request, Filter) {} - -func (nilLogger) WriteResponse(*http.Response, Filter) {} - -// A File is used instead of a Logger so the stream can be flushed after every write. -type fileLogger struct { - logLevel LevelType - mu *sync.Mutex // for synchronizing writes to logFile - logFile *os.File -} - -func (fl fileLogger) Writeln(level LevelType, message string) { - fl.Writef(level, "%s\n", message) -} - -func (fl fileLogger) Writef(level LevelType, format string, a ...interface{}) { - if fl.logLevel >= level { - fl.mu.Lock() - defer fl.mu.Unlock() - fmt.Fprintf(fl.logFile, "%s %s", entryHeader(level), fmt.Sprintf(format, a...)) - fl.logFile.Sync() - } -} - -func (fl fileLogger) WriteRequest(req *http.Request, filter Filter) { - if req == nil || fl.logLevel < LogInfo { - return - } - b := &bytes.Buffer{} - fmt.Fprintf(b, "%s REQUEST: %s %s\n", entryHeader(LogInfo), req.Method, filter.processURL(req.URL)) - // dump headers - for k, v := range req.Header { - if ok, mv := filter.processHeader(k, v); ok { - fmt.Fprintf(b, "%s: %s\n", k, strings.Join(mv, ",")) - } - } - if fl.shouldLogBody(req.Header, req.Body) { - // dump body - body, err := ioutil.ReadAll(req.Body) - if err == nil { - fmt.Fprintln(b, string(filter.processBody(body))) - if nc, ok := req.Body.(io.Seeker); ok { - // rewind to the beginning - nc.Seek(0, io.SeekStart) - } else { - // recreate the body - req.Body = ioutil.NopCloser(bytes.NewReader(body)) - } - } else { - fmt.Fprintf(b, "failed to read body: %v\n", err) - } - } - fl.mu.Lock() - defer fl.mu.Unlock() - fmt.Fprint(fl.logFile, b.String()) - fl.logFile.Sync() -} - -func (fl fileLogger) WriteResponse(resp *http.Response, filter Filter) { - if resp == nil || fl.logLevel < LogInfo { - return - } - b := &bytes.Buffer{} - fmt.Fprintf(b, "%s RESPONSE: %d %s\n", entryHeader(LogInfo), resp.StatusCode, filter.processURL(resp.Request.URL)) - // dump headers - for k, v := range resp.Header { - if ok, mv := filter.processHeader(k, v); ok { - fmt.Fprintf(b, "%s: %s\n", k, strings.Join(mv, ",")) - } - } - if fl.shouldLogBody(resp.Header, resp.Body) { - // dump body - defer resp.Body.Close() - body, err := ioutil.ReadAll(resp.Body) - if err == nil { - fmt.Fprintln(b, string(filter.processBody(body))) - resp.Body = ioutil.NopCloser(bytes.NewReader(body)) - } else { - fmt.Fprintf(b, "failed to read body: %v\n", err) - } - } - fl.mu.Lock() - defer fl.mu.Unlock() - fmt.Fprint(fl.logFile, b.String()) - fl.logFile.Sync() -} - -// returns true if the provided body should be included in the log -func (fl fileLogger) shouldLogBody(header http.Header, body io.ReadCloser) bool { - ct := header.Get("Content-Type") - return fl.logLevel >= LogDebug && body != nil && !strings.Contains(ct, "application/octet-stream") -} - -// creates standard header for log entries, it contains a timestamp and the log level -func entryHeader(level LevelType) string { - // this format provides a fixed number of digits so the size of the timestamp is constant - return fmt.Sprintf("(%s) %s:", time.Now().Format("2006-01-02T15:04:05.0000000Z07:00"), level.String()) -} diff --git a/vendor/github.com/Azure/go-autorest/tracing/LICENSE b/vendor/github.com/Azure/go-autorest/tracing/LICENSE deleted file mode 100644 index b9d6a27ea9..0000000000 --- a/vendor/github.com/Azure/go-autorest/tracing/LICENSE +++ /dev/null @@ -1,191 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - Copyright 2015 Microsoft Corporation - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/Azure/go-autorest/tracing/go_mod_tidy_hack.go b/vendor/github.com/Azure/go-autorest/tracing/go_mod_tidy_hack.go deleted file mode 100644 index e163975cd4..0000000000 --- a/vendor/github.com/Azure/go-autorest/tracing/go_mod_tidy_hack.go +++ /dev/null @@ -1,24 +0,0 @@ -// +build modhack - -package tracing - -// Copyright 2017 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -// This file, and the github.com/Azure/go-autorest import, won't actually become part of -// the resultant binary. - -// Necessary for safely adding multi-module repo. -// See: https://github.com/golang/go/wiki/Modules#is-it-possible-to-add-a-module-to-a-multi-module-repository -import _ "github.com/Azure/go-autorest" diff --git a/vendor/github.com/Azure/go-autorest/tracing/tracing.go b/vendor/github.com/Azure/go-autorest/tracing/tracing.go deleted file mode 100644 index 0e7a6e9625..0000000000 --- a/vendor/github.com/Azure/go-autorest/tracing/tracing.go +++ /dev/null @@ -1,67 +0,0 @@ -package tracing - -// Copyright 2018 Microsoft Corporation -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -import ( - "context" - "net/http" -) - -// Tracer represents an HTTP tracing facility. -type Tracer interface { - NewTransport(base *http.Transport) http.RoundTripper - StartSpan(ctx context.Context, name string) context.Context - EndSpan(ctx context.Context, httpStatusCode int, err error) -} - -var ( - tracer Tracer -) - -// Register will register the provided Tracer. Pass nil to unregister a Tracer. -func Register(t Tracer) { - tracer = t -} - -// IsEnabled returns true if a Tracer has been registered. -func IsEnabled() bool { - return tracer != nil -} - -// NewTransport creates a new instrumenting http.RoundTripper for the -// registered Tracer. If no Tracer has been registered it returns nil. -func NewTransport(base *http.Transport) http.RoundTripper { - if tracer != nil { - return tracer.NewTransport(base) - } - return nil -} - -// StartSpan starts a trace span with the specified name, associating it with the -// provided context. Has no effect if a Tracer has not been registered. -func StartSpan(ctx context.Context, name string) context.Context { - if tracer != nil { - return tracer.StartSpan(ctx, name) - } - return ctx -} - -// EndSpan ends a previously started span stored in the context. -// Has no effect if a Tracer has not been registered. -func EndSpan(ctx context.Context, httpStatusCode int, err error) { - if tracer != nil { - tracer.EndSpan(ctx, httpStatusCode, err) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/CHANGELOG.md deleted file mode 100644 index dd0093b68c..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/CHANGELOG.md +++ /dev/null @@ -1,789 +0,0 @@ -# v1.63.5 (2026-03-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.63.4 (2026-03-03) - -* **Dependency Update**: Bump minimum Go version to 1.24 -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.63.3 (2026-02-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.63.2 (2026-01-14) - -* **Documentation**: Cost Categories added support to BillingView data filter expressions through the new costCategories parameter, enabling users to filter billing views by AWS Cost Categories for more granular cost management and allocation. - -# v1.63.1 (2026-01-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.63.0 (2026-01-06) - -* **Feature**: This release updates existing reservation recommendations API to support deployment model. - -# v1.62.0 (2025-12-08) - -* **Feature**: Add support for Cost Category resource associations including filtering by resource type on ListCostCategoryDefinitions and new ListCostCategoryResourceAssociations API. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.61.0 (2025-12-02) - -* **Feature**: This release updates existing Savings Plans Purchase Analyzer and Recommendations APIs to support Database Savings Plans. -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change. - -# v1.60.2 (2025-11-25) - -* **Bug Fix**: Add error check for endpoint param binding during auth scheme resolution to fix panic reported in #3234 - -# v1.60.1 (2025-11-19.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.60.0 (2025-11-19) - -* **Feature**: Add support for COST_CATEGORY, TAG, and LINKED_ACCOUNT AWS managed cost anomaly detection monitors - -# v1.59.4 (2025-11-12) - -* **Bug Fix**: Further reduce allocation overhead when the metrics system isn't in-use. -* **Bug Fix**: Reduce allocation overhead when the client doesn't have any HTTP interceptors configured. -* **Bug Fix**: Remove blank trace spans towards the beginning of the request that added no additional information. This conveys a slight reduction in overall allocations. - -# v1.59.3 (2025-11-11) - -* **Bug Fix**: Return validation error if input region is not a valid host label. - -# v1.59.2 (2025-11-04) - -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade to smithy-go v1.23.2 which should convey some passive reduction of overall allocations, especially when not using the metrics system. - -# v1.59.1 (2025-10-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.59.0 (2025-10-27) - -* **Feature**: Updated endpoint for eusc-de-east-1 region. - -# v1.58.1 (2025-10-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.58.0 (2025-10-22) - -* **Feature**: Update endpoint ruleset parameters casing - -# v1.57.1 (2025-10-16) - -* **Dependency Update**: Bump minimum Go version to 1.23. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.57.0 (2025-09-26) - -* **Feature**: Support for payer account dimension and billing view health status. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.56.1 (2025-09-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.56.0 (2025-09-15) - -* **Feature**: Added endpoint support for eusc-de-east-1 region. - -# v1.55.5 (2025-09-10) - -* No change notes available for this release. - -# v1.55.4 (2025-09-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.55.3 (2025-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.55.2 (2025-08-27) - -* **Dependency Update**: Update to smithy-go v1.23.0. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.55.1 (2025-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.55.0 (2025-08-20) - -* **Feature**: Remove incorrect endpoint tests -* **Bug Fix**: Remove unused deserialization code. - -# v1.54.0 (2025-08-11) - -* **Feature**: Add support for configuring per-service Options via callback on global config. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.53.0 (2025-08-04) - -* **Feature**: Support configurable auth scheme preferences in service clients via AWS_AUTH_SCHEME_PREFERENCE in the environment, auth_scheme_preference in the config file, and through in-code settings on LoadDefaultConfig and client constructor methods. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.52.1 (2025-07-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.52.0 (2025-07-28) - -* **Feature**: Add support for HTTP interceptors. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.51.3 (2025-07-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.51.2 (2025-06-17) - -* **Dependency Update**: Update to smithy-go v1.22.4. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.51.1 (2025-06-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.51.0 (2025-06-09) - -* **Feature**: Support dual-stack endpoints for ce api - -# v1.50.0 (2025-05-27) - -* **Feature**: This release introduces Cost Comparison feature (GetCostAndUsageComparisons, GetCostComparisonDrivers) allowing you find cost variations across multiple dimensions and identify key drivers of spending changes. - -# v1.49.0 (2025-04-08) - -* **Feature**: This release supports Pagination traits on Cost Anomaly Detection APIs. - -# v1.48.1 (2025-04-03) - -* No change notes available for this release. - -# v1.48.0 (2025-03-10) - -* **Feature**: Releasing minor partition endpoint updates. - -# v1.47.1 (2025-03-04.2) - -* **Bug Fix**: Add assurance test for operation order. - -# v1.47.0 (2025-02-27) - -* **Feature**: Track credential providers via User-Agent Feature ids -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.46.8 (2025-02-18) - -* **Bug Fix**: Bump go version to 1.22 -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.46.7 (2025-02-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.46.6 (2025-01-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.46.5 (2025-01-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.46.4 (2025-01-24) - -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade to smithy-go v1.22.2. - -# v1.46.3 (2025-01-17) - -* **Bug Fix**: Fix bug where credentials weren't refreshed during retry loop. - -# v1.46.2 (2025-01-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.46.1 (2025-01-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.46.0 (2024-12-20) - -* **Feature**: Support for retrieving cost, usage, and forecast for billing view. - -# v1.45.2 (2024-12-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.45.1 (2024-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.45.0 (2024-11-22) - -* **Feature**: This release adds the Impact field(contains Contribution field) to the GetAnomalies API response under RootCause - -# v1.44.0 (2024-11-21) - -* **Feature**: This release introduces three new APIs that enable you to estimate the cost, coverage, and utilization impact of Savings Plans you plan to purchase. The three APIs are StartCommitmentPurchaseAnalysis, GetCommitmentPurchaseAnalysis, and ListCommitmentPurchaseAnalyses. - -# v1.43.6 (2024-11-18) - -* **Dependency Update**: Update to smithy-go v1.22.1. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.43.5 (2024-11-07) - -* **Bug Fix**: Adds case-insensitive handling of error message fields in service responses - -# v1.43.4 (2024-11-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.43.3 (2024-10-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.43.2 (2024-10-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.43.1 (2024-10-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.43.0 (2024-10-04) - -* **Feature**: Add support for HTTP client metrics. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.42.4 (2024-10-03) - -* No change notes available for this release. - -# v1.42.3 (2024-09-27) - -* No change notes available for this release. - -# v1.42.2 (2024-09-25) - -* No change notes available for this release. - -# v1.42.1 (2024-09-23) - -* No change notes available for this release. - -# v1.42.0 (2024-09-20) - -* **Feature**: Add tracing and metrics support to service clients. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.41.0 (2024-09-18) - -* **Feature**: This release extends the GetReservationPurchaseRecommendation API to support recommendations for Amazon DynamoDB reservations. - -# v1.40.7 (2024-09-17) - -* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution. - -# v1.40.6 (2024-09-04) - -* No change notes available for this release. - -# v1.40.5 (2024-09-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.40.4 (2024-08-15) - -* **Dependency Update**: Bump minimum Go version to 1.21. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.40.3 (2024-07-10.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.40.2 (2024-07-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.40.1 (2024-06-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.40.0 (2024-06-26) - -* **Feature**: Support list-of-string endpoint parameter. - -# v1.39.1 (2024-06-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.39.0 (2024-06-18) - -* **Feature**: Track usage of various AWS SDK features in user-agent string. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.38.7 (2024-06-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.38.6 (2024-06-07) - -* **Bug Fix**: Add clock skew correction on all service clients -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.38.5 (2024-06-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.38.4 (2024-05-23) - -* No change notes available for this release. - -# v1.38.3 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.38.2 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.38.1 (2024-05-08) - -* **Bug Fix**: GoDoc improvement - -# v1.38.0 (2024-04-23) - -* **Feature**: Added additional metadata that might be applicable to your reservation recommendations. - -# v1.37.1 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.37.0 (2024-03-26) - -* **Feature**: Adds support for backfill of cost allocation tags, with new StartCostAllocationTagBackfill and ListCostAllocationTagBackfillHistory API. - -# v1.36.2 (2024-03-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.36.1 (2024-03-07) - -* **Bug Fix**: Remove dependency on go-cmp. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.36.0 (2024-02-28) - -* **Feature**: This release introduces the new API 'GetApproximateUsageRecords', which retrieves estimated usage records for hourly granularity or resource-level data at daily granularity. - -# v1.35.1 (2024-02-23) - -* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.35.0 (2024-02-22) - -* **Feature**: Add middleware stack snapshot tests. - -# v1.34.3 (2024-02-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.34.2 (2024-02-20) - -* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure. - -# v1.34.1 (2024-02-15) - -* **Bug Fix**: Correct failure to determine the error type in awsJson services that could occur when errors were modeled with a non-string `code` field. - -# v1.34.0 (2024-02-13) - -* **Feature**: Bump minimum Go version to 1.20 per our language support policy. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.6 (2024-01-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.5 (2023-12-08) - -* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. - -# v1.33.4 (2023-12-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.3 (2023-12-06) - -* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. - -# v1.33.2 (2023-12-01) - -* **Bug Fix**: Correct wrapping of errors in authentication workflow. -* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.1 (2023-11-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.0 (2023-11-29) - -* **Feature**: Expose Options() accessor on service clients. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.32.5 (2023-11-28.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.32.4 (2023-11-28) - -* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. - -# v1.32.3 (2023-11-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.32.2 (2023-11-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.32.1 (2023-11-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.32.0 (2023-11-06) - -* **Feature**: This release extends the GetReservationPurchaseRecommendation API to support recommendations for Amazon MemoryDB reservations. - -# v1.31.0 (2023-11-01) - -* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.30.0 (2023-10-31) - -* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.0 (2023-10-24) - -* **Feature**: **BREAKFIX**: Correct nullability and default value representation of various input fields across a large number of services. Calling code that references one or more of the affected fields will need to update usage accordingly. See [2162](https://github.com/aws/aws-sdk-go-v2/issues/2162). - -# v1.28.2 (2023-10-12) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.1 (2023-10-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.0 (2023-08-22) - -* **Feature**: This release adds the LastUpdatedDate and LastUsedDate timestamps to help you manage your cost allocation tags. - -# v1.27.5 (2023-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.4 (2023-08-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.3 (2023-08-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.2 (2023-08-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.1 (2023-08-01) - -* No change notes available for this release. - -# v1.27.0 (2023-07-31) - -* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.1 (2023-07-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.26.0 (2023-07-24) - -* **Feature**: This release introduces the new API 'GetSavingsPlanPurchaseRecommendationDetails', which retrieves the details for a Savings Plan recommendation. It also updates the existing API 'GetSavingsPlansPurchaseRecommendation' to include the recommendation detail ID. - -# v1.25.13 (2023-07-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.12 (2023-06-15) - -* No change notes available for this release. - -# v1.25.11 (2023-06-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.10 (2023-05-04) - -* No change notes available for this release. - -# v1.25.9 (2023-04-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.8 (2023-04-10) - -* No change notes available for this release. - -# v1.25.7 (2023-04-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.6 (2023-03-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.5 (2023-03-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.4 (2023-02-22) - -* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. - -# v1.25.3 (2023-02-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.2 (2023-02-15) - -* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910. -* **Bug Fix**: Correct error type parsing for restJson services. - -# v1.25.1 (2023-02-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.0 (2023-01-05) - -* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). - -# v1.24.1 (2022-12-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.0 (2022-12-14) - -* **Feature**: This release supports percentage-based thresholds on Cost Anomaly Detection alert subscriptions. - -# v1.23.0 (2022-12-07) - -* **Feature**: This release adds the LinkedAccountName field to the GetAnomalies API response under RootCause - -# v1.22.0 (2022-12-05) - -* **Feature**: This release introduces two new APIs that offer a 1-click experience to refresh Savings Plans recommendations. The two APIs are StartSavingsPlansPurchaseRecommendationGeneration and ListSavingsPlansPurchaseRecommendationGeneration. - -# v1.21.3 (2022-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.2 (2022-10-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.1 (2022-10-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.0 (2022-09-27) - -* **Feature**: This release is to support retroactive Cost Categories. The new field will enable you to retroactively apply new and existing cost category rules to previous months. - -# v1.20.1 (2022-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.0 (2022-09-14) - -* **Feature**: Fixed a bug in the API client generation which caused some operation parameters to be incorrectly generated as value types instead of pointer types. The service API always required these affected parameters to be nilable. This fixes the SDK client to match the expectations of the the service API. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.9 (2022-09-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.8 (2022-08-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.7 (2022-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.6 (2022-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.5 (2022-08-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.4 (2022-08-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.3 (2022-08-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.2 (2022-07-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.1 (2022-06-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.0 (2022-06-07) - -* **Feature**: Added two new APIs to support cost allocation tags operations: ListCostAllocationTags, UpdateCostAllocationTagsStatus. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.5 (2022-05-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.4 (2022-04-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.3 (2022-03-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.2 (2022-03-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.1 (2022-03-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.0 (2022-03-22) - -* **Feature**: Added three new APIs to support tagging and resource-level authorization on Cost Explorer resources: TagResource, UntagResource, ListTagsForResource. Added optional parameters to CreateCostCategoryDefinition, CreateAnomalySubscription and CreateAnomalyMonitor APIs to support Tag On Create. - -# v1.17.0 (2022-03-08) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.0 (2022-02-24) - -* **Feature**: API client updated -* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.0 (2022-01-14) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Documentation**: Updated API models -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.0 (2022-01-07) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.0 (2021-12-21) - -* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens. - -# v1.12.2 (2021-12-02) - -* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.1 (2021-11-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.0 (2021-11-12) - -* **Feature**: Service clients now support custom endpoints that have an initial URI path defined. - -# v1.11.0 (2021-11-06) - -* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.0 (2021-10-21) - -* **Feature**: Updated to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.2 (2021-10-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.1 (2021-09-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.0 (2021-08-27) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.8.0 (2021-08-19) - -* **Feature**: API client updated -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.7.2 (2021-08-04) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.7.1 (2021-07-15) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.7.0 (2021-06-25) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.0 (2021-05-25) - -* **Feature**: API client updated - -# v1.5.1 (2021-05-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.0 (2021-05-14) - -* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. -* **Dependency Update**: Updated to the latest SDK module versions - diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_client.go deleted file mode 100644 index ce47803aab..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_client.go +++ /dev/null @@ -1,950 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "errors" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/aws/defaults" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/aws/retry" - "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - smithydocument "github.com/aws/smithy-go/document" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net" - "net/http" - "sync/atomic" - "time" -) - -const ServiceID = "Cost Explorer" -const ServiceAPIVersion = "2017-10-25" - -type operationMetrics struct { - Duration metrics.Float64Histogram - SerializeDuration metrics.Float64Histogram - ResolveIdentityDuration metrics.Float64Histogram - ResolveEndpointDuration metrics.Float64Histogram - SignRequestDuration metrics.Float64Histogram - DeserializeDuration metrics.Float64Histogram -} - -func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { - switch name { - case "client.call.duration": - return m.Duration - case "client.call.serialization_duration": - return m.SerializeDuration - case "client.call.resolve_identity_duration": - return m.ResolveIdentityDuration - case "client.call.resolve_endpoint_duration": - return m.ResolveEndpointDuration - case "client.call.signing_duration": - return m.SignRequestDuration - case "client.call.deserialization_duration": - return m.DeserializeDuration - default: - panic("unrecognized operation metric") - } -} - -func timeOperationMetric[T any]( - ctx context.Context, metric string, fn func() (T, error), - opts ...metrics.RecordMetricOption, -) (T, error) { - mm := getOperationMetrics(ctx) - if mm == nil { // not using the metrics system - return fn() - } - - instr := mm.histogramFor(metric) - opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) - - start := time.Now() - v, err := fn() - end := time.Now() - - elapsed := end.Sub(start) - instr.Record(ctx, float64(elapsed)/1e9, opts...) - return v, err -} - -func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { - mm := getOperationMetrics(ctx) - if mm == nil { // not using the metrics system - return func() {} - } - - instr := mm.histogramFor(metric) - opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) - - var ended bool - start := time.Now() - return func() { - if ended { - return - } - ended = true - - end := time.Now() - - elapsed := end.Sub(start) - instr.Record(ctx, float64(elapsed)/1e9, opts...) - } -} - -func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { - return func(o *metrics.RecordMetricOptions) { - o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) - o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) - } -} - -type operationMetricsKey struct{} - -func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { - if _, ok := mp.(metrics.NopMeterProvider); ok { - // not using the metrics system - setting up the metrics context is a memory-intensive operation - // so we should skip it in this case - return parent, nil - } - - meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/costexplorer") - om := &operationMetrics{} - - var err error - - om.Duration, err = operationMetricTimer(meter, "client.call.duration", - "Overall call duration (including retries and time to send or receive request and response body)") - if err != nil { - return nil, err - } - om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", - "The time it takes to serialize a message body") - if err != nil { - return nil, err - } - om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", - "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") - if err != nil { - return nil, err - } - om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", - "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") - if err != nil { - return nil, err - } - om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", - "The time it takes to sign a request") - if err != nil { - return nil, err - } - om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", - "The time it takes to deserialize a message body") - if err != nil { - return nil, err - } - - return context.WithValue(parent, operationMetricsKey{}, om), nil -} - -func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { - return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { - o.UnitLabel = "s" - o.Description = desc - }) -} - -func getOperationMetrics(ctx context.Context) *operationMetrics { - if v := ctx.Value(operationMetricsKey{}); v != nil { - return v.(*operationMetrics) - } - return nil -} - -func operationTracer(p tracing.TracerProvider) tracing.Tracer { - return p.Tracer("github.com/aws/aws-sdk-go-v2/service/costexplorer") -} - -// Client provides the API client to make operations call for AWS Cost Explorer -// Service. -type Client struct { - options Options - - // Difference between the time reported by the server and the client - timeOffset *atomic.Int64 -} - -// New returns an initialized Client based on the functional options. Provide -// additional functional options to further configure the behavior of the client, -// such as changing the client's endpoint or adding custom middleware behavior. -func New(options Options, optFns ...func(*Options)) *Client { - options = options.Copy() - - resolveDefaultLogger(&options) - - setResolvedDefaultsMode(&options) - - resolveRetryer(&options) - - resolveHTTPClient(&options) - - resolveHTTPSignerV4(&options) - - resolveEndpointResolverV2(&options) - - resolveTracerProvider(&options) - - resolveMeterProvider(&options) - - resolveAuthSchemeResolver(&options) - - for _, fn := range optFns { - fn(&options) - } - - finalizeRetryMaxAttempts(&options) - - ignoreAnonymousAuth(&options) - - wrapWithAnonymousAuth(&options) - - resolveAuthSchemes(&options) - - client := &Client{ - options: options, - } - - initializeTimeOffsetResolver(client) - - return client -} - -// Options returns a copy of the client configuration. -// -// Callers SHOULD NOT perform mutations on any inner structures within client -// config. Config overrides should instead be made on a per-operation basis through -// functional options. -func (c *Client) Options() Options { - return c.options.Copy() -} - -func (c *Client) invokeOperation( - ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, -) ( - result interface{}, metadata middleware.Metadata, err error, -) { - ctx = middleware.ClearStackValues(ctx) - ctx = middleware.WithServiceID(ctx, ServiceID) - ctx = middleware.WithOperationName(ctx, opID) - - stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) - options := c.options.Copy() - - for _, fn := range optFns { - fn(&options) - } - - finalizeOperationRetryMaxAttempts(&options, *c) - - finalizeClientEndpointResolverOptions(&options) - - for _, fn := range stackFns { - if err := fn(stack, options); err != nil { - return nil, metadata, err - } - } - - for _, fn := range options.APIOptions { - if err := fn(stack); err != nil { - return nil, metadata, err - } - } - - ctx, err = withOperationMetrics(ctx, options.MeterProvider) - if err != nil { - return nil, metadata, err - } - - tracer := operationTracer(options.TracerProvider) - spanName := fmt.Sprintf("%s.%s", ServiceID, opID) - - ctx = tracing.WithOperationTracer(ctx, tracer) - - ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { - o.Kind = tracing.SpanKindClient - o.Properties.Set("rpc.system", "aws-api") - o.Properties.Set("rpc.method", opID) - o.Properties.Set("rpc.service", ServiceID) - }) - endTimer := startMetricTimer(ctx, "client.call.duration") - defer endTimer() - defer span.End() - - handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { - o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/costexplorer") - }) - decorated := middleware.DecorateHandler(handler, stack) - result, metadata, err = decorated.Handle(ctx, params) - if err != nil { - span.SetProperty("exception.type", fmt.Sprintf("%T", err)) - span.SetProperty("exception.message", err.Error()) - - var aerr smithy.APIError - if errors.As(err, &aerr) { - span.SetProperty("api.error_code", aerr.ErrorCode()) - span.SetProperty("api.error_message", aerr.ErrorMessage()) - span.SetProperty("api.error_fault", aerr.ErrorFault().String()) - } - - err = &smithy.OperationError{ - ServiceID: ServiceID, - OperationName: opID, - Err: err, - } - } - - span.SetProperty("error", err != nil) - if err == nil { - span.SetStatus(tracing.SpanStatusOK) - } else { - span.SetStatus(tracing.SpanStatusError) - } - - return result, metadata, err -} - -type operationInputKey struct{} - -func setOperationInput(ctx context.Context, input interface{}) context.Context { - return middleware.WithStackValue(ctx, operationInputKey{}, input) -} - -func getOperationInput(ctx context.Context) interface{} { - return middleware.GetStackValue(ctx, operationInputKey{}) -} - -type setOperationInputMiddleware struct { -} - -func (*setOperationInputMiddleware) ID() string { - return "setOperationInput" -} - -func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - ctx = setOperationInput(ctx, in.Parameters) - return next.HandleSerialize(ctx, in) -} - -func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { - if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { - return fmt.Errorf("add ResolveAuthScheme: %w", err) - } - if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { - return fmt.Errorf("add GetIdentity: %v", err) - } - if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { - return fmt.Errorf("add ResolveEndpointV2: %v", err) - } - if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { - return fmt.Errorf("add Signing: %w", err) - } - return nil -} -func resolveAuthSchemeResolver(options *Options) { - if options.AuthSchemeResolver == nil { - options.AuthSchemeResolver = &defaultAuthSchemeResolver{} - } -} - -func resolveAuthSchemes(options *Options) { - if options.AuthSchemes == nil { - options.AuthSchemes = []smithyhttp.AuthScheme{ - internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ - Signer: options.HTTPSignerV4, - Logger: options.Logger, - LogSigning: options.ClientLogMode.IsSigning(), - }), - } - } -} - -type noSmithyDocumentSerde = smithydocument.NoSerde - -type legacyEndpointContextSetter struct { - LegacyResolver EndpointResolver -} - -func (*legacyEndpointContextSetter) ID() string { - return "legacyEndpointContextSetter" -} - -func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.LegacyResolver != nil { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) - } - - return next.HandleInitialize(ctx, in) - -} -func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { - return stack.Initialize.Add(&legacyEndpointContextSetter{ - LegacyResolver: o.EndpointResolver, - }, middleware.Before) -} - -func resolveDefaultLogger(o *Options) { - if o.Logger != nil { - return - } - o.Logger = logging.Nop{} -} - -func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { - return middleware.AddSetLoggerMiddleware(stack, o.Logger) -} - -func setResolvedDefaultsMode(o *Options) { - if len(o.resolvedDefaultsMode) > 0 { - return - } - - var mode aws.DefaultsMode - mode.SetFromString(string(o.DefaultsMode)) - - if mode == aws.DefaultsModeAuto { - mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) - } - - o.resolvedDefaultsMode = mode -} - -// NewFromConfig returns a new client from the provided config. -func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { - opts := Options{ - Region: cfg.Region, - DefaultsMode: cfg.DefaultsMode, - RuntimeEnvironment: cfg.RuntimeEnvironment, - HTTPClient: cfg.HTTPClient, - Credentials: cfg.Credentials, - APIOptions: cfg.APIOptions, - Logger: cfg.Logger, - ClientLogMode: cfg.ClientLogMode, - AppID: cfg.AppID, - AuthSchemePreference: cfg.AuthSchemePreference, - } - resolveAWSRetryerProvider(cfg, &opts) - resolveAWSRetryMaxAttempts(cfg, &opts) - resolveAWSRetryMode(cfg, &opts) - resolveAWSEndpointResolver(cfg, &opts) - resolveInterceptors(cfg, &opts) - resolveUseDualStackEndpoint(cfg, &opts) - resolveUseFIPSEndpoint(cfg, &opts) - resolveBaseEndpoint(cfg, &opts) - return New(opts, func(o *Options) { - for _, opt := range cfg.ServiceOptions { - opt(ServiceID, o) - } - for _, opt := range optFns { - opt(o) - } - }) -} - -func resolveHTTPClient(o *Options) { - var buildable *awshttp.BuildableClient - - if o.HTTPClient != nil { - var ok bool - buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) - if !ok { - return - } - } else { - buildable = awshttp.NewBuildableClient() - } - - modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) - if err == nil { - buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { - if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { - dialer.Timeout = dialerTimeout - } - }) - - buildable = buildable.WithTransportOptions(func(transport *http.Transport) { - if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { - transport.TLSHandshakeTimeout = tlsHandshakeTimeout - } - }) - } - - o.HTTPClient = buildable -} - -func resolveRetryer(o *Options) { - if o.Retryer != nil { - return - } - - if len(o.RetryMode) == 0 { - modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) - if err == nil { - o.RetryMode = modeConfig.RetryMode - } - } - if len(o.RetryMode) == 0 { - o.RetryMode = aws.RetryModeStandard - } - - var standardOptions []func(*retry.StandardOptions) - if v := o.RetryMaxAttempts; v != 0 { - standardOptions = append(standardOptions, func(so *retry.StandardOptions) { - so.MaxAttempts = v - }) - } - - switch o.RetryMode { - case aws.RetryModeAdaptive: - var adaptiveOptions []func(*retry.AdaptiveModeOptions) - if len(standardOptions) != 0 { - adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { - ao.StandardOptions = append(ao.StandardOptions, standardOptions...) - }) - } - o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) - - default: - o.Retryer = retry.NewStandard(standardOptions...) - } -} - -func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { - if cfg.Retryer == nil { - return - } - o.Retryer = cfg.Retryer() -} - -func resolveAWSRetryMode(cfg aws.Config, o *Options) { - if len(cfg.RetryMode) == 0 { - return - } - o.RetryMode = cfg.RetryMode -} -func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { - if cfg.RetryMaxAttempts == 0 { - return - } - o.RetryMaxAttempts = cfg.RetryMaxAttempts -} - -func finalizeRetryMaxAttempts(o *Options) { - if o.RetryMaxAttempts == 0 { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func finalizeOperationRetryMaxAttempts(o *Options, client Client) { - if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { - if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { - return - } - o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) -} - -func resolveInterceptors(cfg aws.Config, o *Options) { - o.Interceptors = cfg.Interceptors.Copy() -} - -func addClientUserAgent(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "costexplorer", goModuleVersion) - if len(options.AppID) > 0 { - ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) - } - - return nil -} - -func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { - id := (*awsmiddleware.RequestUserAgent)(nil).ID() - mw, ok := stack.Build.Get(id) - if !ok { - mw = awsmiddleware.NewRequestUserAgent() - if err := stack.Build.Add(mw, middleware.After); err != nil { - return nil, err - } - } - - ua, ok := mw.(*awsmiddleware.RequestUserAgent) - if !ok { - return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) - } - - return ua, nil -} - -type HTTPSignerV4 interface { - SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error -} - -func resolveHTTPSignerV4(o *Options) { - if o.HTTPSignerV4 != nil { - return - } - o.HTTPSignerV4 = newDefaultV4Signer(*o) -} - -func newDefaultV4Signer(o Options) *v4.Signer { - return v4.NewSigner(func(so *v4.SignerOptions) { - so.Logger = o.Logger - so.LogSigning = o.ClientLogMode.IsSigning() - }) -} - -func addClientRequestID(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) -} - -func addComputeContentLength(stack *middleware.Stack) error { - return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) -} - -func addRawResponseToMetadata(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) -} - -func addRecordResponseTiming(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) -} - -func addSpanRetryLoop(stack *middleware.Stack, options Options) error { - return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) -} - -type spanRetryLoop struct { - options Options -} - -func (*spanRetryLoop) ID() string { - return "spanRetryLoop" -} - -func (m *spanRetryLoop) HandleFinalize( - ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - middleware.FinalizeOutput, middleware.Metadata, error, -) { - tracer := operationTracer(m.options.TracerProvider) - ctx, span := tracer.StartSpan(ctx, "RetryLoop") - defer span.End() - - return next.HandleFinalize(ctx, in) -} -func addStreamingEventsPayload(stack *middleware.Stack) error { - return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) -} - -func addUnsignedPayload(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) -} - -func addComputePayloadSHA256(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) -} - -func addContentSHA256Header(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) -} - -func addIsWaiterUserAgent(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) - return nil - }) -} - -func addIsPaginatorUserAgent(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) - return nil - }) -} - -func addRetry(stack *middleware.Stack, o Options) error { - attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { - m.LogAttempts = o.ClientLogMode.IsRetries() - m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/costexplorer") - }) - if err := stack.Finalize.Insert(attempt, "ResolveAuthScheme", middleware.Before); err != nil { - return err - } - if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { - return err - } - return nil -} - -// resolves dual-stack endpoint configuration -func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { - if len(cfg.ConfigSources) == 0 { - return nil - } - value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) - if err != nil { - return err - } - if found { - o.EndpointOptions.UseDualStackEndpoint = value - } - return nil -} - -// resolves FIPS endpoint configuration -func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { - if len(cfg.ConfigSources) == 0 { - return nil - } - value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) - if err != nil { - return err - } - if found { - o.EndpointOptions.UseFIPSEndpoint = value - } - return nil -} - -func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { - if mode == aws.AccountIDEndpointModeDisabled { - return nil - } - - if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { - return aws.String(ca.Credentials.AccountID) - } - - return nil -} - -func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { - mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} - if err := stack.Build.Add(&mw, middleware.After); err != nil { - return err - } - return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) -} -func initializeTimeOffsetResolver(c *Client) { - c.timeOffset = new(atomic.Int64) -} - -func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - switch options.Retryer.(type) { - case *retry.Standard: - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) - case *retry.AdaptiveMode: - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) - } - return nil -} - -type setCredentialSourceMiddleware struct { - ua *awsmiddleware.RequestUserAgent - options Options -} - -func (m setCredentialSourceMiddleware) ID() string { return "SetCredentialSourceMiddleware" } - -func (m setCredentialSourceMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, -) { - asProviderSource, ok := m.options.Credentials.(aws.CredentialProviderSource) - if !ok { - return next.HandleBuild(ctx, in) - } - providerSources := asProviderSource.ProviderSources() - for _, source := range providerSources { - m.ua.AddCredentialsSource(source) - } - return next.HandleBuild(ctx, in) -} - -func addCredentialSource(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - mw := setCredentialSourceMiddleware{ua: ua, options: options} - return stack.Build.Insert(&mw, "UserAgent", middleware.Before) -} - -func resolveTracerProvider(options *Options) { - if options.TracerProvider == nil { - options.TracerProvider = &tracing.NopTracerProvider{} - } -} - -func resolveMeterProvider(options *Options) { - if options.MeterProvider == nil { - options.MeterProvider = metrics.NopMeterProvider{} - } -} - -func addRecursionDetection(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) -} - -func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) - -} - -func addResponseErrorMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) - -} - -func addRequestResponseLogging(stack *middleware.Stack, o Options) error { - return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ - LogRequest: o.ClientLogMode.IsRequest(), - LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), - LogResponse: o.ClientLogMode.IsResponse(), - LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), - }, middleware.After) -} - -type disableHTTPSMiddleware struct { - DisableHTTPS bool -} - -func (*disableHTTPSMiddleware) ID() string { - return "disableHTTPS" -} - -func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { - req.URL.Scheme = "http" - } - - return next.HandleFinalize(ctx, in) -} - -func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { - return stack.Finalize.Insert(&disableHTTPSMiddleware{ - DisableHTTPS: o.EndpointOptions.DisableHTTPS, - }, "ResolveEndpointV2", middleware.After) -} - -func addInterceptBeforeRetryLoop(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptBeforeRetryLoop{ - Interceptors: opts.Interceptors.BeforeRetryLoop, - }, "Retry", middleware.Before) -} - -func addInterceptAttempt(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptAttempt{ - BeforeAttempt: opts.Interceptors.BeforeAttempt, - AfterAttempt: opts.Interceptors.AfterAttempt, - }, "Retry", middleware.After) -} - -func addInterceptors(stack *middleware.Stack, opts Options) error { - // middlewares are expensive, don't add all of these interceptor ones unless the caller - // actually has at least one interceptor configured - // - // at the moment it's all-or-nothing because some of the middlewares here are responsible for - // setting fields in the interceptor context for future ones - if len(opts.Interceptors.BeforeExecution) == 0 && - len(opts.Interceptors.BeforeSerialization) == 0 && len(opts.Interceptors.AfterSerialization) == 0 && - len(opts.Interceptors.BeforeRetryLoop) == 0 && - len(opts.Interceptors.BeforeAttempt) == 0 && - len(opts.Interceptors.BeforeSigning) == 0 && len(opts.Interceptors.AfterSigning) == 0 && - len(opts.Interceptors.BeforeTransmit) == 0 && len(opts.Interceptors.AfterTransmit) == 0 && - len(opts.Interceptors.BeforeDeserialization) == 0 && len(opts.Interceptors.AfterDeserialization) == 0 && - len(opts.Interceptors.AfterAttempt) == 0 && len(opts.Interceptors.AfterExecution) == 0 { - return nil - } - - return errors.Join( - stack.Initialize.Add(&smithyhttp.InterceptExecution{ - BeforeExecution: opts.Interceptors.BeforeExecution, - AfterExecution: opts.Interceptors.AfterExecution, - }, middleware.Before), - stack.Serialize.Insert(&smithyhttp.InterceptBeforeSerialization{ - Interceptors: opts.Interceptors.BeforeSerialization, - }, "OperationSerializer", middleware.Before), - stack.Serialize.Insert(&smithyhttp.InterceptAfterSerialization{ - Interceptors: opts.Interceptors.AfterSerialization, - }, "OperationSerializer", middleware.After), - stack.Finalize.Insert(&smithyhttp.InterceptBeforeSigning{ - Interceptors: opts.Interceptors.BeforeSigning, - }, "Signing", middleware.Before), - stack.Finalize.Insert(&smithyhttp.InterceptAfterSigning{ - Interceptors: opts.Interceptors.AfterSigning, - }, "Signing", middleware.After), - stack.Deserialize.Add(&smithyhttp.InterceptTransmit{ - BeforeTransmit: opts.Interceptors.BeforeTransmit, - AfterTransmit: opts.Interceptors.AfterTransmit, - }, middleware.After), - stack.Deserialize.Insert(&smithyhttp.InterceptBeforeDeserialization{ - Interceptors: opts.Interceptors.BeforeDeserialization, - }, "OperationDeserializer", middleware.After), // (deserialize stack is called in reverse) - stack.Deserialize.Insert(&smithyhttp.InterceptAfterDeserialization{ - Interceptors: opts.Interceptors.AfterDeserialization, - }, "OperationDeserializer", middleware.Before), - ) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_CreateAnomalyMonitor.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_CreateAnomalyMonitor.go deleted file mode 100644 index 12373c82e8..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_CreateAnomalyMonitor.go +++ /dev/null @@ -1,187 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a new cost anomaly detection monitor with the requested type and -// monitor specification. -func (c *Client) CreateAnomalyMonitor(ctx context.Context, params *CreateAnomalyMonitorInput, optFns ...func(*Options)) (*CreateAnomalyMonitorOutput, error) { - if params == nil { - params = &CreateAnomalyMonitorInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateAnomalyMonitor", params, optFns, c.addOperationCreateAnomalyMonitorMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateAnomalyMonitorOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateAnomalyMonitorInput struct { - - // The cost anomaly detection monitor object that you want to create. - // - // This member is required. - AnomalyMonitor *types.AnomalyMonitor - - // An optional list of tags to associate with the specified [AnomalyMonitor]AnomalyMonitor . You - // can use resource tags to control access to your monitor using IAM policies. - // - // Each tag consists of a key and a value, and each key must be unique for the - // resource. The following restrictions apply to resource tags: - // - // - Although the maximum number of array members is 200, you can assign a - // maximum of 50 user-tags to one resource. The remaining are reserved for Amazon - // Web Services use - // - // - The maximum length of a key is 128 characters - // - // - The maximum length of a value is 256 characters - // - // - Keys and values can only contain alphanumeric characters, spaces, and any - // of the following: _.:/=+@- - // - // - Keys and values are case sensitive - // - // - Keys and values are trimmed for any leading or trailing whitespaces - // - // - Don’t use aws: as a prefix for your keys. This prefix is reserved for Amazon - // Web Services use - // - // [AnomalyMonitor]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_AnomalyMonitor.html - ResourceTags []types.ResourceTag - - noSmithyDocumentSerde -} - -type CreateAnomalyMonitorOutput struct { - - // The unique identifier of your newly created cost anomaly detection monitor. - // - // This member is required. - MonitorArn *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateAnomalyMonitorMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAnomalyMonitor{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAnomalyMonitor{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateAnomalyMonitor"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateAnomalyMonitorValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAnomalyMonitor(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateAnomalyMonitor(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateAnomalyMonitor", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_CreateAnomalySubscription.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_CreateAnomalySubscription.go deleted file mode 100644 index e1d0f6cd48..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_CreateAnomalySubscription.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Adds an alert subscription to a cost anomaly detection monitor. You can use -// each subscription to define subscribers with email or SNS notifications. Email -// subscribers can set an absolute or percentage threshold and a time frequency for -// receiving notifications. -func (c *Client) CreateAnomalySubscription(ctx context.Context, params *CreateAnomalySubscriptionInput, optFns ...func(*Options)) (*CreateAnomalySubscriptionOutput, error) { - if params == nil { - params = &CreateAnomalySubscriptionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateAnomalySubscription", params, optFns, c.addOperationCreateAnomalySubscriptionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateAnomalySubscriptionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateAnomalySubscriptionInput struct { - - // The cost anomaly subscription object that you want to create. - // - // This member is required. - AnomalySubscription *types.AnomalySubscription - - // An optional list of tags to associate with the specified [AnomalySubscription]AnomalySubscription . - // You can use resource tags to control access to your subscription using IAM - // policies. - // - // Each tag consists of a key and a value, and each key must be unique for the - // resource. The following restrictions apply to resource tags: - // - // - Although the maximum number of array members is 200, you can assign a - // maximum of 50 user-tags to one resource. The remaining are reserved for Amazon - // Web Services use - // - // - The maximum length of a key is 128 characters - // - // - The maximum length of a value is 256 characters - // - // - Keys and values can only contain alphanumeric characters, spaces, and any - // of the following: _.:/=+@- - // - // - Keys and values are case sensitive - // - // - Keys and values are trimmed for any leading or trailing whitespaces - // - // - Don’t use aws: as a prefix for your keys. This prefix is reserved for Amazon - // Web Services use - // - // [AnomalySubscription]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_AnomalySubscription.html - ResourceTags []types.ResourceTag - - noSmithyDocumentSerde -} - -type CreateAnomalySubscriptionOutput struct { - - // The unique identifier of your newly created cost anomaly subscription. - // - // This member is required. - SubscriptionArn *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateAnomalySubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAnomalySubscription{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAnomalySubscription{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateAnomalySubscription"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateAnomalySubscriptionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAnomalySubscription(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateAnomalySubscription(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateAnomalySubscription", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_CreateCostCategoryDefinition.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_CreateCostCategoryDefinition.go deleted file mode 100644 index cb4d9c0bd5..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_CreateCostCategoryDefinition.go +++ /dev/null @@ -1,213 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a new cost category with the requested name and rules. -func (c *Client) CreateCostCategoryDefinition(ctx context.Context, params *CreateCostCategoryDefinitionInput, optFns ...func(*Options)) (*CreateCostCategoryDefinitionOutput, error) { - if params == nil { - params = &CreateCostCategoryDefinitionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateCostCategoryDefinition", params, optFns, c.addOperationCreateCostCategoryDefinitionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateCostCategoryDefinitionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateCostCategoryDefinitionInput struct { - - // The unique name of the cost category. - // - // This member is required. - Name *string - - // The rule schema version in this particular cost category. - // - // This member is required. - RuleVersion types.CostCategoryRuleVersion - - // The cost category rules used to categorize costs. For more information, see [CostCategoryRule]. - // - // [CostCategoryRule]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_CostCategoryRule.html - // - // This member is required. - Rules []types.CostCategoryRule - - // The default value for the cost category. - DefaultValue *string - - // The cost category's effective start date. It can only be a billing start date - // (first day of the month). If the date isn't provided, it's the first day of the - // current month. Dates can't be before the previous twelve months, or in the - // future. - EffectiveStart *string - - // An optional list of tags to associate with the specified [CostCategory]CostCategory . You can - // use resource tags to control access to your cost category using IAM policies. - // - // Each tag consists of a key and a value, and each key must be unique for the - // resource. The following restrictions apply to resource tags: - // - // - Although the maximum number of array members is 200, you can assign a - // maximum of 50 user-tags to one resource. The remaining are reserved for Amazon - // Web Services use - // - // - The maximum length of a key is 128 characters - // - // - The maximum length of a value is 256 characters - // - // - Keys and values can only contain alphanumeric characters, spaces, and any - // of the following: _.:/=+@- - // - // - Keys and values are case sensitive - // - // - Keys and values are trimmed for any leading or trailing whitespaces - // - // - Don’t use aws: as a prefix for your keys. This prefix is reserved for Amazon - // Web Services use - // - // [CostCategory]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_CostCategory.html - ResourceTags []types.ResourceTag - - // The split charge rules used to allocate your charges between your cost - // category values. - SplitChargeRules []types.CostCategorySplitChargeRule - - noSmithyDocumentSerde -} - -type CreateCostCategoryDefinitionOutput struct { - - // The unique identifier for your newly created cost category. - CostCategoryArn *string - - // The cost category's effective start date. It can only be a billing start date - // (first day of the month). - EffectiveStart *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateCostCategoryDefinitionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateCostCategoryDefinition{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateCostCategoryDefinition{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateCostCategoryDefinition"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateCostCategoryDefinitionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCostCategoryDefinition(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateCostCategoryDefinition(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateCostCategoryDefinition", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_DeleteAnomalyMonitor.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_DeleteAnomalyMonitor.go deleted file mode 100644 index 485a0d3940..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_DeleteAnomalyMonitor.go +++ /dev/null @@ -1,152 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a cost anomaly monitor. -func (c *Client) DeleteAnomalyMonitor(ctx context.Context, params *DeleteAnomalyMonitorInput, optFns ...func(*Options)) (*DeleteAnomalyMonitorOutput, error) { - if params == nil { - params = &DeleteAnomalyMonitorInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteAnomalyMonitor", params, optFns, c.addOperationDeleteAnomalyMonitorMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteAnomalyMonitorOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteAnomalyMonitorInput struct { - - // The unique identifier of the cost anomaly monitor that you want to delete. - // - // This member is required. - MonitorArn *string - - noSmithyDocumentSerde -} - -type DeleteAnomalyMonitorOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteAnomalyMonitorMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteAnomalyMonitor{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteAnomalyMonitor{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteAnomalyMonitor"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteAnomalyMonitorValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAnomalyMonitor(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteAnomalyMonitor(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteAnomalyMonitor", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_DeleteAnomalySubscription.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_DeleteAnomalySubscription.go deleted file mode 100644 index e78c0b09b9..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_DeleteAnomalySubscription.go +++ /dev/null @@ -1,152 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a cost anomaly subscription. -func (c *Client) DeleteAnomalySubscription(ctx context.Context, params *DeleteAnomalySubscriptionInput, optFns ...func(*Options)) (*DeleteAnomalySubscriptionOutput, error) { - if params == nil { - params = &DeleteAnomalySubscriptionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteAnomalySubscription", params, optFns, c.addOperationDeleteAnomalySubscriptionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteAnomalySubscriptionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteAnomalySubscriptionInput struct { - - // The unique identifier of the cost anomaly subscription that you want to delete. - // - // This member is required. - SubscriptionArn *string - - noSmithyDocumentSerde -} - -type DeleteAnomalySubscriptionOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteAnomalySubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteAnomalySubscription{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteAnomalySubscription{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteAnomalySubscription"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteAnomalySubscriptionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAnomalySubscription(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteAnomalySubscription(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteAnomalySubscription", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_DeleteCostCategoryDefinition.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_DeleteCostCategoryDefinition.go deleted file mode 100644 index 53b20b4a10..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_DeleteCostCategoryDefinition.go +++ /dev/null @@ -1,161 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes a cost category. Expenses from this month going forward will no longer -// be categorized with this cost category. -func (c *Client) DeleteCostCategoryDefinition(ctx context.Context, params *DeleteCostCategoryDefinitionInput, optFns ...func(*Options)) (*DeleteCostCategoryDefinitionOutput, error) { - if params == nil { - params = &DeleteCostCategoryDefinitionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteCostCategoryDefinition", params, optFns, c.addOperationDeleteCostCategoryDefinitionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteCostCategoryDefinitionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteCostCategoryDefinitionInput struct { - - // The unique identifier for your cost category. - // - // This member is required. - CostCategoryArn *string - - noSmithyDocumentSerde -} - -type DeleteCostCategoryDefinitionOutput struct { - - // The unique identifier for your cost category. - CostCategoryArn *string - - // The effective end date of the cost category as a result of deleting it. No - // costs after this date is categorized by the deleted cost category. - EffectiveEnd *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteCostCategoryDefinitionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteCostCategoryDefinition{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteCostCategoryDefinition{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteCostCategoryDefinition"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteCostCategoryDefinitionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCostCategoryDefinition(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteCostCategoryDefinition(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteCostCategoryDefinition", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_DescribeCostCategoryDefinition.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_DescribeCostCategoryDefinition.go deleted file mode 100644 index 7619e094af..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_DescribeCostCategoryDefinition.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns the name, Amazon Resource Name (ARN), rules, definition, and effective -// dates of a cost category that's defined in the account. -// -// You have the option to use EffectiveOn to return a cost category that's active -// on a specific date. If there's no EffectiveOn specified, you see a Cost -// Category that's effective on the current date. If cost category is still -// effective, EffectiveEnd is omitted in the response. -func (c *Client) DescribeCostCategoryDefinition(ctx context.Context, params *DescribeCostCategoryDefinitionInput, optFns ...func(*Options)) (*DescribeCostCategoryDefinitionOutput, error) { - if params == nil { - params = &DescribeCostCategoryDefinitionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeCostCategoryDefinition", params, optFns, c.addOperationDescribeCostCategoryDefinitionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeCostCategoryDefinitionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeCostCategoryDefinitionInput struct { - - // The unique identifier for your cost category. - // - // This member is required. - CostCategoryArn *string - - // The date when the cost category was effective. - EffectiveOn *string - - noSmithyDocumentSerde -} - -type DescribeCostCategoryDefinitionOutput struct { - - // The structure of Cost Categories. This includes detailed metadata and the set - // of rules for the CostCategory object. - CostCategory *types.CostCategory - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeCostCategoryDefinitionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeCostCategoryDefinition{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeCostCategoryDefinition{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeCostCategoryDefinition"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeCostCategoryDefinitionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCostCategoryDefinition(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeCostCategoryDefinition(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeCostCategoryDefinition", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetAnomalies.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetAnomalies.go deleted file mode 100644 index ba520f53fd..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetAnomalies.go +++ /dev/null @@ -1,279 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves all of the cost anomalies detected on your account during the time -// period that's specified by the DateInterval object. Anomalies are available for -// up to 90 days. -func (c *Client) GetAnomalies(ctx context.Context, params *GetAnomaliesInput, optFns ...func(*Options)) (*GetAnomaliesOutput, error) { - if params == nil { - params = &GetAnomaliesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetAnomalies", params, optFns, c.addOperationGetAnomaliesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetAnomaliesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetAnomaliesInput struct { - - // Assigns the start and end dates for retrieving cost anomalies. The returned - // anomaly object will have an AnomalyEndDate in the specified time range. - // - // This member is required. - DateInterval *types.AnomalyDateInterval - - // Filters anomaly results by the feedback field on the anomaly object. - Feedback types.AnomalyFeedbackType - - // The number of entries a paginated response contains. - MaxResults *int32 - - // Retrieves all of the cost anomalies detected for a specific cost anomaly - // monitor Amazon Resource Name (ARN). - MonitorArn *string - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextPageToken *string - - // Filters anomaly results by the total impact field on the anomaly object. For - // example, you can filter anomalies GREATER_THAN 200.00 to retrieve anomalies, - // with an estimated dollar impact greater than 200. - TotalImpact *types.TotalImpactFilter - - noSmithyDocumentSerde -} - -type GetAnomaliesOutput struct { - - // A list of cost anomalies. - // - // This member is required. - Anomalies []types.Anomaly - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextPageToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetAnomaliesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAnomalies{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetAnomalies{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetAnomalies"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetAnomaliesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAnomalies(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// GetAnomaliesPaginatorOptions is the paginator options for GetAnomalies -type GetAnomaliesPaginatorOptions struct { - // The number of entries a paginated response contains. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetAnomaliesPaginator is a paginator for GetAnomalies -type GetAnomaliesPaginator struct { - options GetAnomaliesPaginatorOptions - client GetAnomaliesAPIClient - params *GetAnomaliesInput - nextToken *string - firstPage bool -} - -// NewGetAnomaliesPaginator returns a new GetAnomaliesPaginator -func NewGetAnomaliesPaginator(client GetAnomaliesAPIClient, params *GetAnomaliesInput, optFns ...func(*GetAnomaliesPaginatorOptions)) *GetAnomaliesPaginator { - if params == nil { - params = &GetAnomaliesInput{} - } - - options := GetAnomaliesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetAnomaliesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextPageToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetAnomaliesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetAnomalies page. -func (p *GetAnomaliesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetAnomaliesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextPageToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetAnomalies(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextPageToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetAnomaliesAPIClient is a client that implements the GetAnomalies operation. -type GetAnomaliesAPIClient interface { - GetAnomalies(context.Context, *GetAnomaliesInput, ...func(*Options)) (*GetAnomaliesOutput, error) -} - -var _ GetAnomaliesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetAnomalies(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetAnomalies", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetAnomalyMonitors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetAnomalyMonitors.go deleted file mode 100644 index 07ed505600..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetAnomalyMonitors.go +++ /dev/null @@ -1,263 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves the cost anomaly monitor definitions for your account. You can filter -// using a list of cost anomaly monitor Amazon Resource Names (ARNs). -func (c *Client) GetAnomalyMonitors(ctx context.Context, params *GetAnomalyMonitorsInput, optFns ...func(*Options)) (*GetAnomalyMonitorsOutput, error) { - if params == nil { - params = &GetAnomalyMonitorsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetAnomalyMonitors", params, optFns, c.addOperationGetAnomalyMonitorsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetAnomalyMonitorsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetAnomalyMonitorsInput struct { - - // The number of entries that a paginated response contains. - MaxResults *int32 - - // A list of cost anomaly monitor ARNs. - MonitorArnList []string - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextPageToken *string - - noSmithyDocumentSerde -} - -type GetAnomalyMonitorsOutput struct { - - // A list of cost anomaly monitors that includes the detailed metadata for each - // monitor. - // - // This member is required. - AnomalyMonitors []types.AnomalyMonitor - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextPageToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetAnomalyMonitorsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAnomalyMonitors{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetAnomalyMonitors{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetAnomalyMonitors"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAnomalyMonitors(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// GetAnomalyMonitorsPaginatorOptions is the paginator options for -// GetAnomalyMonitors -type GetAnomalyMonitorsPaginatorOptions struct { - // The number of entries that a paginated response contains. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetAnomalyMonitorsPaginator is a paginator for GetAnomalyMonitors -type GetAnomalyMonitorsPaginator struct { - options GetAnomalyMonitorsPaginatorOptions - client GetAnomalyMonitorsAPIClient - params *GetAnomalyMonitorsInput - nextToken *string - firstPage bool -} - -// NewGetAnomalyMonitorsPaginator returns a new GetAnomalyMonitorsPaginator -func NewGetAnomalyMonitorsPaginator(client GetAnomalyMonitorsAPIClient, params *GetAnomalyMonitorsInput, optFns ...func(*GetAnomalyMonitorsPaginatorOptions)) *GetAnomalyMonitorsPaginator { - if params == nil { - params = &GetAnomalyMonitorsInput{} - } - - options := GetAnomalyMonitorsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetAnomalyMonitorsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextPageToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetAnomalyMonitorsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetAnomalyMonitors page. -func (p *GetAnomalyMonitorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetAnomalyMonitorsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextPageToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetAnomalyMonitors(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextPageToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetAnomalyMonitorsAPIClient is a client that implements the GetAnomalyMonitors -// operation. -type GetAnomalyMonitorsAPIClient interface { - GetAnomalyMonitors(context.Context, *GetAnomalyMonitorsInput, ...func(*Options)) (*GetAnomalyMonitorsOutput, error) -} - -var _ GetAnomalyMonitorsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetAnomalyMonitors(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetAnomalyMonitors", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetAnomalySubscriptions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetAnomalySubscriptions.go deleted file mode 100644 index d8c405be9c..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetAnomalySubscriptions.go +++ /dev/null @@ -1,267 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves the cost anomaly subscription objects for your account. You can -// filter using a list of cost anomaly monitor Amazon Resource Names (ARNs). -func (c *Client) GetAnomalySubscriptions(ctx context.Context, params *GetAnomalySubscriptionsInput, optFns ...func(*Options)) (*GetAnomalySubscriptionsOutput, error) { - if params == nil { - params = &GetAnomalySubscriptionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetAnomalySubscriptions", params, optFns, c.addOperationGetAnomalySubscriptionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetAnomalySubscriptionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetAnomalySubscriptionsInput struct { - - // The number of entries a paginated response contains. - MaxResults *int32 - - // Cost anomaly monitor ARNs. - MonitorArn *string - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextPageToken *string - - // A list of cost anomaly subscription ARNs. - SubscriptionArnList []string - - noSmithyDocumentSerde -} - -type GetAnomalySubscriptionsOutput struct { - - // A list of cost anomaly subscriptions that includes the detailed metadata for - // each one. - // - // This member is required. - AnomalySubscriptions []types.AnomalySubscription - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextPageToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetAnomalySubscriptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAnomalySubscriptions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetAnomalySubscriptions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetAnomalySubscriptions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAnomalySubscriptions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// GetAnomalySubscriptionsPaginatorOptions is the paginator options for -// GetAnomalySubscriptions -type GetAnomalySubscriptionsPaginatorOptions struct { - // The number of entries a paginated response contains. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetAnomalySubscriptionsPaginator is a paginator for GetAnomalySubscriptions -type GetAnomalySubscriptionsPaginator struct { - options GetAnomalySubscriptionsPaginatorOptions - client GetAnomalySubscriptionsAPIClient - params *GetAnomalySubscriptionsInput - nextToken *string - firstPage bool -} - -// NewGetAnomalySubscriptionsPaginator returns a new -// GetAnomalySubscriptionsPaginator -func NewGetAnomalySubscriptionsPaginator(client GetAnomalySubscriptionsAPIClient, params *GetAnomalySubscriptionsInput, optFns ...func(*GetAnomalySubscriptionsPaginatorOptions)) *GetAnomalySubscriptionsPaginator { - if params == nil { - params = &GetAnomalySubscriptionsInput{} - } - - options := GetAnomalySubscriptionsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetAnomalySubscriptionsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextPageToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetAnomalySubscriptionsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetAnomalySubscriptions page. -func (p *GetAnomalySubscriptionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetAnomalySubscriptionsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextPageToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetAnomalySubscriptions(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextPageToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetAnomalySubscriptionsAPIClient is a client that implements the -// GetAnomalySubscriptions operation. -type GetAnomalySubscriptionsAPIClient interface { - GetAnomalySubscriptions(context.Context, *GetAnomalySubscriptionsInput, ...func(*Options)) (*GetAnomalySubscriptionsOutput, error) -} - -var _ GetAnomalySubscriptionsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetAnomalySubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetAnomalySubscriptions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetApproximateUsageRecords.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetApproximateUsageRecords.go deleted file mode 100644 index b05a70c8ea..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetApproximateUsageRecords.go +++ /dev/null @@ -1,176 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves estimated usage records for hourly granularity or resource-level data -// at daily granularity. -func (c *Client) GetApproximateUsageRecords(ctx context.Context, params *GetApproximateUsageRecordsInput, optFns ...func(*Options)) (*GetApproximateUsageRecordsOutput, error) { - if params == nil { - params = &GetApproximateUsageRecordsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetApproximateUsageRecords", params, optFns, c.addOperationGetApproximateUsageRecordsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetApproximateUsageRecordsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetApproximateUsageRecordsInput struct { - - // The service to evaluate for the usage records. You can choose resource-level - // data at daily granularity, or hourly granularity with or without resource-level - // data. - // - // This member is required. - ApproximationDimension types.ApproximationDimension - - // How granular you want the data to be. You can enable data at hourly or daily - // granularity. - // - // This member is required. - Granularity types.Granularity - - // The service metadata for the service or services you want to query. If not - // specified, all elements are returned. - Services []string - - noSmithyDocumentSerde -} - -type GetApproximateUsageRecordsOutput struct { - - // The lookback period that's used for the estimation. - LookbackPeriod *types.DateInterval - - // The service metadata for the service or services in the response. - Services map[string]int64 - - // The total number of usage records for all services in the services list. - TotalRecords int64 - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetApproximateUsageRecordsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetApproximateUsageRecords{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetApproximateUsageRecords{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetApproximateUsageRecords"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetApproximateUsageRecordsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetApproximateUsageRecords(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetApproximateUsageRecords(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetApproximateUsageRecords", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCommitmentPurchaseAnalysis.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCommitmentPurchaseAnalysis.go deleted file mode 100644 index fc9e9a3fbb..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCommitmentPurchaseAnalysis.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves a commitment purchase analysis result based on the AnalysisId . -func (c *Client) GetCommitmentPurchaseAnalysis(ctx context.Context, params *GetCommitmentPurchaseAnalysisInput, optFns ...func(*Options)) (*GetCommitmentPurchaseAnalysisOutput, error) { - if params == nil { - params = &GetCommitmentPurchaseAnalysisInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetCommitmentPurchaseAnalysis", params, optFns, c.addOperationGetCommitmentPurchaseAnalysisMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetCommitmentPurchaseAnalysisOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetCommitmentPurchaseAnalysisInput struct { - - // The analysis ID that's associated with the commitment purchase analysis. - // - // This member is required. - AnalysisId *string - - noSmithyDocumentSerde -} - -type GetCommitmentPurchaseAnalysisOutput struct { - - // The analysis ID that's associated with the commitment purchase analysis. - // - // This member is required. - AnalysisId *string - - // The start time of the analysis. - // - // This member is required. - AnalysisStartedTime *string - - // The status of the analysis. - // - // This member is required. - AnalysisStatus types.AnalysisStatus - - // The configuration for the commitment purchase analysis. - // - // This member is required. - CommitmentPurchaseAnalysisConfiguration *types.CommitmentPurchaseAnalysisConfiguration - - // The estimated time for when the analysis will complete. - // - // This member is required. - EstimatedCompletionTime *string - - // The completion time of the analysis. - AnalysisCompletionTime *string - - // Details about the analysis. - AnalysisDetails *types.AnalysisDetails - - // The error code used for the analysis. - ErrorCode types.ErrorCode - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetCommitmentPurchaseAnalysisMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetCommitmentPurchaseAnalysis{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetCommitmentPurchaseAnalysis{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetCommitmentPurchaseAnalysis"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetCommitmentPurchaseAnalysisValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCommitmentPurchaseAnalysis(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetCommitmentPurchaseAnalysis(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetCommitmentPurchaseAnalysis", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCostAndUsage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCostAndUsage.go deleted file mode 100644 index 6944cfc148..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCostAndUsage.go +++ /dev/null @@ -1,247 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves cost and usage metrics for your account. You can specify which cost -// and usage-related metric that you want the request to return. For example, you -// can specify BlendedCosts or UsageQuantity . You can also filter and group your -// data by various dimensions, such as SERVICE or AZ , in a specific time range. -// For a complete list of valid dimensions, see the [GetDimensionValues]operation. Management account -// in an organization in Organizations have access to all member accounts. -// -// For information about filter limitations, see [Quotas and restrictions] in the Billing and Cost -// Management User Guide. -// -// [GetDimensionValues]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_GetDimensionValues.html -// [Quotas and restrictions]: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/billing-limits.html -func (c *Client) GetCostAndUsage(ctx context.Context, params *GetCostAndUsageInput, optFns ...func(*Options)) (*GetCostAndUsageOutput, error) { - if params == nil { - params = &GetCostAndUsageInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetCostAndUsage", params, optFns, c.addOperationGetCostAndUsageMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetCostAndUsageOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetCostAndUsageInput struct { - - // Sets the Amazon Web Services cost granularity to MONTHLY or DAILY , or HOURLY . - // If Granularity isn't set, the response object doesn't include the Granularity , - // either MONTHLY or DAILY , or HOURLY . - // - // This member is required. - Granularity types.Granularity - - // Which metrics are returned in the query. For more information about blended and - // unblended rates, see [Why does the "blended" annotation appear on some line items in my bill?]. - // - // Valid values are AmortizedCost , BlendedCost , NetAmortizedCost , - // NetUnblendedCost , NormalizedUsageAmount , UnblendedCost , and UsageQuantity . - // - // If you return the UsageQuantity metric, the service aggregates all usage - // numbers without taking into account the units. For example, if you aggregate - // usageQuantity across all of Amazon EC2, the results aren't meaningful because - // Amazon EC2 compute hours and data transfer are measured in different units (for - // example, hours and GB). To get more meaningful UsageQuantity metrics, filter by - // UsageType or UsageTypeGroups . - // - // Metrics is required for GetCostAndUsage requests. - // - // [Why does the "blended" annotation appear on some line items in my bill?]: http://aws.amazon.com/premiumsupport/knowledge-center/blended-rates-intro/ - // - // This member is required. - Metrics []string - - // Sets the start date and end date for retrieving Amazon Web Services costs. The - // start date is inclusive, but the end date is exclusive. For example, if start - // is 2017-01-01 and end is 2017-05-01 , then the cost and usage data is retrieved - // from 2017-01-01 up to and including 2017-04-30 but not including 2017-05-01 . - // - // This member is required. - TimePeriod *types.DateInterval - - // The Amazon Resource Name (ARN) that uniquely identifies a specific billing - // view. The ARN is used to specify which particular billing view you want to - // interact with or retrieve information from when making API calls related to - // Amazon Web Services Billing and Cost Management features. The BillingViewArn can - // be retrieved by calling the ListBillingViews API. - BillingViewArn *string - - // Filters Amazon Web Services costs by different dimensions. For example, you can - // specify SERVICE and LINKED_ACCOUNT and get the costs that are associated with - // that account's usage of that service. You can nest Expression objects to define - // any combination of dimension filters. For more information, see [Expression]. - // - // Valid values for MatchOptions for Dimensions are EQUALS and CASE_SENSITIVE . - // - // Valid values for MatchOptions for CostCategories and Tags are EQUALS , ABSENT , - // and CASE_SENSITIVE . Default values are EQUALS and CASE_SENSITIVE . - // - // [Expression]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html - Filter *types.Expression - - // You can group Amazon Web Services costs using up to two different groups, - // either dimensions, tag keys, cost categories, or any two group by types. - // - // Valid values for the DIMENSION type are AZ , INSTANCE_TYPE , LEGAL_ENTITY_NAME , - // INVOICING_ENTITY , LINKED_ACCOUNT , OPERATION , PLATFORM , PURCHASE_TYPE , - // SERVICE , TENANCY , RECORD_TYPE , and USAGE_TYPE . - // - // When you group by the TAG type and include a valid tag key, you get all tag - // values, including empty strings. - GroupBy []types.GroupDefinition - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextPageToken *string - - noSmithyDocumentSerde -} - -type GetCostAndUsageOutput struct { - - // The attributes that apply to a specific dimension value. For example, if the - // value is a linked account, the attribute is that account name. - DimensionValueAttributes []types.DimensionValuesWithAttributes - - // The groups that are specified by the Filter or GroupBy parameters in the - // request. - GroupDefinitions []types.GroupDefinition - - // The token for the next set of retrievable results. Amazon Web Services provides - // the token when the response from a previous call has more results than the - // maximum page size. - NextPageToken *string - - // The time period that's covered by the results in the response. - ResultsByTime []types.ResultByTime - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetCostAndUsageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetCostAndUsage{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetCostAndUsage{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetCostAndUsage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetCostAndUsageValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCostAndUsage(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetCostAndUsage(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetCostAndUsage", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCostAndUsageComparisons.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCostAndUsageComparisons.go deleted file mode 100644 index 1fac486d8e..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCostAndUsageComparisons.go +++ /dev/null @@ -1,375 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves cost and usage comparisons for your account between two periods -// within the last 13 months. If you have enabled multi-year data at monthly -// granularity, you can go back up to 38 months. -func (c *Client) GetCostAndUsageComparisons(ctx context.Context, params *GetCostAndUsageComparisonsInput, optFns ...func(*Options)) (*GetCostAndUsageComparisonsOutput, error) { - if params == nil { - params = &GetCostAndUsageComparisonsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetCostAndUsageComparisons", params, optFns, c.addOperationGetCostAndUsageComparisonsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetCostAndUsageComparisonsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetCostAndUsageComparisonsInput struct { - - // The reference time period for comparison. This time period serves as the - // baseline against which other cost and usage data will be compared. The interval - // must start and end on the first day of a month, with a duration of exactly one - // month. - // - // This member is required. - BaselineTimePeriod *types.DateInterval - - // The comparison time period for analysis. This time period's cost and usage data - // will be compared against the baseline time period. The interval must start and - // end on the first day of a month, with a duration of exactly one month. - // - // This member is required. - ComparisonTimePeriod *types.DateInterval - - // The cost and usage metric to compare. Valid values are AmortizedCost , - // BlendedCost , NetAmortizedCost , NetUnblendedCost , NormalizedUsageAmount , - // UnblendedCost , and UsageQuantity . - // - // This member is required. - MetricForComparison *string - - // The Amazon Resource Name (ARN) that uniquely identifies a specific billing - // view. The ARN is used to specify which particular billing view you want to - // interact with or retrieve information from when making API calls related to - // Amazon Web Services Billing and Cost Management features. The BillingViewArn can - // be retrieved by calling the ListBillingViews API. - BillingViewArn *string - - // Use Expression to filter in various Cost Explorer APIs. - // - // Not all Expression types are supported in each API. Refer to the documentation - // for each specific API to see what is supported. - // - // There are two patterns: - // - // - Simple dimension values. - // - // - There are three types of simple dimension values: CostCategories , Tags , - // and Dimensions . - // - // - Specify the CostCategories field to define a filter that acts on Cost - // Categories. - // - // - Specify the Tags field to define a filter that acts on Cost Allocation Tags. - // - // - Specify the Dimensions field to define a filter that acts on the [DimensionValues] - // DimensionValues . - // - // - For each filter type, you can set the dimension name and values for the - // filters that you plan to use. - // - // - For example, you can filter for REGION==us-east-1 OR REGION==us-west-1 . For - // GetRightsizingRecommendation , the Region is a full name (for example, - // REGION==US East (N. Virginia) . - // - // - The corresponding Expression for this example is as follows: { - // "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] } } - // - // - As shown in the previous example, lists of dimension values are combined - // with OR when applying the filter. - // - // - You can also set different match options to further control how the filter - // behaves. Not all APIs support match options. Refer to the documentation for each - // specific API to see what is supported. - // - // - For example, you can filter for linked account names that start with "a". - // - // - The corresponding Expression for this example is as follows: { - // "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": [ "STARTS_WITH" ], - // "Values": [ "a" ] } } - // - // - Compound Expression types with logical operations. - // - // - You can use multiple Expression types and the logical operators AND/OR/NOT - // to create a list of one or more Expression objects. By doing this, you can - // filter by more advanced options. - // - // - For example, you can filter by ((REGION == us-east-1 OR REGION == - // us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer) . - // - // - The corresponding Expression for this example is as follows: { "And": [ - // {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" - // ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": - // {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] } - // - // Because each Expression can have only one operator, the service returns an error - // if more than one is specified. The following example shows an Expression - // object that creates an error: { "And": [ ... ], "Dimensions": { "Key": - // "USAGE_TYPE", "Values": [ "DataTransfer" ] } } - // - // The following is an example of the corresponding error message: "Expression has - // more than one roots. Only one root operator is allowed for each expression: And, - // Or, Not, Dimensions, Tags, CostCategories" - // - // For the GetRightsizingRecommendation action, a combination of OR and NOT isn't - // supported. OR isn't supported between different dimensions, or dimensions and - // tags. NOT operators aren't supported. Dimensions are also limited to - // LINKED_ACCOUNT , REGION , or RIGHTSIZING_TYPE . - // - // For the GetReservationPurchaseRecommendation action, only NOT is supported. AND - // and OR aren't supported. Dimensions are limited to LINKED_ACCOUNT . - // - // [DimensionValues]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html - Filter *types.Expression - - // You can group results using the attributes DIMENSION , TAG , and COST_CATEGORY . - GroupBy []types.GroupDefinition - - // The maximum number of results that are returned for the request. - MaxResults *int32 - - // The token to retrieve the next set of paginated results. - NextPageToken *string - - noSmithyDocumentSerde -} - -type GetCostAndUsageComparisonsOutput struct { - - // An array of comparison results showing cost and usage metrics between - // BaselineTimePeriod and ComparisonTimePeriod . - CostAndUsageComparisons []types.CostAndUsageComparison - - // The token to retrieve the next set of paginated results. - NextPageToken *string - - // A summary of the total cost and usage, comparing amounts between - // BaselineTimePeriod and ComparisonTimePeriod and their differences. This total - // represents the aggregate total across all paginated results, if the response - // spans multiple pages. - TotalCostAndUsage map[string]types.ComparisonMetricValue - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetCostAndUsageComparisonsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetCostAndUsageComparisons{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetCostAndUsageComparisons{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetCostAndUsageComparisons"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetCostAndUsageComparisonsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCostAndUsageComparisons(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// GetCostAndUsageComparisonsPaginatorOptions is the paginator options for -// GetCostAndUsageComparisons -type GetCostAndUsageComparisonsPaginatorOptions struct { - // The maximum number of results that are returned for the request. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetCostAndUsageComparisonsPaginator is a paginator for -// GetCostAndUsageComparisons -type GetCostAndUsageComparisonsPaginator struct { - options GetCostAndUsageComparisonsPaginatorOptions - client GetCostAndUsageComparisonsAPIClient - params *GetCostAndUsageComparisonsInput - nextToken *string - firstPage bool -} - -// NewGetCostAndUsageComparisonsPaginator returns a new -// GetCostAndUsageComparisonsPaginator -func NewGetCostAndUsageComparisonsPaginator(client GetCostAndUsageComparisonsAPIClient, params *GetCostAndUsageComparisonsInput, optFns ...func(*GetCostAndUsageComparisonsPaginatorOptions)) *GetCostAndUsageComparisonsPaginator { - if params == nil { - params = &GetCostAndUsageComparisonsInput{} - } - - options := GetCostAndUsageComparisonsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetCostAndUsageComparisonsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextPageToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetCostAndUsageComparisonsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetCostAndUsageComparisons page. -func (p *GetCostAndUsageComparisonsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCostAndUsageComparisonsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextPageToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetCostAndUsageComparisons(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextPageToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetCostAndUsageComparisonsAPIClient is a client that implements the -// GetCostAndUsageComparisons operation. -type GetCostAndUsageComparisonsAPIClient interface { - GetCostAndUsageComparisons(context.Context, *GetCostAndUsageComparisonsInput, ...func(*Options)) (*GetCostAndUsageComparisonsOutput, error) -} - -var _ GetCostAndUsageComparisonsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetCostAndUsageComparisons(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetCostAndUsageComparisons", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCostAndUsageWithResources.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCostAndUsageWithResources.go deleted file mode 100644 index 70ad651ca4..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCostAndUsageWithResources.go +++ /dev/null @@ -1,252 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves cost and usage metrics with resources for your account. You can -// specify which cost and usage-related metric, such as BlendedCosts or -// UsageQuantity , that you want the request to return. You can also filter and -// group your data by various dimensions, such as SERVICE or AZ , in a specific -// time range. For a complete list of valid dimensions, see the [GetDimensionValues]operation. -// Management account in an organization in Organizations have access to all member -// accounts. -// -// Hourly granularity is only available for EC2-Instances (Elastic Compute Cloud) -// resource-level data. All other resource-level data is available at daily -// granularity. -// -// This is an opt-in only feature. You can enable this feature from the Cost -// Explorer Settings page. For information about how to access the Settings page, -// see [Controlling Access for Cost Explorer]in the Billing and Cost Management User Guide. -// -// [GetDimensionValues]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_GetDimensionValues.html -// [Controlling Access for Cost Explorer]: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/ce-access.html -func (c *Client) GetCostAndUsageWithResources(ctx context.Context, params *GetCostAndUsageWithResourcesInput, optFns ...func(*Options)) (*GetCostAndUsageWithResourcesOutput, error) { - if params == nil { - params = &GetCostAndUsageWithResourcesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetCostAndUsageWithResources", params, optFns, c.addOperationGetCostAndUsageWithResourcesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetCostAndUsageWithResourcesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetCostAndUsageWithResourcesInput struct { - - // Filters Amazon Web Services costs by different dimensions. For example, you can - // specify SERVICE and LINKED_ACCOUNT and get the costs that are associated with - // that account's usage of that service. You can nest Expression objects to define - // any combination of dimension filters. For more information, see [Expression]. - // - // The GetCostAndUsageWithResources operation requires that you either group by or - // filter by a ResourceId . It requires the [Expression]"SERVICE = Amazon Elastic Compute - // Cloud - Compute" in the filter. - // - // Valid values for MatchOptions for Dimensions are EQUALS and CASE_SENSITIVE . - // - // Valid values for MatchOptions for CostCategories and Tags are EQUALS , ABSENT , - // and CASE_SENSITIVE . Default values are EQUALS and CASE_SENSITIVE . - // - // [Expression]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html - // - // This member is required. - Filter *types.Expression - - // Sets the Amazon Web Services cost granularity to MONTHLY , DAILY , or HOURLY . - // If Granularity isn't set, the response object doesn't include the Granularity , - // MONTHLY , DAILY , or HOURLY . - // - // This member is required. - Granularity types.Granularity - - // Sets the start and end dates for retrieving Amazon Web Services costs. The - // range must be within the last 14 days (the start date cannot be earlier than 14 - // days ago). The start date is inclusive, but the end date is exclusive. For - // example, if start is 2017-01-01 and end is 2017-05-01 , then the cost and usage - // data is retrieved from 2017-01-01 up to and including 2017-04-30 but not - // including 2017-05-01 . - // - // This member is required. - TimePeriod *types.DateInterval - - // The Amazon Resource Name (ARN) that uniquely identifies a specific billing - // view. The ARN is used to specify which particular billing view you want to - // interact with or retrieve information from when making API calls related to - // Amazon Web Services Billing and Cost Management features. The BillingViewArn can - // be retrieved by calling the ListBillingViews API. - BillingViewArn *string - - // You can group Amazon Web Services costs using up to two different groups: - // DIMENSION , TAG , COST_CATEGORY . - GroupBy []types.GroupDefinition - - // Which metrics are returned in the query. For more information about blended and - // unblended rates, see [Why does the "blended" annotation appear on some line items in my bill?]. - // - // Valid values are AmortizedCost , BlendedCost , NetAmortizedCost , - // NetUnblendedCost , NormalizedUsageAmount , UnblendedCost , and UsageQuantity . - // - // If you return the UsageQuantity metric, the service aggregates all usage - // numbers without taking the units into account. For example, if you aggregate - // usageQuantity across all of Amazon EC2, the results aren't meaningful because - // Amazon EC2 compute hours and data transfer are measured in different units (for - // example, hour or GB). To get more meaningful UsageQuantity metrics, filter by - // UsageType or UsageTypeGroups . - // - // Metrics is required for GetCostAndUsageWithResources requests. - // - // [Why does the "blended" annotation appear on some line items in my bill?]: http://aws.amazon.com/premiumsupport/knowledge-center/blended-rates-intro/ - Metrics []string - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextPageToken *string - - noSmithyDocumentSerde -} - -type GetCostAndUsageWithResourcesOutput struct { - - // The attributes that apply to a specific dimension value. For example, if the - // value is a linked account, the attribute is that account name. - DimensionValueAttributes []types.DimensionValuesWithAttributes - - // The groups that are specified by the Filter or GroupBy parameters in the - // request. - GroupDefinitions []types.GroupDefinition - - // The token for the next set of retrievable results. Amazon Web Services provides - // the token when the response from a previous call has more results than the - // maximum page size. - NextPageToken *string - - // The time period that's covered by the results in the response. - ResultsByTime []types.ResultByTime - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetCostAndUsageWithResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetCostAndUsageWithResources{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetCostAndUsageWithResources{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetCostAndUsageWithResources"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetCostAndUsageWithResourcesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCostAndUsageWithResources(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetCostAndUsageWithResources(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetCostAndUsageWithResources", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCostCategories.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCostCategories.go deleted file mode 100644 index 1eb6740046..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCostCategories.go +++ /dev/null @@ -1,317 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves an array of cost category names and values incurred cost. -// -// If some cost category names and values are not associated with any cost, they -// will not be returned by this API. -func (c *Client) GetCostCategories(ctx context.Context, params *GetCostCategoriesInput, optFns ...func(*Options)) (*GetCostCategoriesOutput, error) { - if params == nil { - params = &GetCostCategoriesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetCostCategories", params, optFns, c.addOperationGetCostCategoriesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetCostCategoriesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetCostCategoriesInput struct { - - // The time period of the request. - // - // This member is required. - TimePeriod *types.DateInterval - - // The Amazon Resource Name (ARN) that uniquely identifies a specific billing - // view. The ARN is used to specify which particular billing view you want to - // interact with or retrieve information from when making API calls related to - // Amazon Web Services Billing and Cost Management features. The BillingViewArn can - // be retrieved by calling the ListBillingViews API. - BillingViewArn *string - - // The unique name of the cost category. - CostCategoryName *string - - // Use Expression to filter in various Cost Explorer APIs. - // - // Not all Expression types are supported in each API. Refer to the documentation - // for each specific API to see what is supported. - // - // There are two patterns: - // - // - Simple dimension values. - // - // - There are three types of simple dimension values: CostCategories , Tags , - // and Dimensions . - // - // - Specify the CostCategories field to define a filter that acts on Cost - // Categories. - // - // - Specify the Tags field to define a filter that acts on Cost Allocation Tags. - // - // - Specify the Dimensions field to define a filter that acts on the [DimensionValues] - // DimensionValues . - // - // - For each filter type, you can set the dimension name and values for the - // filters that you plan to use. - // - // - For example, you can filter for REGION==us-east-1 OR REGION==us-west-1 . For - // GetRightsizingRecommendation , the Region is a full name (for example, - // REGION==US East (N. Virginia) . - // - // - The corresponding Expression for this example is as follows: { - // "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] } } - // - // - As shown in the previous example, lists of dimension values are combined - // with OR when applying the filter. - // - // - You can also set different match options to further control how the filter - // behaves. Not all APIs support match options. Refer to the documentation for each - // specific API to see what is supported. - // - // - For example, you can filter for linked account names that start with "a". - // - // - The corresponding Expression for this example is as follows: { - // "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": [ "STARTS_WITH" ], - // "Values": [ "a" ] } } - // - // - Compound Expression types with logical operations. - // - // - You can use multiple Expression types and the logical operators AND/OR/NOT - // to create a list of one or more Expression objects. By doing this, you can - // filter by more advanced options. - // - // - For example, you can filter by ((REGION == us-east-1 OR REGION == - // us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer) . - // - // - The corresponding Expression for this example is as follows: { "And": [ - // {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" - // ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": - // {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] } - // - // Because each Expression can have only one operator, the service returns an error - // if more than one is specified. The following example shows an Expression - // object that creates an error: { "And": [ ... ], "Dimensions": { "Key": - // "USAGE_TYPE", "Values": [ "DataTransfer" ] } } - // - // The following is an example of the corresponding error message: "Expression has - // more than one roots. Only one root operator is allowed for each expression: And, - // Or, Not, Dimensions, Tags, CostCategories" - // - // For the GetRightsizingRecommendation action, a combination of OR and NOT isn't - // supported. OR isn't supported between different dimensions, or dimensions and - // tags. NOT operators aren't supported. Dimensions are also limited to - // LINKED_ACCOUNT , REGION , or RIGHTSIZING_TYPE . - // - // For the GetReservationPurchaseRecommendation action, only NOT is supported. AND - // and OR aren't supported. Dimensions are limited to LINKED_ACCOUNT . - // - // [DimensionValues]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html - Filter *types.Expression - - // This field is only used when the SortBy value is provided in the request. - // - // The maximum number of objects that are returned for this request. If MaxResults - // isn't specified with the SortBy value, the request returns 1000 results as the - // default value for this parameter. - // - // For GetCostCategories , MaxResults has an upper quota of 1000. - MaxResults *int32 - - // If the number of objects that are still available for retrieval exceeds the - // quota, Amazon Web Services returns a NextPageToken value in the response. To - // retrieve the next batch of objects, provide the NextPageToken from the previous - // call in your next request. - NextPageToken *string - - // The value that you want to search the filter values for. - // - // If you don't specify a CostCategoryName , SearchString is used to filter cost - // category names that match the SearchString pattern. If you specify a - // CostCategoryName , SearchString is used to filter cost category values that - // match the SearchString pattern. - SearchString *string - - // The value that you sort the data by. - // - // The key represents the cost and usage metrics. The following values are - // supported: - // - // - BlendedCost - // - // - UnblendedCost - // - // - AmortizedCost - // - // - NetAmortizedCost - // - // - NetUnblendedCost - // - // - UsageQuantity - // - // - NormalizedUsageAmount - // - // The supported key values for the SortOrder value are ASCENDING and DESCENDING . - // - // When you use the SortBy value, the NextPageToken and SearchString key values - // aren't supported. - SortBy []types.SortDefinition - - noSmithyDocumentSerde -} - -type GetCostCategoriesOutput struct { - - // The number of objects that are returned. - // - // This member is required. - ReturnSize *int32 - - // The total number of objects. - // - // This member is required. - TotalSize *int32 - - // The names of the cost categories. - CostCategoryNames []string - - // The cost category values. - // - // If the CostCategoryName key isn't specified in the request, the - // CostCategoryValues fields aren't returned. - CostCategoryValues []string - - // If the number of objects that are still available for retrieval exceeds the - // quota, Amazon Web Services returns a NextPageToken value in the response. To - // retrieve the next batch of objects, provide the marker from the prior call in - // your next request. - NextPageToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetCostCategoriesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetCostCategories{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetCostCategories{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetCostCategories"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetCostCategoriesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCostCategories(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetCostCategories(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetCostCategories", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCostComparisonDrivers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCostComparisonDrivers.go deleted file mode 100644 index 8c6f803039..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCostComparisonDrivers.go +++ /dev/null @@ -1,371 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves key factors driving cost changes between two time periods within the -// last 13 months, such as usage changes, discount changes, and commitment-based -// savings. If you have enabled multi-year data at monthly granularity, you can go -// back up to 38 months. -func (c *Client) GetCostComparisonDrivers(ctx context.Context, params *GetCostComparisonDriversInput, optFns ...func(*Options)) (*GetCostComparisonDriversOutput, error) { - if params == nil { - params = &GetCostComparisonDriversInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetCostComparisonDrivers", params, optFns, c.addOperationGetCostComparisonDriversMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetCostComparisonDriversOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetCostComparisonDriversInput struct { - - // The reference time period for comparison. This time period serves as the - // baseline against which other cost and usage data will be compared. The interval - // must start and end on the first day of a month, with a duration of exactly one - // month. - // - // This member is required. - BaselineTimePeriod *types.DateInterval - - // The comparison time period for analysis. This time period's cost and usage data - // will be compared against the baseline time period. The interval must start and - // end on the first day of a month, with a duration of exactly one month. - // - // This member is required. - ComparisonTimePeriod *types.DateInterval - - // The cost and usage metric to compare. Valid values are AmortizedCost , - // BlendedCost , NetAmortizedCost , NetUnblendedCost , NormalizedUsageAmount , - // UnblendedCost , and UsageQuantity . - // - // This member is required. - MetricForComparison *string - - // The Amazon Resource Name (ARN) that uniquely identifies a specific billing - // view. The ARN is used to specify which particular billing view you want to - // interact with or retrieve information from when making API calls related to - // Amazon Web Services Billing and Cost Management features. The BillingViewArn can - // be retrieved by calling the ListBillingViews API. - BillingViewArn *string - - // Use Expression to filter in various Cost Explorer APIs. - // - // Not all Expression types are supported in each API. Refer to the documentation - // for each specific API to see what is supported. - // - // There are two patterns: - // - // - Simple dimension values. - // - // - There are three types of simple dimension values: CostCategories , Tags , - // and Dimensions . - // - // - Specify the CostCategories field to define a filter that acts on Cost - // Categories. - // - // - Specify the Tags field to define a filter that acts on Cost Allocation Tags. - // - // - Specify the Dimensions field to define a filter that acts on the [DimensionValues] - // DimensionValues . - // - // - For each filter type, you can set the dimension name and values for the - // filters that you plan to use. - // - // - For example, you can filter for REGION==us-east-1 OR REGION==us-west-1 . For - // GetRightsizingRecommendation , the Region is a full name (for example, - // REGION==US East (N. Virginia) . - // - // - The corresponding Expression for this example is as follows: { - // "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] } } - // - // - As shown in the previous example, lists of dimension values are combined - // with OR when applying the filter. - // - // - You can also set different match options to further control how the filter - // behaves. Not all APIs support match options. Refer to the documentation for each - // specific API to see what is supported. - // - // - For example, you can filter for linked account names that start with "a". - // - // - The corresponding Expression for this example is as follows: { - // "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": [ "STARTS_WITH" ], - // "Values": [ "a" ] } } - // - // - Compound Expression types with logical operations. - // - // - You can use multiple Expression types and the logical operators AND/OR/NOT - // to create a list of one or more Expression objects. By doing this, you can - // filter by more advanced options. - // - // - For example, you can filter by ((REGION == us-east-1 OR REGION == - // us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer) . - // - // - The corresponding Expression for this example is as follows: { "And": [ - // {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" - // ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": - // {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] } - // - // Because each Expression can have only one operator, the service returns an error - // if more than one is specified. The following example shows an Expression - // object that creates an error: { "And": [ ... ], "Dimensions": { "Key": - // "USAGE_TYPE", "Values": [ "DataTransfer" ] } } - // - // The following is an example of the corresponding error message: "Expression has - // more than one roots. Only one root operator is allowed for each expression: And, - // Or, Not, Dimensions, Tags, CostCategories" - // - // For the GetRightsizingRecommendation action, a combination of OR and NOT isn't - // supported. OR isn't supported between different dimensions, or dimensions and - // tags. NOT operators aren't supported. Dimensions are also limited to - // LINKED_ACCOUNT , REGION , or RIGHTSIZING_TYPE . - // - // For the GetReservationPurchaseRecommendation action, only NOT is supported. AND - // and OR aren't supported. Dimensions are limited to LINKED_ACCOUNT . - // - // [DimensionValues]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html - Filter *types.Expression - - // You can group results using the attributes DIMENSION , TAG , and COST_CATEGORY . - // Note that SERVICE and USAGE_TYPE dimensions are automatically included in the - // cost comparison drivers analysis. - GroupBy []types.GroupDefinition - - // The maximum number of results that are returned for the request. - MaxResults *int32 - - // The token to retrieve the next set of paginated results. - NextPageToken *string - - noSmithyDocumentSerde -} - -type GetCostComparisonDriversOutput struct { - - // An array of comparison results showing factors that drive significant cost - // differences between BaselineTimePeriod and ComparisonTimePeriod . - CostComparisonDrivers []types.CostComparisonDriver - - // The token to retrieve the next set of paginated results. - NextPageToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetCostComparisonDriversMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetCostComparisonDrivers{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetCostComparisonDrivers{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetCostComparisonDrivers"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetCostComparisonDriversValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCostComparisonDrivers(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// GetCostComparisonDriversPaginatorOptions is the paginator options for -// GetCostComparisonDrivers -type GetCostComparisonDriversPaginatorOptions struct { - // The maximum number of results that are returned for the request. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetCostComparisonDriversPaginator is a paginator for GetCostComparisonDrivers -type GetCostComparisonDriversPaginator struct { - options GetCostComparisonDriversPaginatorOptions - client GetCostComparisonDriversAPIClient - params *GetCostComparisonDriversInput - nextToken *string - firstPage bool -} - -// NewGetCostComparisonDriversPaginator returns a new -// GetCostComparisonDriversPaginator -func NewGetCostComparisonDriversPaginator(client GetCostComparisonDriversAPIClient, params *GetCostComparisonDriversInput, optFns ...func(*GetCostComparisonDriversPaginatorOptions)) *GetCostComparisonDriversPaginator { - if params == nil { - params = &GetCostComparisonDriversInput{} - } - - options := GetCostComparisonDriversPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetCostComparisonDriversPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextPageToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetCostComparisonDriversPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetCostComparisonDrivers page. -func (p *GetCostComparisonDriversPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetCostComparisonDriversOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextPageToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetCostComparisonDrivers(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextPageToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetCostComparisonDriversAPIClient is a client that implements the -// GetCostComparisonDrivers operation. -type GetCostComparisonDriversAPIClient interface { - GetCostComparisonDrivers(context.Context, *GetCostComparisonDriversInput, ...func(*Options)) (*GetCostComparisonDriversOutput, error) -} - -var _ GetCostComparisonDriversAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetCostComparisonDrivers(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetCostComparisonDrivers", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCostForecast.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCostForecast.go deleted file mode 100644 index 7ef26dba3c..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetCostForecast.go +++ /dev/null @@ -1,253 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves a forecast for how much Amazon Web Services predicts that you will -// spend over the forecast time period that you select, based on your past costs. -func (c *Client) GetCostForecast(ctx context.Context, params *GetCostForecastInput, optFns ...func(*Options)) (*GetCostForecastOutput, error) { - if params == nil { - params = &GetCostForecastInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetCostForecast", params, optFns, c.addOperationGetCostForecastMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetCostForecastOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetCostForecastInput struct { - - // How granular you want the forecast to be. You can get 3 months of DAILY - // forecasts or 18 months of MONTHLY forecasts. - // - // The GetCostForecast operation supports only DAILY and MONTHLY granularities. - // - // This member is required. - Granularity types.Granularity - - // Which metric Cost Explorer uses to create your forecast. For more information - // about blended and unblended rates, see [Why does the "blended" annotation appear on some line items in my bill?]. - // - // Valid values for a GetCostForecast call are the following: - // - // - AMORTIZED_COST - // - // - BLENDED_COST - // - // - NET_AMORTIZED_COST - // - // - NET_UNBLENDED_COST - // - // - UNBLENDED_COST - // - // [Why does the "blended" annotation appear on some line items in my bill?]: http://aws.amazon.com/premiumsupport/knowledge-center/blended-rates-intro/ - // - // This member is required. - Metric types.Metric - - // The period of time that you want the forecast to cover. The start date must be - // equal to or no later than the current date to avoid a validation error. - // - // This member is required. - TimePeriod *types.DateInterval - - // The Amazon Resource Name (ARN) that uniquely identifies a specific billing - // view. The ARN is used to specify which particular billing view you want to - // interact with or retrieve information from when making API calls related to - // Amazon Web Services Billing and Cost Management features. The BillingViewArn can - // be retrieved by calling the ListBillingViews API. - BillingViewArn *string - - // The filters that you want to use to filter your forecast. The GetCostForecast - // API supports filtering by the following dimensions: - // - // - AZ - // - // - INSTANCE_TYPE - // - // - LINKED_ACCOUNT - // - // - OPERATION - // - // - PURCHASE_TYPE - // - // - REGION - // - // - SERVICE - // - // - USAGE_TYPE - // - // - USAGE_TYPE_GROUP - // - // - RECORD_TYPE - // - // - OPERATING_SYSTEM - // - // - TENANCY - // - // - SCOPE - // - // - PLATFORM - // - // - SUBSCRIPTION_ID - // - // - LEGAL_ENTITY_NAME - // - // - DEPLOYMENT_OPTION - // - // - DATABASE_ENGINE - // - // - INSTANCE_TYPE_FAMILY - // - // - BILLING_ENTITY - // - // - RESERVATION_ID - // - // - SAVINGS_PLAN_ARN - Filter *types.Expression - - // Cost Explorer always returns the mean forecast as a single point. You can - // request a prediction interval around the mean by specifying a confidence level. - // The higher the confidence level, the more confident Cost Explorer is about the - // actual value falling in the prediction interval. Higher confidence levels result - // in wider prediction intervals. - PredictionIntervalLevel *int32 - - noSmithyDocumentSerde -} - -type GetCostForecastOutput struct { - - // The forecasts for your query, in order. For DAILY forecasts, this is a list of - // days. For MONTHLY forecasts, this is a list of months. - ForecastResultsByTime []types.ForecastResult - - // How much you are forecasted to spend over the forecast period, in USD . - Total *types.MetricValue - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetCostForecastMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetCostForecast{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetCostForecast{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetCostForecast"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetCostForecastValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCostForecast(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetCostForecast(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetCostForecast", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetDimensionValues.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetDimensionValues.go deleted file mode 100644 index 348997f5cf..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetDimensionValues.go +++ /dev/null @@ -1,539 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves all available filter values for a specified filter over a period of -// time. You can search the dimension values for an arbitrary string. -func (c *Client) GetDimensionValues(ctx context.Context, params *GetDimensionValuesInput, optFns ...func(*Options)) (*GetDimensionValuesOutput, error) { - if params == nil { - params = &GetDimensionValuesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetDimensionValues", params, optFns, c.addOperationGetDimensionValuesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetDimensionValuesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetDimensionValuesInput struct { - - // The name of the dimension. Each Dimension is available for a different Context . - // For more information, see Context . LINK_ACCOUNT_NAME and SERVICE_CODE can only - // be used in [CostCategoryRule]. - // - // [CostCategoryRule]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/AAPI_CostCategoryRule.html - // - // This member is required. - Dimension types.Dimension - - // The start date and end date for retrieving the dimension values. The start date - // is inclusive, but the end date is exclusive. For example, if start is 2017-01-01 - // and end is 2017-05-01 , then the cost and usage data is retrieved from - // 2017-01-01 up to and including 2017-04-30 but not including 2017-05-01 . - // - // This member is required. - TimePeriod *types.DateInterval - - // The Amazon Resource Name (ARN) that uniquely identifies a specific billing - // view. The ARN is used to specify which particular billing view you want to - // interact with or retrieve information from when making API calls related to - // Amazon Web Services Billing and Cost Management features. The BillingViewArn can - // be retrieved by calling the ListBillingViews API. - BillingViewArn *string - - // The context for the call to GetDimensionValues . This can be RESERVATIONS or - // COST_AND_USAGE . The default value is COST_AND_USAGE . If the context is set to - // RESERVATIONS , the resulting dimension values can be used in the - // GetReservationUtilization operation. If the context is set to COST_AND_USAGE , - // the resulting dimension values can be used in the GetCostAndUsage operation. - // - // If you set the context to COST_AND_USAGE , you can use the following dimensions - // for searching: - // - // - AZ - The Availability Zone. An example is us-east-1a . - // - // - BILLING_ENTITY - The Amazon Web Services seller that your account is with. - // Possible values are the following: - // - // - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web - // Services services. - // - // - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an - // acting reseller for Amazon Web Services services in India. - // - // - Amazon Web Services Marketplace: The entity that supports the sale of - // solutions that are built on Amazon Web Services by third-party software - // providers. - // - // - CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are - // Windows or Linux. - // - // - DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service - // deployments. Valid values are SingleAZ and MultiAZ . - // - // - DATABASE_ENGINE - The Amazon Relational Database Service database. Examples - // are Aurora or MySQL. - // - // - INSTANCE_TYPE - The type of Amazon EC2 instance. An example is m4.xlarge . - // - // - INSTANCE_TYPE_FAMILY - A family of instance types optimized to fit - // different use cases. Examples are Compute Optimized (for example, C4 , C5 , - // C6g , and C7g ), Memory Optimization (for example, R4 , R5n , R5b , and R6g ). - // - // - INVOICING_ENTITY - The name of the entity that issues the Amazon Web - // Services invoice. - // - // - LEGAL_ENTITY_NAME - The name of the organization that sells you Amazon Web - // Services services, such as Amazon Web Services. - // - // - LINKED_ACCOUNT - The description in the attribute map that includes the - // full name of the member account. The value field contains the Amazon Web - // Services ID of the member account. - // - // - OPERATING_SYSTEM - The operating system. Examples are Windows or Linux. - // - // - OPERATION - The action performed. Examples include RunInstance and - // CreateBucket . - // - // - PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux. - // - // - PURCHASE_TYPE - The reservation type of the purchase that this usage is - // related to. Examples include On-Demand Instances and Standard Reserved - // Instances. - // - // - RESERVATION_ID - The unique identifier for an Amazon Web Services - // Reservation Instance. - // - // - SAVINGS_PLAN_ARN - The unique identifier for your Savings Plans. - // - // - SAVINGS_PLANS_TYPE - Type of Savings Plans (EC2 Instance or Compute). - // - // - SERVICE - The Amazon Web Services service such as Amazon DynamoDB. - // - // - TENANCY - The tenancy of a resource. Examples are shared or dedicated. - // - // - USAGE_TYPE - The type of usage. An example is DataTransfer-In-Bytes. The - // response for the GetDimensionValues operation includes a unit attribute. - // Examples include GB and Hrs. - // - // - USAGE_TYPE_GROUP - The grouping of common usage types. An example is Amazon - // EC2: CloudWatch – Alarms. The response for this operation includes a unit - // attribute. - // - // - REGION - The Amazon Web Services Region. - // - // - RECORD_TYPE - The different types of charges such as Reserved Instance (RI) - // fees, usage costs, tax refunds, and credits. - // - // - RESOURCE_ID - The unique identifier of the resource. ResourceId is an - // opt-in feature only available for last 14 days for EC2-Compute Service. - // - // If you set the context to RESERVATIONS , you can use the following dimensions - // for searching: - // - // - AZ - The Availability Zone. An example is us-east-1a . - // - // - CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are - // Windows or Linux. - // - // - DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service - // deployments. Valid values are SingleAZ and MultiAZ . - // - // - INSTANCE_TYPE - The type of Amazon EC2 instance. An example is m4.xlarge . - // - // - LINKED_ACCOUNT - The description in the attribute map that includes the - // full name of the member account. The value field contains the Amazon Web - // Services ID of the member account. - // - // - PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux. - // - // - REGION - The Amazon Web Services Region. - // - // - SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values - // are regional or a single Availability Zone. - // - // - TAG (Coverage only) - The tags that are associated with a Reserved Instance - // (RI). - // - // - TENANCY - The tenancy of a resource. Examples are shared or dedicated. - // - // If you set the context to SAVINGS_PLANS , you can use the following dimensions - // for searching: - // - // - SAVINGS_PLANS_TYPE - Type of Savings Plans (EC2 Instance or Compute) - // - // - PAYMENT_OPTION - The payment option for the given Savings Plans (for - // example, All Upfront) - // - // - REGION - The Amazon Web Services Region. - // - // - INSTANCE_TYPE_FAMILY - The family of instances (For example, m5 ) - // - // - LINKED_ACCOUNT - The description in the attribute map that includes the - // full name of the member account. The value field contains the Amazon Web - // Services ID of the member account. - // - // - SAVINGS_PLAN_ARN - The unique identifier for your Savings Plans. - Context types.Context - - // Use Expression to filter in various Cost Explorer APIs. - // - // Not all Expression types are supported in each API. Refer to the documentation - // for each specific API to see what is supported. - // - // There are two patterns: - // - // - Simple dimension values. - // - // - There are three types of simple dimension values: CostCategories , Tags , - // and Dimensions . - // - // - Specify the CostCategories field to define a filter that acts on Cost - // Categories. - // - // - Specify the Tags field to define a filter that acts on Cost Allocation Tags. - // - // - Specify the Dimensions field to define a filter that acts on the [DimensionValues] - // DimensionValues . - // - // - For each filter type, you can set the dimension name and values for the - // filters that you plan to use. - // - // - For example, you can filter for REGION==us-east-1 OR REGION==us-west-1 . For - // GetRightsizingRecommendation , the Region is a full name (for example, - // REGION==US East (N. Virginia) . - // - // - The corresponding Expression for this example is as follows: { - // "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] } } - // - // - As shown in the previous example, lists of dimension values are combined - // with OR when applying the filter. - // - // - You can also set different match options to further control how the filter - // behaves. Not all APIs support match options. Refer to the documentation for each - // specific API to see what is supported. - // - // - For example, you can filter for linked account names that start with "a". - // - // - The corresponding Expression for this example is as follows: { - // "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": [ "STARTS_WITH" ], - // "Values": [ "a" ] } } - // - // - Compound Expression types with logical operations. - // - // - You can use multiple Expression types and the logical operators AND/OR/NOT - // to create a list of one or more Expression objects. By doing this, you can - // filter by more advanced options. - // - // - For example, you can filter by ((REGION == us-east-1 OR REGION == - // us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer) . - // - // - The corresponding Expression for this example is as follows: { "And": [ - // {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" - // ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": - // {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] } - // - // Because each Expression can have only one operator, the service returns an error - // if more than one is specified. The following example shows an Expression - // object that creates an error: { "And": [ ... ], "Dimensions": { "Key": - // "USAGE_TYPE", "Values": [ "DataTransfer" ] } } - // - // The following is an example of the corresponding error message: "Expression has - // more than one roots. Only one root operator is allowed for each expression: And, - // Or, Not, Dimensions, Tags, CostCategories" - // - // For the GetRightsizingRecommendation action, a combination of OR and NOT isn't - // supported. OR isn't supported between different dimensions, or dimensions and - // tags. NOT operators aren't supported. Dimensions are also limited to - // LINKED_ACCOUNT , REGION , or RIGHTSIZING_TYPE . - // - // For the GetReservationPurchaseRecommendation action, only NOT is supported. AND - // and OR aren't supported. Dimensions are limited to LINKED_ACCOUNT . - // - // [DimensionValues]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html - Filter *types.Expression - - // This field is only used when SortBy is provided in the request. The maximum - // number of objects that are returned for this request. If MaxResults isn't - // specified with SortBy, the request returns 1000 results as the default value for - // this parameter. - // - // For GetDimensionValues , MaxResults has an upper limit of 1000. - MaxResults *int32 - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextPageToken *string - - // The value that you want to search the filter values for. - SearchString *string - - // The value that you want to sort the data by. - // - // The key represents cost and usage metrics. The following values are supported: - // - // - BlendedCost - // - // - UnblendedCost - // - // - AmortizedCost - // - // - NetAmortizedCost - // - // - NetUnblendedCost - // - // - UsageQuantity - // - // - NormalizedUsageAmount - // - // The supported values for the SortOrder key are ASCENDING or DESCENDING . - // - // When you specify a SortBy paramater, the context must be COST_AND_USAGE . - // Further, when using SortBy , NextPageToken and SearchString aren't supported. - SortBy []types.SortDefinition - - noSmithyDocumentSerde -} - -type GetDimensionValuesOutput struct { - - // The filters that you used to filter your request. Some dimensions are available - // only for a specific context. - // - // If you set the context to COST_AND_USAGE , you can use the following dimensions - // for searching: - // - // - AZ - The Availability Zone. An example is us-east-1a . - // - // - DATABASE_ENGINE - The Amazon Relational Database Service database. Examples - // are Aurora or MySQL. - // - // - INSTANCE_TYPE - The type of Amazon EC2 instance. An example is m4.xlarge . - // - // - LEGAL_ENTITY_NAME - The name of the organization that sells you Amazon Web - // Services services, such as Amazon Web Services. - // - // - LINKED_ACCOUNT - The description in the attribute map that includes the - // full name of the member account. The value field contains the Amazon Web - // Services ID of the member account. - // - // - OPERATING_SYSTEM - The operating system. Examples are Windows or Linux. - // - // - OPERATION - The action performed. Examples include RunInstance and - // CreateBucket . - // - // - PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux. - // - // - PURCHASE_TYPE - The reservation type of the purchase to which this usage is - // related. Examples include On-Demand Instances and Standard Reserved Instances. - // - // - SERVICE - The Amazon Web Services service such as Amazon DynamoDB. - // - // - USAGE_TYPE - The type of usage. An example is DataTransfer-In-Bytes. The - // response for the GetDimensionValues operation includes a unit attribute. - // Examples include GB and Hrs. - // - // - USAGE_TYPE_GROUP - The grouping of common usage types. An example is Amazon - // EC2: CloudWatch – Alarms. The response for this operation includes a unit - // attribute. - // - // - RECORD_TYPE - The different types of charges such as RI fees, usage costs, - // tax refunds, and credits. - // - // - RESOURCE_ID - The unique identifier of the resource. ResourceId is an - // opt-in feature only available for last 14 days for EC2-Compute Service. You can - // opt-in by enabling Hourly and Resource Level Data in Cost Management Console - // preferences. - // - // If you set the context to RESERVATIONS , you can use the following dimensions - // for searching: - // - // - AZ - The Availability Zone. An example is us-east-1a . - // - // - CACHE_ENGINE - The Amazon ElastiCache operating system. Examples are - // Windows or Linux. - // - // - DEPLOYMENT_OPTION - The scope of Amazon Relational Database Service - // deployments. Valid values are SingleAZ and MultiAZ . - // - // - INSTANCE_TYPE - The type of Amazon EC2 instance. An example is m4.xlarge . - // - // - LINKED_ACCOUNT - The description in the attribute map that includes the - // full name of the member account. The value field contains the Amazon Web - // Services ID of the member account. - // - // - PLATFORM - The Amazon EC2 operating system. Examples are Windows or Linux. - // - // - REGION - The Amazon Web Services Region. - // - // - SCOPE (Utilization only) - The scope of a Reserved Instance (RI). Values - // are regional or a single Availability Zone. - // - // - TAG (Coverage only) - The tags that are associated with a Reserved Instance - // (RI). - // - // - TENANCY - The tenancy of a resource. Examples are shared or dedicated. - // - // If you set the context to SAVINGS_PLANS , you can use the following dimensions - // for searching: - // - // - SAVINGS_PLANS_TYPE - Type of Savings Plans (EC2 Instance or Compute) - // - // - PAYMENT_OPTION - Payment option for the given Savings Plans (for example, - // All Upfront) - // - // - REGION - The Amazon Web Services Region. - // - // - INSTANCE_TYPE_FAMILY - The family of instances (For example, m5 ) - // - // - LINKED_ACCOUNT - The description in the attribute map that includes the - // full name of the member account. The value field contains the Amazon Web - // Services ID of the member account. - // - // - SAVINGS_PLAN_ARN - The unique identifier for your Savings Plan - // - // This member is required. - DimensionValues []types.DimensionValuesWithAttributes - - // The number of results that Amazon Web Services returned at one time. - // - // This member is required. - ReturnSize *int32 - - // The total number of search results. - // - // This member is required. - TotalSize *int32 - - // The token for the next set of retrievable results. Amazon Web Services provides - // the token when the response from a previous call has more results than the - // maximum page size. - NextPageToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetDimensionValuesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetDimensionValues{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetDimensionValues{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetDimensionValues"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetDimensionValuesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDimensionValues(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetDimensionValues(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetDimensionValues", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetReservationCoverage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetReservationCoverage.go deleted file mode 100644 index e604f56af3..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetReservationCoverage.go +++ /dev/null @@ -1,324 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves the reservation coverage for your account, which you can use to see -// how much of your Amazon Elastic Compute Cloud, Amazon ElastiCache, Amazon -// Relational Database Service, or Amazon Redshift usage is covered by a -// reservation. An organization's management account can see the coverage of the -// associated member accounts. This supports dimensions, cost categories, and -// nested expressions. For any time period, you can filter data about reservation -// usage by the following dimensions: -// -// - AZ -// -// - CACHE_ENGINE -// -// - DATABASE_ENGINE -// -// - DEPLOYMENT_OPTION -// -// - INSTANCE_TYPE -// -// - LINKED_ACCOUNT -// -// - OPERATING_SYSTEM -// -// - PLATFORM -// -// - REGION -// -// - SERVICE -// -// - TAG -// -// - TENANCY -// -// To determine valid values for a dimension, use the GetDimensionValues -// operation. -func (c *Client) GetReservationCoverage(ctx context.Context, params *GetReservationCoverageInput, optFns ...func(*Options)) (*GetReservationCoverageOutput, error) { - if params == nil { - params = &GetReservationCoverageInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetReservationCoverage", params, optFns, c.addOperationGetReservationCoverageMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetReservationCoverageOutput) - out.ResultMetadata = metadata - return out, nil -} - -// You can use the following request parameters to query for how much of your -// instance usage a reservation covered. -type GetReservationCoverageInput struct { - - // The start and end dates of the period that you want to retrieve data about - // reservation coverage for. You can retrieve data for a maximum of 13 months: the - // last 12 months and the current month. The start date is inclusive, but the end - // date is exclusive. For example, if start is 2017-01-01 and end is 2017-05-01 , - // then the cost and usage data is retrieved from 2017-01-01 up to and including - // 2017-04-30 but not including 2017-05-01 . - // - // This member is required. - TimePeriod *types.DateInterval - - // Filters utilization data by dimensions. You can filter by the following - // dimensions: - // - // - AZ - // - // - CACHE_ENGINE - // - // - DATABASE_ENGINE - // - // - DEPLOYMENT_OPTION - // - // - INSTANCE_TYPE - // - // - LINKED_ACCOUNT - // - // - OPERATING_SYSTEM - // - // - PLATFORM - // - // - REGION - // - // - SERVICE - // - // - TAG - // - // - TENANCY - // - // GetReservationCoverage uses the same [Expression] object as the other operations, but only - // AND is supported among each dimension. You can nest only one level deep. If - // there are multiple values for a dimension, they are OR'd together. - // - // If you don't provide a SERVICE filter, Cost Explorer defaults to EC2. - // - // Cost category is also supported. - // - // [Expression]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html - Filter *types.Expression - - // The granularity of the Amazon Web Services cost data for the reservation. Valid - // values are MONTHLY and DAILY . - // - // If GroupBy is set, Granularity can't be set. If Granularity isn't set, the - // response object doesn't include Granularity , either MONTHLY or DAILY . - // - // The GetReservationCoverage operation supports only DAILY and MONTHLY - // granularities. - Granularity types.Granularity - - // You can group the data by the following attributes: - // - // - AZ - // - // - CACHE_ENGINE - // - // - DATABASE_ENGINE - // - // - DEPLOYMENT_OPTION - // - // - INSTANCE_TYPE - // - // - INVOICING_ENTITY - // - // - LINKED_ACCOUNT - // - // - OPERATING_SYSTEM - // - // - PLATFORM - // - // - REGION - // - // - TENANCY - GroupBy []types.GroupDefinition - - // The maximum number of objects that you returned for this request. If more - // objects are available, in the response, Amazon Web Services provides a - // NextPageToken value that you can use in a subsequent call to get the next batch - // of objects. - MaxResults *int32 - - // The measurement that you want your reservation coverage reported in. - // - // Valid values are Hour , Unit , and Cost . You can use multiple values in a - // request. - Metrics []string - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextPageToken *string - - // The value by which you want to sort the data. - // - // The following values are supported for Key : - // - // - OnDemandCost - // - // - CoverageHoursPercentage - // - // - OnDemandHours - // - // - ReservedHours - // - // - TotalRunningHours - // - // - CoverageNormalizedUnitsPercentage - // - // - OnDemandNormalizedUnits - // - // - ReservedNormalizedUnits - // - // - TotalRunningNormalizedUnits - // - // - Time - // - // Supported values for SortOrder are ASCENDING or DESCENDING . - SortBy *types.SortDefinition - - noSmithyDocumentSerde -} - -type GetReservationCoverageOutput struct { - - // The amount of time that your reservations covered. - // - // This member is required. - CoveragesByTime []types.CoverageByTime - - // The token for the next set of retrievable results. Amazon Web Services provides - // the token when the response from a previous call has more results than the - // maximum page size. - NextPageToken *string - - // The total amount of instance usage that a reservation covered. - Total *types.Coverage - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetReservationCoverageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetReservationCoverage{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetReservationCoverage{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetReservationCoverage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetReservationCoverageValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetReservationCoverage(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetReservationCoverage(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetReservationCoverage", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetReservationPurchaseRecommendation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetReservationPurchaseRecommendation.go deleted file mode 100644 index 5bbd5edbd6..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetReservationPurchaseRecommendation.go +++ /dev/null @@ -1,384 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Gets recommendations for reservation purchases. These recommendations might -// help you to reduce your costs. Reservations provide a discounted hourly rate (up -// to 75%) compared to On-Demand pricing. -// -// Amazon Web Services generates your recommendations by identifying your -// On-Demand usage during a specific time period and collecting your usage into -// categories that are eligible for a reservation. After Amazon Web Services has -// these categories, it simulates every combination of reservations in each -// category of usage to identify the best number of each type of Reserved Instance -// (RI) to purchase to maximize your estimated savings. -// -// For example, Amazon Web Services automatically aggregates your Amazon EC2 -// Linux, shared tenancy, and c4 family usage in the US West (Oregon) Region and -// recommends that you buy size-flexible regional reservations to apply to the c4 -// family usage. Amazon Web Services recommends the smallest size instance in an -// instance family. This makes it easier to purchase a size-flexible Reserved -// Instance (RI). Amazon Web Services also shows the equal number of normalized -// units. This way, you can purchase any instance size that you want. For this -// example, your RI recommendation is for c4.large because that is the smallest -// size instance in the c4 instance family. -func (c *Client) GetReservationPurchaseRecommendation(ctx context.Context, params *GetReservationPurchaseRecommendationInput, optFns ...func(*Options)) (*GetReservationPurchaseRecommendationOutput, error) { - if params == nil { - params = &GetReservationPurchaseRecommendationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetReservationPurchaseRecommendation", params, optFns, c.addOperationGetReservationPurchaseRecommendationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetReservationPurchaseRecommendationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetReservationPurchaseRecommendationInput struct { - - // The specific service that you want recommendations for. - // - // This member is required. - Service *string - - // The account ID that's associated with the recommendation. - AccountId *string - - // The account scope that you want your recommendations for. Amazon Web Services - // calculates recommendations including the management account and member accounts - // if the value is set to PAYER . If the value is LINKED , recommendations are - // calculated for individual member accounts only. - AccountScope types.AccountScope - - // Use Expression to filter in various Cost Explorer APIs. - // - // Not all Expression types are supported in each API. Refer to the documentation - // for each specific API to see what is supported. - // - // There are two patterns: - // - // - Simple dimension values. - // - // - There are three types of simple dimension values: CostCategories , Tags , - // and Dimensions . - // - // - Specify the CostCategories field to define a filter that acts on Cost - // Categories. - // - // - Specify the Tags field to define a filter that acts on Cost Allocation Tags. - // - // - Specify the Dimensions field to define a filter that acts on the [DimensionValues] - // DimensionValues . - // - // - For each filter type, you can set the dimension name and values for the - // filters that you plan to use. - // - // - For example, you can filter for REGION==us-east-1 OR REGION==us-west-1 . For - // GetRightsizingRecommendation , the Region is a full name (for example, - // REGION==US East (N. Virginia) . - // - // - The corresponding Expression for this example is as follows: { - // "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] } } - // - // - As shown in the previous example, lists of dimension values are combined - // with OR when applying the filter. - // - // - You can also set different match options to further control how the filter - // behaves. Not all APIs support match options. Refer to the documentation for each - // specific API to see what is supported. - // - // - For example, you can filter for linked account names that start with "a". - // - // - The corresponding Expression for this example is as follows: { - // "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": [ "STARTS_WITH" ], - // "Values": [ "a" ] } } - // - // - Compound Expression types with logical operations. - // - // - You can use multiple Expression types and the logical operators AND/OR/NOT - // to create a list of one or more Expression objects. By doing this, you can - // filter by more advanced options. - // - // - For example, you can filter by ((REGION == us-east-1 OR REGION == - // us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer) . - // - // - The corresponding Expression for this example is as follows: { "And": [ - // {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" - // ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": - // {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] } - // - // Because each Expression can have only one operator, the service returns an error - // if more than one is specified. The following example shows an Expression - // object that creates an error: { "And": [ ... ], "Dimensions": { "Key": - // "USAGE_TYPE", "Values": [ "DataTransfer" ] } } - // - // The following is an example of the corresponding error message: "Expression has - // more than one roots. Only one root operator is allowed for each expression: And, - // Or, Not, Dimensions, Tags, CostCategories" - // - // For the GetRightsizingRecommendation action, a combination of OR and NOT isn't - // supported. OR isn't supported between different dimensions, or dimensions and - // tags. NOT operators aren't supported. Dimensions are also limited to - // LINKED_ACCOUNT , REGION , or RIGHTSIZING_TYPE . - // - // For the GetReservationPurchaseRecommendation action, only NOT is supported. AND - // and OR aren't supported. Dimensions are limited to LINKED_ACCOUNT . - // - // [DimensionValues]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html - Filter *types.Expression - - // The number of previous days that you want Amazon Web Services to consider when - // it calculates your recommendations. - LookbackPeriodInDays types.LookbackPeriodInDays - - // The pagination token that indicates the next set of results that you want to - // retrieve. - NextPageToken *string - - // The number of recommendations that you want returned in a single response - // object. - PageSize int32 - - // The reservation purchase option that you want recommendations for. - PaymentOption types.PaymentOption - - // The hardware specifications for the service instances that you want - // recommendations for, such as standard or convertible Amazon EC2 instances. - ServiceSpecification *types.ServiceSpecification - - // The reservation term that you want recommendations for. - TermInYears types.TermInYears - - noSmithyDocumentSerde -} - -type GetReservationPurchaseRecommendationOutput struct { - - // Information about this specific recommendation call, such as the time stamp for - // when Cost Explorer generated this recommendation. - Metadata *types.ReservationPurchaseRecommendationMetadata - - // The pagination token for the next set of retrievable results. - NextPageToken *string - - // Recommendations for reservations to purchase. - Recommendations []types.ReservationPurchaseRecommendation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetReservationPurchaseRecommendationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetReservationPurchaseRecommendation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetReservationPurchaseRecommendation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetReservationPurchaseRecommendation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetReservationPurchaseRecommendationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetReservationPurchaseRecommendation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// GetReservationPurchaseRecommendationPaginatorOptions is the paginator options -// for GetReservationPurchaseRecommendation -type GetReservationPurchaseRecommendationPaginatorOptions struct { - // The number of recommendations that you want returned in a single response - // object. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetReservationPurchaseRecommendationPaginator is a paginator for -// GetReservationPurchaseRecommendation -type GetReservationPurchaseRecommendationPaginator struct { - options GetReservationPurchaseRecommendationPaginatorOptions - client GetReservationPurchaseRecommendationAPIClient - params *GetReservationPurchaseRecommendationInput - nextToken *string - firstPage bool -} - -// NewGetReservationPurchaseRecommendationPaginator returns a new -// GetReservationPurchaseRecommendationPaginator -func NewGetReservationPurchaseRecommendationPaginator(client GetReservationPurchaseRecommendationAPIClient, params *GetReservationPurchaseRecommendationInput, optFns ...func(*GetReservationPurchaseRecommendationPaginatorOptions)) *GetReservationPurchaseRecommendationPaginator { - if params == nil { - params = &GetReservationPurchaseRecommendationInput{} - } - - options := GetReservationPurchaseRecommendationPaginatorOptions{} - if params.PageSize != 0 { - options.Limit = params.PageSize - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetReservationPurchaseRecommendationPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextPageToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetReservationPurchaseRecommendationPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetReservationPurchaseRecommendation page. -func (p *GetReservationPurchaseRecommendationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetReservationPurchaseRecommendationOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextPageToken = p.nextToken - - params.PageSize = p.options.Limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetReservationPurchaseRecommendation(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextPageToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetReservationPurchaseRecommendationAPIClient is a client that implements the -// GetReservationPurchaseRecommendation operation. -type GetReservationPurchaseRecommendationAPIClient interface { - GetReservationPurchaseRecommendation(context.Context, *GetReservationPurchaseRecommendationInput, ...func(*Options)) (*GetReservationPurchaseRecommendationOutput, error) -} - -var _ GetReservationPurchaseRecommendationAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetReservationPurchaseRecommendation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetReservationPurchaseRecommendation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetReservationUtilization.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetReservationUtilization.go deleted file mode 100644 index f9b88bf6f7..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetReservationUtilization.go +++ /dev/null @@ -1,276 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves the reservation utilization for your account. Management account in -// an organization have access to member accounts. You can filter data by -// dimensions in a time period. You can use GetDimensionValues to determine the -// possible dimension values. Currently, you can group only by SUBSCRIPTION_ID . -func (c *Client) GetReservationUtilization(ctx context.Context, params *GetReservationUtilizationInput, optFns ...func(*Options)) (*GetReservationUtilizationOutput, error) { - if params == nil { - params = &GetReservationUtilizationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetReservationUtilization", params, optFns, c.addOperationGetReservationUtilizationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetReservationUtilizationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetReservationUtilizationInput struct { - - // Sets the start and end dates for retrieving Reserved Instance (RI) utilization. - // The start date is inclusive, but the end date is exclusive. For example, if - // start is 2017-01-01 and end is 2017-05-01 , then the cost and usage data is - // retrieved from 2017-01-01 up to and including 2017-04-30 but not including - // 2017-05-01 . - // - // This member is required. - TimePeriod *types.DateInterval - - // Filters utilization data by dimensions. You can filter by the following - // dimensions: - // - // - AZ - // - // - CACHE_ENGINE - // - // - DEPLOYMENT_OPTION - // - // - INSTANCE_TYPE - // - // - LINKED_ACCOUNT - // - // - OPERATING_SYSTEM - // - // - PLATFORM - // - // - REGION - // - // - SERVICE - // - // If not specified, the SERVICE filter defaults to Amazon Elastic Compute Cloud - - // Compute. Supported values for SERVICE are Amazon Elastic Compute Cloud - - // Compute, Amazon Relational Database Service, Amazon ElastiCache, Amazon - // Redshift, and Amazon Elasticsearch Service. The value for the SERVICE filter - // should not exceed "1". - // - // - SCOPE - // - // - TENANCY - // - // GetReservationUtilization uses the same [Expression] object as the other operations, but - // only AND is supported among each dimension, and nesting is supported up to only - // one level deep. If there are multiple values for a dimension, they are OR'd - // together. - // - // [Expression]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html - Filter *types.Expression - - // If GroupBy is set, Granularity can't be set. If Granularity isn't set, the - // response object doesn't include Granularity , either MONTHLY or DAILY . If both - // GroupBy and Granularity aren't set, GetReservationUtilization defaults to DAILY . - // - // The GetReservationUtilization operation supports only DAILY and MONTHLY - // granularities. - Granularity types.Granularity - - // Groups only by SUBSCRIPTION_ID . Metadata is included. - GroupBy []types.GroupDefinition - - // The maximum number of objects that you returned for this request. If more - // objects are available, in the response, Amazon Web Services provides a - // NextPageToken value that you can use in a subsequent call to get the next batch - // of objects. - MaxResults *int32 - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextPageToken *string - - // The value that you want to sort the data by. - // - // The following values are supported for Key : - // - // - UtilizationPercentage - // - // - UtilizationPercentageInUnits - // - // - PurchasedHours - // - // - PurchasedUnits - // - // - TotalActualHours - // - // - TotalActualUnits - // - // - UnusedHours - // - // - UnusedUnits - // - // - OnDemandCostOfRIHoursUsed - // - // - NetRISavings - // - // - TotalPotentialRISavings - // - // - AmortizedUpfrontFee - // - // - AmortizedRecurringFee - // - // - TotalAmortizedFee - // - // - RICostForUnusedHours - // - // - RealizedSavings - // - // - UnrealizedSavings - // - // The supported values for SortOrder are ASCENDING and DESCENDING . - SortBy *types.SortDefinition - - noSmithyDocumentSerde -} - -type GetReservationUtilizationOutput struct { - - // The amount of time that you used your Reserved Instances (RIs). - // - // This member is required. - UtilizationsByTime []types.UtilizationByTime - - // The token for the next set of retrievable results. Amazon Web Services provides - // the token when the response from a previous call has more results than the - // maximum page size. - NextPageToken *string - - // The total amount of time that you used your Reserved Instances (RIs). - Total *types.ReservationAggregates - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetReservationUtilizationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetReservationUtilization{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetReservationUtilization{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetReservationUtilization"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetReservationUtilizationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetReservationUtilization(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetReservationUtilization(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetReservationUtilization", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetRightsizingRecommendation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetRightsizingRecommendation.go deleted file mode 100644 index 4653a2fdd3..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetRightsizingRecommendation.go +++ /dev/null @@ -1,366 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates recommendations that help you save cost by identifying idle and -// underutilized Amazon EC2 instances. -// -// Recommendations are generated to either downsize or terminate instances, along -// with providing savings detail and metrics. For more information about -// calculation and function, see [Optimizing Your Cost with Rightsizing Recommendations]in the Billing and Cost Management User Guide. -// -// [Optimizing Your Cost with Rightsizing Recommendations]: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/ce-rightsizing.html -func (c *Client) GetRightsizingRecommendation(ctx context.Context, params *GetRightsizingRecommendationInput, optFns ...func(*Options)) (*GetRightsizingRecommendationOutput, error) { - if params == nil { - params = &GetRightsizingRecommendationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetRightsizingRecommendation", params, optFns, c.addOperationGetRightsizingRecommendationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetRightsizingRecommendationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetRightsizingRecommendationInput struct { - - // The specific service that you want recommendations for. The only valid value - // for GetRightsizingRecommendation is " AmazonEC2 ". - // - // This member is required. - Service *string - - // You can use Configuration to customize recommendations across two attributes. - // You can choose to view recommendations for instances within the same instance - // families or across different instance families. You can also choose to view your - // estimated savings that are associated with recommendations with consideration of - // existing Savings Plans or RI benefits, or neither. - Configuration *types.RightsizingRecommendationConfiguration - - // Use Expression to filter in various Cost Explorer APIs. - // - // Not all Expression types are supported in each API. Refer to the documentation - // for each specific API to see what is supported. - // - // There are two patterns: - // - // - Simple dimension values. - // - // - There are three types of simple dimension values: CostCategories , Tags , - // and Dimensions . - // - // - Specify the CostCategories field to define a filter that acts on Cost - // Categories. - // - // - Specify the Tags field to define a filter that acts on Cost Allocation Tags. - // - // - Specify the Dimensions field to define a filter that acts on the [DimensionValues] - // DimensionValues . - // - // - For each filter type, you can set the dimension name and values for the - // filters that you plan to use. - // - // - For example, you can filter for REGION==us-east-1 OR REGION==us-west-1 . For - // GetRightsizingRecommendation , the Region is a full name (for example, - // REGION==US East (N. Virginia) . - // - // - The corresponding Expression for this example is as follows: { - // "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] } } - // - // - As shown in the previous example, lists of dimension values are combined - // with OR when applying the filter. - // - // - You can also set different match options to further control how the filter - // behaves. Not all APIs support match options. Refer to the documentation for each - // specific API to see what is supported. - // - // - For example, you can filter for linked account names that start with "a". - // - // - The corresponding Expression for this example is as follows: { - // "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": [ "STARTS_WITH" ], - // "Values": [ "a" ] } } - // - // - Compound Expression types with logical operations. - // - // - You can use multiple Expression types and the logical operators AND/OR/NOT - // to create a list of one or more Expression objects. By doing this, you can - // filter by more advanced options. - // - // - For example, you can filter by ((REGION == us-east-1 OR REGION == - // us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer) . - // - // - The corresponding Expression for this example is as follows: { "And": [ - // {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" - // ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": - // {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] } - // - // Because each Expression can have only one operator, the service returns an error - // if more than one is specified. The following example shows an Expression - // object that creates an error: { "And": [ ... ], "Dimensions": { "Key": - // "USAGE_TYPE", "Values": [ "DataTransfer" ] } } - // - // The following is an example of the corresponding error message: "Expression has - // more than one roots. Only one root operator is allowed for each expression: And, - // Or, Not, Dimensions, Tags, CostCategories" - // - // For the GetRightsizingRecommendation action, a combination of OR and NOT isn't - // supported. OR isn't supported between different dimensions, or dimensions and - // tags. NOT operators aren't supported. Dimensions are also limited to - // LINKED_ACCOUNT , REGION , or RIGHTSIZING_TYPE . - // - // For the GetReservationPurchaseRecommendation action, only NOT is supported. AND - // and OR aren't supported. Dimensions are limited to LINKED_ACCOUNT . - // - // [DimensionValues]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html - Filter *types.Expression - - // The pagination token that indicates the next set of results that you want to - // retrieve. - NextPageToken *string - - // The number of recommendations that you want returned in a single response - // object. - PageSize int32 - - noSmithyDocumentSerde -} - -type GetRightsizingRecommendationOutput struct { - - // You can use Configuration to customize recommendations across two attributes. - // You can choose to view recommendations for instances within the same instance - // families or across different instance families. You can also choose to view your - // estimated savings that are associated with recommendations with consideration of - // existing Savings Plans or RI benefits, or neither. - Configuration *types.RightsizingRecommendationConfiguration - - // Information regarding this specific recommendation set. - Metadata *types.RightsizingRecommendationMetadata - - // The token to retrieve the next set of results. - NextPageToken *string - - // Recommendations to rightsize resources. - RightsizingRecommendations []types.RightsizingRecommendation - - // Summary of this recommendation set. - Summary *types.RightsizingRecommendationSummary - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetRightsizingRecommendationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetRightsizingRecommendation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetRightsizingRecommendation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetRightsizingRecommendation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetRightsizingRecommendationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRightsizingRecommendation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// GetRightsizingRecommendationPaginatorOptions is the paginator options for -// GetRightsizingRecommendation -type GetRightsizingRecommendationPaginatorOptions struct { - // The number of recommendations that you want returned in a single response - // object. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetRightsizingRecommendationPaginator is a paginator for -// GetRightsizingRecommendation -type GetRightsizingRecommendationPaginator struct { - options GetRightsizingRecommendationPaginatorOptions - client GetRightsizingRecommendationAPIClient - params *GetRightsizingRecommendationInput - nextToken *string - firstPage bool -} - -// NewGetRightsizingRecommendationPaginator returns a new -// GetRightsizingRecommendationPaginator -func NewGetRightsizingRecommendationPaginator(client GetRightsizingRecommendationAPIClient, params *GetRightsizingRecommendationInput, optFns ...func(*GetRightsizingRecommendationPaginatorOptions)) *GetRightsizingRecommendationPaginator { - if params == nil { - params = &GetRightsizingRecommendationInput{} - } - - options := GetRightsizingRecommendationPaginatorOptions{} - if params.PageSize != 0 { - options.Limit = params.PageSize - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetRightsizingRecommendationPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextPageToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetRightsizingRecommendationPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetRightsizingRecommendation page. -func (p *GetRightsizingRecommendationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetRightsizingRecommendationOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextPageToken = p.nextToken - - params.PageSize = p.options.Limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetRightsizingRecommendation(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextPageToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetRightsizingRecommendationAPIClient is a client that implements the -// GetRightsizingRecommendation operation. -type GetRightsizingRecommendationAPIClient interface { - GetRightsizingRecommendation(context.Context, *GetRightsizingRecommendationInput, ...func(*Options)) (*GetRightsizingRecommendationOutput, error) -} - -var _ GetRightsizingRecommendationAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetRightsizingRecommendation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetRightsizingRecommendation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetSavingsPlanPurchaseRecommendationDetails.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetSavingsPlanPurchaseRecommendationDetails.go deleted file mode 100644 index 5605919bb9..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetSavingsPlanPurchaseRecommendationDetails.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves the details for a Savings Plan recommendation. These details include -// the hourly data-points that construct the cost, coverage, and utilization -// charts. -func (c *Client) GetSavingsPlanPurchaseRecommendationDetails(ctx context.Context, params *GetSavingsPlanPurchaseRecommendationDetailsInput, optFns ...func(*Options)) (*GetSavingsPlanPurchaseRecommendationDetailsOutput, error) { - if params == nil { - params = &GetSavingsPlanPurchaseRecommendationDetailsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetSavingsPlanPurchaseRecommendationDetails", params, optFns, c.addOperationGetSavingsPlanPurchaseRecommendationDetailsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetSavingsPlanPurchaseRecommendationDetailsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetSavingsPlanPurchaseRecommendationDetailsInput struct { - - // The ID that is associated with the Savings Plan recommendation. - // - // This member is required. - RecommendationDetailId *string - - noSmithyDocumentSerde -} - -type GetSavingsPlanPurchaseRecommendationDetailsOutput struct { - - // Contains detailed information about a specific Savings Plan recommendation. - RecommendationDetailData *types.RecommendationDetailData - - // The ID that is associated with the Savings Plan recommendation. - RecommendationDetailId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetSavingsPlanPurchaseRecommendationDetailsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetSavingsPlanPurchaseRecommendationDetails{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetSavingsPlanPurchaseRecommendationDetails{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetSavingsPlanPurchaseRecommendationDetails"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetSavingsPlanPurchaseRecommendationDetailsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSavingsPlanPurchaseRecommendationDetails(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetSavingsPlanPurchaseRecommendationDetails(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetSavingsPlanPurchaseRecommendationDetails", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetSavingsPlansCoverage.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetSavingsPlansCoverage.go deleted file mode 100644 index a1b7b219e9..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetSavingsPlansCoverage.go +++ /dev/null @@ -1,341 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves the Savings Plans covered for your account. This enables you to see -// how much of your cost is covered by a Savings Plan. An organization’s management -// account can see the coverage of the associated member accounts. This supports -// dimensions, cost categories, and nested expressions. For any time period, you -// can filter data for Savings Plans usage with the following dimensions: -// -// - LINKED_ACCOUNT -// -// - REGION -// -// - SERVICE -// -// - INSTANCE_FAMILY -// -// To determine valid values for a dimension, use the GetDimensionValues operation. -func (c *Client) GetSavingsPlansCoverage(ctx context.Context, params *GetSavingsPlansCoverageInput, optFns ...func(*Options)) (*GetSavingsPlansCoverageOutput, error) { - if params == nil { - params = &GetSavingsPlansCoverageInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetSavingsPlansCoverage", params, optFns, c.addOperationGetSavingsPlansCoverageMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetSavingsPlansCoverageOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetSavingsPlansCoverageInput struct { - - // The time period that you want the usage and costs for. The Start date must be - // within 13 months. The End date must be after the Start date, and before the - // current date. Future dates can't be used as an End date. - // - // This member is required. - TimePeriod *types.DateInterval - - // Filters Savings Plans coverage data by dimensions. You can filter data for - // Savings Plans usage with the following dimensions: - // - // - LINKED_ACCOUNT - // - // - REGION - // - // - SERVICE - // - // - INSTANCE_FAMILY - // - // GetSavingsPlansCoverage uses the same [Expression] object as the other operations, but only - // AND is supported among each dimension. If there are multiple values for a - // dimension, they are OR'd together. - // - // Cost category is also supported. - // - // [Expression]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html - Filter *types.Expression - - // The granularity of the Amazon Web Services cost data for your Savings Plans. - // Granularity can't be set if GroupBy is set. - // - // The GetSavingsPlansCoverage operation supports only DAILY and MONTHLY - // granularities. - Granularity types.Granularity - - // You can group the data using the attributes INSTANCE_FAMILY , REGION , or - // SERVICE . - GroupBy []types.GroupDefinition - - // The number of items to be returned in a response. The default is 20 , with a - // minimum value of 1 . - MaxResults *int32 - - // The measurement that you want your Savings Plans coverage reported in. The only - // valid value is SpendCoveredBySavingsPlans . - Metrics []string - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextToken *string - - // The value that you want to sort the data by. - // - // The following values are supported for Key : - // - // - SpendCoveredBySavingsPlan - // - // - OnDemandCost - // - // - CoveragePercentage - // - // - TotalCost - // - // - InstanceFamily - // - // - Region - // - // - Service - // - // The supported values for SortOrder are ASCENDING and DESCENDING . - SortBy *types.SortDefinition - - noSmithyDocumentSerde -} - -type GetSavingsPlansCoverageOutput struct { - - // The amount of spend that your Savings Plans covered. - // - // This member is required. - SavingsPlansCoverages []types.SavingsPlansCoverage - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetSavingsPlansCoverageMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetSavingsPlansCoverage{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetSavingsPlansCoverage{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetSavingsPlansCoverage"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetSavingsPlansCoverageValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSavingsPlansCoverage(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// GetSavingsPlansCoveragePaginatorOptions is the paginator options for -// GetSavingsPlansCoverage -type GetSavingsPlansCoveragePaginatorOptions struct { - // The number of items to be returned in a response. The default is 20 , with a - // minimum value of 1 . - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetSavingsPlansCoveragePaginator is a paginator for GetSavingsPlansCoverage -type GetSavingsPlansCoveragePaginator struct { - options GetSavingsPlansCoveragePaginatorOptions - client GetSavingsPlansCoverageAPIClient - params *GetSavingsPlansCoverageInput - nextToken *string - firstPage bool -} - -// NewGetSavingsPlansCoveragePaginator returns a new -// GetSavingsPlansCoveragePaginator -func NewGetSavingsPlansCoveragePaginator(client GetSavingsPlansCoverageAPIClient, params *GetSavingsPlansCoverageInput, optFns ...func(*GetSavingsPlansCoveragePaginatorOptions)) *GetSavingsPlansCoveragePaginator { - if params == nil { - params = &GetSavingsPlansCoverageInput{} - } - - options := GetSavingsPlansCoveragePaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetSavingsPlansCoveragePaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetSavingsPlansCoveragePaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetSavingsPlansCoverage page. -func (p *GetSavingsPlansCoveragePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSavingsPlansCoverageOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetSavingsPlansCoverage(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetSavingsPlansCoverageAPIClient is a client that implements the -// GetSavingsPlansCoverage operation. -type GetSavingsPlansCoverageAPIClient interface { - GetSavingsPlansCoverage(context.Context, *GetSavingsPlansCoverageInput, ...func(*Options)) (*GetSavingsPlansCoverageOutput, error) -} - -var _ GetSavingsPlansCoverageAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetSavingsPlansCoverage(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetSavingsPlansCoverage", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetSavingsPlansPurchaseRecommendation.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetSavingsPlansPurchaseRecommendation.go deleted file mode 100644 index c6d28925a7..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetSavingsPlansPurchaseRecommendation.go +++ /dev/null @@ -1,212 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves the Savings Plans recommendations for your account. First use -// StartSavingsPlansPurchaseRecommendationGeneration to generate a new set of -// recommendations, and then use GetSavingsPlansPurchaseRecommendation to retrieve -// them. -func (c *Client) GetSavingsPlansPurchaseRecommendation(ctx context.Context, params *GetSavingsPlansPurchaseRecommendationInput, optFns ...func(*Options)) (*GetSavingsPlansPurchaseRecommendationOutput, error) { - if params == nil { - params = &GetSavingsPlansPurchaseRecommendationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetSavingsPlansPurchaseRecommendation", params, optFns, c.addOperationGetSavingsPlansPurchaseRecommendationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetSavingsPlansPurchaseRecommendationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetSavingsPlansPurchaseRecommendationInput struct { - - // The lookback period that's used to generate the recommendation. - // - // This member is required. - LookbackPeriodInDays types.LookbackPeriodInDays - - // The payment option that's used to generate these recommendations. - // - // This member is required. - PaymentOption types.PaymentOption - - // The Savings Plans recommendation type that's requested. - // - // This member is required. - SavingsPlansType types.SupportedSavingsPlansType - - // The savings plan recommendation term that's used to generate these - // recommendations. - // - // This member is required. - TermInYears types.TermInYears - - // The account scope that you want your recommendations for. Amazon Web Services - // calculates recommendations including the management account and member accounts - // if the value is set to PAYER . If the value is LINKED , recommendations are - // calculated for individual member accounts only. - AccountScope types.AccountScope - - // You can filter your recommendations by Account ID with the LINKED_ACCOUNT - // dimension. To filter your recommendations by Account ID, specify Key as - // LINKED_ACCOUNT and Value as the comma-separated Acount ID(s) that you want to - // see Savings Plans purchase recommendations for. - // - // For GetSavingsPlansPurchaseRecommendation, the Filter doesn't include - // CostCategories or Tags . It only includes Dimensions . With Dimensions , Key - // must be LINKED_ACCOUNT and Value can be a single Account ID or multiple - // comma-separated Account IDs that you want to see Savings Plans Purchase - // Recommendations for. AND and OR operators are not supported. - Filter *types.Expression - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextPageToken *string - - // The number of recommendations that you want returned in a single response - // object. - PageSize int32 - - noSmithyDocumentSerde -} - -type GetSavingsPlansPurchaseRecommendationOutput struct { - - // Information that regards this specific recommendation set. - Metadata *types.SavingsPlansPurchaseRecommendationMetadata - - // The token for the next set of retrievable results. Amazon Web Services provides - // the token when the response from a previous call has more results than the - // maximum page size. - NextPageToken *string - - // Contains your request parameters, Savings Plan Recommendations Summary, and - // Details. - SavingsPlansPurchaseRecommendation *types.SavingsPlansPurchaseRecommendation - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetSavingsPlansPurchaseRecommendationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetSavingsPlansPurchaseRecommendation{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetSavingsPlansPurchaseRecommendation{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetSavingsPlansPurchaseRecommendation"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetSavingsPlansPurchaseRecommendationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSavingsPlansPurchaseRecommendation(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetSavingsPlansPurchaseRecommendation(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetSavingsPlansPurchaseRecommendation", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetSavingsPlansUtilization.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetSavingsPlansUtilization.go deleted file mode 100644 index 499d2277d8..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetSavingsPlansUtilization.go +++ /dev/null @@ -1,216 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves the Savings Plans utilization for your account across date ranges -// with daily or monthly granularity. Management account in an organization have -// access to member accounts. You can use GetDimensionValues in SAVINGS_PLANS to -// determine the possible dimension values. -// -// You can't group by any dimension values for GetSavingsPlansUtilization . -func (c *Client) GetSavingsPlansUtilization(ctx context.Context, params *GetSavingsPlansUtilizationInput, optFns ...func(*Options)) (*GetSavingsPlansUtilizationOutput, error) { - if params == nil { - params = &GetSavingsPlansUtilizationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetSavingsPlansUtilization", params, optFns, c.addOperationGetSavingsPlansUtilizationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetSavingsPlansUtilizationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetSavingsPlansUtilizationInput struct { - - // The time period that you want the usage and costs for. The Start date must be - // within 13 months. The End date must be after the Start date, and before the - // current date. Future dates can't be used as an End date. - // - // This member is required. - TimePeriod *types.DateInterval - - // Filters Savings Plans utilization coverage data for active Savings Plans - // dimensions. You can filter data with the following dimensions: - // - // - LINKED_ACCOUNT - // - // - SAVINGS_PLAN_ARN - // - // - SAVINGS_PLANS_TYPE - // - // - REGION - // - // - PAYMENT_OPTION - // - // - INSTANCE_TYPE_FAMILY - // - // GetSavingsPlansUtilization uses the same [Expression] object as the other operations, but - // only AND is supported among each dimension. - // - // [Expression]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html - Filter *types.Expression - - // The granularity of the Amazon Web Services utillization data for your Savings - // Plans. - // - // The GetSavingsPlansUtilization operation supports only DAILY and MONTHLY - // granularities. - Granularity types.Granularity - - // The value that you want to sort the data by. - // - // The following values are supported for Key : - // - // - UtilizationPercentage - // - // - TotalCommitment - // - // - UsedCommitment - // - // - UnusedCommitment - // - // - NetSavings - // - // The supported values for SortOrder are ASCENDING and DESCENDING . - SortBy *types.SortDefinition - - noSmithyDocumentSerde -} - -type GetSavingsPlansUtilizationOutput struct { - - // The total amount of cost/commitment that you used your Savings Plans, - // regardless of date ranges. - // - // This member is required. - Total *types.SavingsPlansUtilizationAggregates - - // The amount of cost/commitment that you used your Savings Plans. You can use it - // to specify date ranges. - SavingsPlansUtilizationsByTime []types.SavingsPlansUtilizationByTime - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetSavingsPlansUtilizationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetSavingsPlansUtilization{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetSavingsPlansUtilization{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetSavingsPlansUtilization"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetSavingsPlansUtilizationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSavingsPlansUtilization(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetSavingsPlansUtilization(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetSavingsPlansUtilization", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetSavingsPlansUtilizationDetails.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetSavingsPlansUtilizationDetails.go deleted file mode 100644 index 8a00d839da..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetSavingsPlansUtilizationDetails.go +++ /dev/null @@ -1,332 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves attribute data along with aggregate utilization and savings data for -// a given time period. This doesn't support granular or grouped data -// (daily/monthly) in response. You can't retrieve data by dates in a single -// response similar to GetSavingsPlanUtilization , but you have the option to make -// multiple calls to GetSavingsPlanUtilizationDetails by providing individual -// dates. You can use GetDimensionValues in SAVINGS_PLANS to determine the -// possible dimension values. -// -// GetSavingsPlanUtilizationDetails internally groups data by SavingsPlansArn . -func (c *Client) GetSavingsPlansUtilizationDetails(ctx context.Context, params *GetSavingsPlansUtilizationDetailsInput, optFns ...func(*Options)) (*GetSavingsPlansUtilizationDetailsOutput, error) { - if params == nil { - params = &GetSavingsPlansUtilizationDetailsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetSavingsPlansUtilizationDetails", params, optFns, c.addOperationGetSavingsPlansUtilizationDetailsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetSavingsPlansUtilizationDetailsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetSavingsPlansUtilizationDetailsInput struct { - - // The time period that you want the usage and costs for. The Start date must be - // within 13 months. The End date must be after the Start date, and before the - // current date. Future dates can't be used as an End date. - // - // This member is required. - TimePeriod *types.DateInterval - - // The data type. - DataType []types.SavingsPlansDataType - - // Filters Savings Plans utilization coverage data for active Savings Plans - // dimensions. You can filter data with the following dimensions: - // - // - LINKED_ACCOUNT - // - // - SAVINGS_PLAN_ARN - // - // - REGION - // - // - PAYMENT_OPTION - // - // - INSTANCE_TYPE_FAMILY - // - // GetSavingsPlansUtilizationDetails uses the same [Expression] object as the other - // operations, but only AND is supported among each dimension. - // - // [Expression]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html - Filter *types.Expression - - // The number of items to be returned in a response. The default is 20 , with a - // minimum value of 1 . - MaxResults *int32 - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextToken *string - - // The value that you want to sort the data by. - // - // The following values are supported for Key : - // - // - UtilizationPercentage - // - // - TotalCommitment - // - // - UsedCommitment - // - // - UnusedCommitment - // - // - NetSavings - // - // - AmortizedRecurringCommitment - // - // - AmortizedUpfrontCommitment - // - // The supported values for SortOrder are ASCENDING and DESCENDING . - SortBy *types.SortDefinition - - noSmithyDocumentSerde -} - -type GetSavingsPlansUtilizationDetailsOutput struct { - - // Retrieves a single daily or monthly Savings Plans utilization rate and details - // for your account. - // - // This member is required. - SavingsPlansUtilizationDetails []types.SavingsPlansUtilizationDetail - - // The time period of the request. - // - // This member is required. - TimePeriod *types.DateInterval - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextToken *string - - // The total Savings Plans utilization, regardless of time period. - Total *types.SavingsPlansUtilizationAggregates - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetSavingsPlansUtilizationDetailsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetSavingsPlansUtilizationDetails{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetSavingsPlansUtilizationDetails{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetSavingsPlansUtilizationDetails"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetSavingsPlansUtilizationDetailsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSavingsPlansUtilizationDetails(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// GetSavingsPlansUtilizationDetailsPaginatorOptions is the paginator options for -// GetSavingsPlansUtilizationDetails -type GetSavingsPlansUtilizationDetailsPaginatorOptions struct { - // The number of items to be returned in a response. The default is 20 , with a - // minimum value of 1 . - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// GetSavingsPlansUtilizationDetailsPaginator is a paginator for -// GetSavingsPlansUtilizationDetails -type GetSavingsPlansUtilizationDetailsPaginator struct { - options GetSavingsPlansUtilizationDetailsPaginatorOptions - client GetSavingsPlansUtilizationDetailsAPIClient - params *GetSavingsPlansUtilizationDetailsInput - nextToken *string - firstPage bool -} - -// NewGetSavingsPlansUtilizationDetailsPaginator returns a new -// GetSavingsPlansUtilizationDetailsPaginator -func NewGetSavingsPlansUtilizationDetailsPaginator(client GetSavingsPlansUtilizationDetailsAPIClient, params *GetSavingsPlansUtilizationDetailsInput, optFns ...func(*GetSavingsPlansUtilizationDetailsPaginatorOptions)) *GetSavingsPlansUtilizationDetailsPaginator { - if params == nil { - params = &GetSavingsPlansUtilizationDetailsInput{} - } - - options := GetSavingsPlansUtilizationDetailsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &GetSavingsPlansUtilizationDetailsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *GetSavingsPlansUtilizationDetailsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next GetSavingsPlansUtilizationDetails page. -func (p *GetSavingsPlansUtilizationDetailsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetSavingsPlansUtilizationDetailsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.GetSavingsPlansUtilizationDetails(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// GetSavingsPlansUtilizationDetailsAPIClient is a client that implements the -// GetSavingsPlansUtilizationDetails operation. -type GetSavingsPlansUtilizationDetailsAPIClient interface { - GetSavingsPlansUtilizationDetails(context.Context, *GetSavingsPlansUtilizationDetailsInput, ...func(*Options)) (*GetSavingsPlansUtilizationDetailsOutput, error) -} - -var _ GetSavingsPlansUtilizationDetailsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opGetSavingsPlansUtilizationDetails(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetSavingsPlansUtilizationDetails", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetTags.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetTags.go deleted file mode 100644 index a5987d4773..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetTags.go +++ /dev/null @@ -1,304 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Queries for available tag keys and tag values for a specified period. You can -// search the tag values for an arbitrary string. -func (c *Client) GetTags(ctx context.Context, params *GetTagsInput, optFns ...func(*Options)) (*GetTagsOutput, error) { - if params == nil { - params = &GetTagsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetTags", params, optFns, c.addOperationGetTagsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetTagsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetTagsInput struct { - - // The start and end dates for retrieving the dimension values. The start date is - // inclusive, but the end date is exclusive. For example, if start is 2017-01-01 - // and end is 2017-05-01 , then the cost and usage data is retrieved from - // 2017-01-01 up to and including 2017-04-30 but not including 2017-05-01 . - // - // This member is required. - TimePeriod *types.DateInterval - - // The Amazon Resource Name (ARN) that uniquely identifies a specific billing - // view. The ARN is used to specify which particular billing view you want to - // interact with or retrieve information from when making API calls related to - // Amazon Web Services Billing and Cost Management features. The BillingViewArn can - // be retrieved by calling the ListBillingViews API. - BillingViewArn *string - - // Use Expression to filter in various Cost Explorer APIs. - // - // Not all Expression types are supported in each API. Refer to the documentation - // for each specific API to see what is supported. - // - // There are two patterns: - // - // - Simple dimension values. - // - // - There are three types of simple dimension values: CostCategories , Tags , - // and Dimensions . - // - // - Specify the CostCategories field to define a filter that acts on Cost - // Categories. - // - // - Specify the Tags field to define a filter that acts on Cost Allocation Tags. - // - // - Specify the Dimensions field to define a filter that acts on the [DimensionValues] - // DimensionValues . - // - // - For each filter type, you can set the dimension name and values for the - // filters that you plan to use. - // - // - For example, you can filter for REGION==us-east-1 OR REGION==us-west-1 . For - // GetRightsizingRecommendation , the Region is a full name (for example, - // REGION==US East (N. Virginia) . - // - // - The corresponding Expression for this example is as follows: { - // "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] } } - // - // - As shown in the previous example, lists of dimension values are combined - // with OR when applying the filter. - // - // - You can also set different match options to further control how the filter - // behaves. Not all APIs support match options. Refer to the documentation for each - // specific API to see what is supported. - // - // - For example, you can filter for linked account names that start with "a". - // - // - The corresponding Expression for this example is as follows: { - // "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": [ "STARTS_WITH" ], - // "Values": [ "a" ] } } - // - // - Compound Expression types with logical operations. - // - // - You can use multiple Expression types and the logical operators AND/OR/NOT - // to create a list of one or more Expression objects. By doing this, you can - // filter by more advanced options. - // - // - For example, you can filter by ((REGION == us-east-1 OR REGION == - // us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer) . - // - // - The corresponding Expression for this example is as follows: { "And": [ - // {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" - // ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": - // {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] } - // - // Because each Expression can have only one operator, the service returns an error - // if more than one is specified. The following example shows an Expression - // object that creates an error: { "And": [ ... ], "Dimensions": { "Key": - // "USAGE_TYPE", "Values": [ "DataTransfer" ] } } - // - // The following is an example of the corresponding error message: "Expression has - // more than one roots. Only one root operator is allowed for each expression: And, - // Or, Not, Dimensions, Tags, CostCategories" - // - // For the GetRightsizingRecommendation action, a combination of OR and NOT isn't - // supported. OR isn't supported between different dimensions, or dimensions and - // tags. NOT operators aren't supported. Dimensions are also limited to - // LINKED_ACCOUNT , REGION , or RIGHTSIZING_TYPE . - // - // For the GetReservationPurchaseRecommendation action, only NOT is supported. AND - // and OR aren't supported. Dimensions are limited to LINKED_ACCOUNT . - // - // [DimensionValues]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html - Filter *types.Expression - - // This field is only used when SortBy is provided in the request. The maximum - // number of objects that are returned for this request. If MaxResults isn't - // specified with SortBy, the request returns 1000 results as the default value for - // this parameter. - // - // For GetTags , MaxResults has an upper quota of 1000. - MaxResults *int32 - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextPageToken *string - - // The value that you want to search for. - SearchString *string - - // The value that you want to sort the data by. - // - // The key represents cost and usage metrics. The following values are supported: - // - // - BlendedCost - // - // - UnblendedCost - // - // - AmortizedCost - // - // - NetAmortizedCost - // - // - NetUnblendedCost - // - // - UsageQuantity - // - // - NormalizedUsageAmount - // - // The supported values for SortOrder are ASCENDING and DESCENDING . - // - // When you use SortBy , NextPageToken and SearchString aren't supported. - SortBy []types.SortDefinition - - // The key of the tag that you want to return values for. - TagKey *string - - noSmithyDocumentSerde -} - -type GetTagsOutput struct { - - // The number of query results that Amazon Web Services returns at a time. - // - // This member is required. - ReturnSize *int32 - - // The tags that match your request. - // - // This member is required. - Tags []string - - // The total number of query results. - // - // This member is required. - TotalSize *int32 - - // The token for the next set of retrievable results. Amazon Web Services provides - // the token when the response from a previous call has more results than the - // maximum page size. - NextPageToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetTagsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetTags{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetTags{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetTags"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetTagsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTags(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetTags(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetTags", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetUsageForecast.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetUsageForecast.go deleted file mode 100644 index 88dc0b3729..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_GetUsageForecast.go +++ /dev/null @@ -1,250 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves a forecast for how much Amazon Web Services predicts that you will -// use over the forecast time period that you select, based on your past usage. -func (c *Client) GetUsageForecast(ctx context.Context, params *GetUsageForecastInput, optFns ...func(*Options)) (*GetUsageForecastOutput, error) { - if params == nil { - params = &GetUsageForecastInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "GetUsageForecast", params, optFns, c.addOperationGetUsageForecastMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*GetUsageForecastOutput) - out.ResultMetadata = metadata - return out, nil -} - -type GetUsageForecastInput struct { - - // How granular you want the forecast to be. You can get 3 months of DAILY - // forecasts or 18 months of MONTHLY forecasts. - // - // The GetUsageForecast operation supports only DAILY and MONTHLY granularities. - // - // This member is required. - Granularity types.Granularity - - // Which metric Cost Explorer uses to create your forecast. - // - // Valid values for a GetUsageForecast call are the following: - // - // - USAGE_QUANTITY - // - // - NORMALIZED_USAGE_AMOUNT - // - // This member is required. - Metric types.Metric - - // The start and end dates of the period that you want to retrieve usage forecast - // for. The start date is included in the period, but the end date isn't included - // in the period. For example, if start is 2017-01-01 and end is 2017-05-01 , then - // the cost and usage data is retrieved from 2017-01-01 up to and including - // 2017-04-30 but not including 2017-05-01 . The start date must be equal to or - // later than the current date to avoid a validation error. - // - // This member is required. - TimePeriod *types.DateInterval - - // The Amazon Resource Name (ARN) that uniquely identifies a specific billing - // view. The ARN is used to specify which particular billing view you want to - // interact with or retrieve information from when making API calls related to - // Amazon Web Services Billing and Cost Management features. The BillingViewArn can - // be retrieved by calling the ListBillingViews API. - BillingViewArn *string - - // The filters that you want to use to filter your forecast. The GetUsageForecast - // API supports filtering by the following dimensions: - // - // - AZ - // - // - INSTANCE_TYPE - // - // - LINKED_ACCOUNT - // - // - LINKED_ACCOUNT_NAME - // - // - OPERATION - // - // - PURCHASE_TYPE - // - // - REGION - // - // - SERVICE - // - // - USAGE_TYPE - // - // - USAGE_TYPE_GROUP - // - // - RECORD_TYPE - // - // - OPERATING_SYSTEM - // - // - TENANCY - // - // - SCOPE - // - // - PLATFORM - // - // - SUBSCRIPTION_ID - // - // - LEGAL_ENTITY_NAME - // - // - DEPLOYMENT_OPTION - // - // - DATABASE_ENGINE - // - // - INSTANCE_TYPE_FAMILY - // - // - BILLING_ENTITY - // - // - RESERVATION_ID - // - // - SAVINGS_PLAN_ARN - Filter *types.Expression - - // Amazon Web Services Cost Explorer always returns the mean forecast as a single - // point. You can request a prediction interval around the mean by specifying a - // confidence level. The higher the confidence level, the more confident Cost - // Explorer is about the actual value falling in the prediction interval. Higher - // confidence levels result in wider prediction intervals. - PredictionIntervalLevel *int32 - - noSmithyDocumentSerde -} - -type GetUsageForecastOutput struct { - - // The forecasts for your query, in order. For DAILY forecasts, this is a list of - // days. For MONTHLY forecasts, this is a list of months. - ForecastResultsByTime []types.ForecastResult - - // How much you're forecasted to use over the forecast period. - Total *types.MetricValue - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationGetUsageForecastMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetUsageForecast{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetUsageForecast{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "GetUsageForecast"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpGetUsageForecastValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetUsageForecast(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opGetUsageForecast(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "GetUsageForecast", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListCommitmentPurchaseAnalyses.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListCommitmentPurchaseAnalyses.go deleted file mode 100644 index 37dc67c1ed..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListCommitmentPurchaseAnalyses.go +++ /dev/null @@ -1,256 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the commitment purchase analyses for your account. -func (c *Client) ListCommitmentPurchaseAnalyses(ctx context.Context, params *ListCommitmentPurchaseAnalysesInput, optFns ...func(*Options)) (*ListCommitmentPurchaseAnalysesOutput, error) { - if params == nil { - params = &ListCommitmentPurchaseAnalysesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListCommitmentPurchaseAnalyses", params, optFns, c.addOperationListCommitmentPurchaseAnalysesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListCommitmentPurchaseAnalysesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListCommitmentPurchaseAnalysesInput struct { - - // The analysis IDs associated with the commitment purchase analyses. - AnalysisIds []string - - // The status of the analysis. - AnalysisStatus types.AnalysisStatus - - // The token to retrieve the next set of results. - NextPageToken *string - - // The number of analyses that you want returned in a single response object. - PageSize int32 - - noSmithyDocumentSerde -} - -type ListCommitmentPurchaseAnalysesOutput struct { - - // The list of analyses. - AnalysisSummaryList []types.AnalysisSummary - - // The token to retrieve the next set of results. - NextPageToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListCommitmentPurchaseAnalysesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListCommitmentPurchaseAnalyses{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListCommitmentPurchaseAnalyses{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListCommitmentPurchaseAnalyses"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCommitmentPurchaseAnalyses(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListCommitmentPurchaseAnalysesPaginatorOptions is the paginator options for -// ListCommitmentPurchaseAnalyses -type ListCommitmentPurchaseAnalysesPaginatorOptions struct { - // The number of analyses that you want returned in a single response object. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListCommitmentPurchaseAnalysesPaginator is a paginator for -// ListCommitmentPurchaseAnalyses -type ListCommitmentPurchaseAnalysesPaginator struct { - options ListCommitmentPurchaseAnalysesPaginatorOptions - client ListCommitmentPurchaseAnalysesAPIClient - params *ListCommitmentPurchaseAnalysesInput - nextToken *string - firstPage bool -} - -// NewListCommitmentPurchaseAnalysesPaginator returns a new -// ListCommitmentPurchaseAnalysesPaginator -func NewListCommitmentPurchaseAnalysesPaginator(client ListCommitmentPurchaseAnalysesAPIClient, params *ListCommitmentPurchaseAnalysesInput, optFns ...func(*ListCommitmentPurchaseAnalysesPaginatorOptions)) *ListCommitmentPurchaseAnalysesPaginator { - if params == nil { - params = &ListCommitmentPurchaseAnalysesInput{} - } - - options := ListCommitmentPurchaseAnalysesPaginatorOptions{} - if params.PageSize != 0 { - options.Limit = params.PageSize - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListCommitmentPurchaseAnalysesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextPageToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListCommitmentPurchaseAnalysesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListCommitmentPurchaseAnalyses page. -func (p *ListCommitmentPurchaseAnalysesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCommitmentPurchaseAnalysesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextPageToken = p.nextToken - - params.PageSize = p.options.Limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListCommitmentPurchaseAnalyses(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextPageToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListCommitmentPurchaseAnalysesAPIClient is a client that implements the -// ListCommitmentPurchaseAnalyses operation. -type ListCommitmentPurchaseAnalysesAPIClient interface { - ListCommitmentPurchaseAnalyses(context.Context, *ListCommitmentPurchaseAnalysesInput, ...func(*Options)) (*ListCommitmentPurchaseAnalysesOutput, error) -} - -var _ ListCommitmentPurchaseAnalysesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListCommitmentPurchaseAnalyses(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListCommitmentPurchaseAnalyses", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListCostAllocationTagBackfillHistory.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListCostAllocationTagBackfillHistory.go deleted file mode 100644 index 2fab412329..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListCostAllocationTagBackfillHistory.go +++ /dev/null @@ -1,258 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves a list of your historical cost allocation tag backfill requests. -func (c *Client) ListCostAllocationTagBackfillHistory(ctx context.Context, params *ListCostAllocationTagBackfillHistoryInput, optFns ...func(*Options)) (*ListCostAllocationTagBackfillHistoryOutput, error) { - if params == nil { - params = &ListCostAllocationTagBackfillHistoryInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListCostAllocationTagBackfillHistory", params, optFns, c.addOperationListCostAllocationTagBackfillHistoryMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListCostAllocationTagBackfillHistoryOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListCostAllocationTagBackfillHistoryInput struct { - - // The maximum number of objects that are returned for this request. - MaxResults *int32 - - // The token to retrieve the next set of results. Amazon Web Services provides - // the token when the response from a previous call has more results than the - // maximum page size. - NextToken *string - - noSmithyDocumentSerde -} - -type ListCostAllocationTagBackfillHistoryOutput struct { - - // The list of historical cost allocation tag backfill requests. - BackfillRequests []types.CostAllocationTagBackfillRequest - - // The token to retrieve the next set of results. Amazon Web Services provides - // the token when the response from a previous call has more results than the - // maximum page size. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListCostAllocationTagBackfillHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListCostAllocationTagBackfillHistory{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListCostAllocationTagBackfillHistory{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListCostAllocationTagBackfillHistory"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCostAllocationTagBackfillHistory(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListCostAllocationTagBackfillHistoryPaginatorOptions is the paginator options -// for ListCostAllocationTagBackfillHistory -type ListCostAllocationTagBackfillHistoryPaginatorOptions struct { - // The maximum number of objects that are returned for this request. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListCostAllocationTagBackfillHistoryPaginator is a paginator for -// ListCostAllocationTagBackfillHistory -type ListCostAllocationTagBackfillHistoryPaginator struct { - options ListCostAllocationTagBackfillHistoryPaginatorOptions - client ListCostAllocationTagBackfillHistoryAPIClient - params *ListCostAllocationTagBackfillHistoryInput - nextToken *string - firstPage bool -} - -// NewListCostAllocationTagBackfillHistoryPaginator returns a new -// ListCostAllocationTagBackfillHistoryPaginator -func NewListCostAllocationTagBackfillHistoryPaginator(client ListCostAllocationTagBackfillHistoryAPIClient, params *ListCostAllocationTagBackfillHistoryInput, optFns ...func(*ListCostAllocationTagBackfillHistoryPaginatorOptions)) *ListCostAllocationTagBackfillHistoryPaginator { - if params == nil { - params = &ListCostAllocationTagBackfillHistoryInput{} - } - - options := ListCostAllocationTagBackfillHistoryPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListCostAllocationTagBackfillHistoryPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListCostAllocationTagBackfillHistoryPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListCostAllocationTagBackfillHistory page. -func (p *ListCostAllocationTagBackfillHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCostAllocationTagBackfillHistoryOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListCostAllocationTagBackfillHistory(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListCostAllocationTagBackfillHistoryAPIClient is a client that implements the -// ListCostAllocationTagBackfillHistory operation. -type ListCostAllocationTagBackfillHistoryAPIClient interface { - ListCostAllocationTagBackfillHistory(context.Context, *ListCostAllocationTagBackfillHistoryInput, ...func(*Options)) (*ListCostAllocationTagBackfillHistoryOutput, error) -} - -var _ ListCostAllocationTagBackfillHistoryAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListCostAllocationTagBackfillHistory(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListCostAllocationTagBackfillHistory", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListCostAllocationTags.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListCostAllocationTags.go deleted file mode 100644 index afc1eb6bff..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListCostAllocationTags.go +++ /dev/null @@ -1,272 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Get a list of cost allocation tags. All inputs in the API are optional and -// serve as filters. By default, all cost allocation tags are returned. -func (c *Client) ListCostAllocationTags(ctx context.Context, params *ListCostAllocationTagsInput, optFns ...func(*Options)) (*ListCostAllocationTagsOutput, error) { - if params == nil { - params = &ListCostAllocationTagsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListCostAllocationTags", params, optFns, c.addOperationListCostAllocationTagsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListCostAllocationTagsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListCostAllocationTagsInput struct { - - // The maximum number of objects that are returned for this request. By default, - // the request returns 100 results. - MaxResults *int32 - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextToken *string - - // The status of cost allocation tag keys that are returned for this request. - Status types.CostAllocationTagStatus - - // The list of cost allocation tag keys that are returned for this request. - TagKeys []string - - // The type of CostAllocationTag object that are returned for this request. The - // AWSGenerated type tags are tags that Amazon Web Services defines and applies to - // support Amazon Web Services resources for cost allocation purposes. The - // UserDefined type tags are tags that you define, create, and apply to resources. - Type types.CostAllocationTagType - - noSmithyDocumentSerde -} - -type ListCostAllocationTagsOutput struct { - - // A list of cost allocation tags that includes the detailed metadata for each - // one. - CostAllocationTags []types.CostAllocationTag - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListCostAllocationTagsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListCostAllocationTags{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListCostAllocationTags{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListCostAllocationTags"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCostAllocationTags(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListCostAllocationTagsPaginatorOptions is the paginator options for -// ListCostAllocationTags -type ListCostAllocationTagsPaginatorOptions struct { - // The maximum number of objects that are returned for this request. By default, - // the request returns 100 results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListCostAllocationTagsPaginator is a paginator for ListCostAllocationTags -type ListCostAllocationTagsPaginator struct { - options ListCostAllocationTagsPaginatorOptions - client ListCostAllocationTagsAPIClient - params *ListCostAllocationTagsInput - nextToken *string - firstPage bool -} - -// NewListCostAllocationTagsPaginator returns a new ListCostAllocationTagsPaginator -func NewListCostAllocationTagsPaginator(client ListCostAllocationTagsAPIClient, params *ListCostAllocationTagsInput, optFns ...func(*ListCostAllocationTagsPaginatorOptions)) *ListCostAllocationTagsPaginator { - if params == nil { - params = &ListCostAllocationTagsInput{} - } - - options := ListCostAllocationTagsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListCostAllocationTagsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListCostAllocationTagsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListCostAllocationTags page. -func (p *ListCostAllocationTagsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCostAllocationTagsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListCostAllocationTags(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListCostAllocationTagsAPIClient is a client that implements the -// ListCostAllocationTags operation. -type ListCostAllocationTagsAPIClient interface { - ListCostAllocationTags(context.Context, *ListCostAllocationTagsInput, ...func(*Options)) (*ListCostAllocationTagsOutput, error) -} - -var _ ListCostAllocationTagsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListCostAllocationTags(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListCostAllocationTags", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListCostCategoryDefinitions.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListCostCategoryDefinitions.go deleted file mode 100644 index 3f51eb20f4..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListCostCategoryDefinitions.go +++ /dev/null @@ -1,276 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns the name, Amazon Resource Name (ARN), NumberOfRules and effective dates -// of all cost categories defined in the account. You have the option to use -// EffectiveOn and SupportedResourceTypes to return a list of cost categories that -// were active on a specific date. If there is no EffectiveOn specified, you’ll -// see cost categories that are effective on the current date. If cost category is -// still effective, EffectiveEnd is omitted in the response. -// ListCostCategoryDefinitions supports pagination. The request can have a -// MaxResults range up to 100. -func (c *Client) ListCostCategoryDefinitions(ctx context.Context, params *ListCostCategoryDefinitionsInput, optFns ...func(*Options)) (*ListCostCategoryDefinitionsOutput, error) { - if params == nil { - params = &ListCostCategoryDefinitionsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListCostCategoryDefinitions", params, optFns, c.addOperationListCostCategoryDefinitionsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListCostCategoryDefinitionsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListCostCategoryDefinitionsInput struct { - - // The date when the cost category was effective. - EffectiveOn *string - - // The number of entries a paginated response contains. - MaxResults *int32 - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextToken *string - - // Filter cost category definitions that are supported by given resource types - // based on the latest version. If the filter is present, the result only includes - // Cost Categories that supports input resource type. If the filter isn't provided, - // no filtering is applied. The valid values are billing:rispgroupsharing and - // billing:billingview . - SupportedResourceTypes []string - - noSmithyDocumentSerde -} - -type ListCostCategoryDefinitionsOutput struct { - - // A reference to a cost category that contains enough information to identify the - // Cost Category. - CostCategoryReferences []types.CostCategoryReference - - // The token to retrieve the next set of results. Amazon Web Services provides the - // token when the response from a previous call has more results than the maximum - // page size. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListCostCategoryDefinitionsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListCostCategoryDefinitions{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListCostCategoryDefinitions{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListCostCategoryDefinitions"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCostCategoryDefinitions(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListCostCategoryDefinitionsPaginatorOptions is the paginator options for -// ListCostCategoryDefinitions -type ListCostCategoryDefinitionsPaginatorOptions struct { - // The number of entries a paginated response contains. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListCostCategoryDefinitionsPaginator is a paginator for -// ListCostCategoryDefinitions -type ListCostCategoryDefinitionsPaginator struct { - options ListCostCategoryDefinitionsPaginatorOptions - client ListCostCategoryDefinitionsAPIClient - params *ListCostCategoryDefinitionsInput - nextToken *string - firstPage bool -} - -// NewListCostCategoryDefinitionsPaginator returns a new -// ListCostCategoryDefinitionsPaginator -func NewListCostCategoryDefinitionsPaginator(client ListCostCategoryDefinitionsAPIClient, params *ListCostCategoryDefinitionsInput, optFns ...func(*ListCostCategoryDefinitionsPaginatorOptions)) *ListCostCategoryDefinitionsPaginator { - if params == nil { - params = &ListCostCategoryDefinitionsInput{} - } - - options := ListCostCategoryDefinitionsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListCostCategoryDefinitionsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListCostCategoryDefinitionsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListCostCategoryDefinitions page. -func (p *ListCostCategoryDefinitionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCostCategoryDefinitionsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListCostCategoryDefinitions(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListCostCategoryDefinitionsAPIClient is a client that implements the -// ListCostCategoryDefinitions operation. -type ListCostCategoryDefinitionsAPIClient interface { - ListCostCategoryDefinitions(context.Context, *ListCostCategoryDefinitionsInput, ...func(*Options)) (*ListCostCategoryDefinitionsOutput, error) -} - -var _ ListCostCategoryDefinitionsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListCostCategoryDefinitions(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListCostCategoryDefinitions", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListCostCategoryResourceAssociations.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListCostCategoryResourceAssociations.go deleted file mode 100644 index da151cc652..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListCostCategoryResourceAssociations.go +++ /dev/null @@ -1,265 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns resource associations of all cost categories defined in the account. -// You have the option to use CostCategoryArn to get the association for a -// specific cost category. ListCostCategoryResourceAssociations supports -// pagination. The request can have a MaxResults range up to 100. -func (c *Client) ListCostCategoryResourceAssociations(ctx context.Context, params *ListCostCategoryResourceAssociationsInput, optFns ...func(*Options)) (*ListCostCategoryResourceAssociationsOutput, error) { - if params == nil { - params = &ListCostCategoryResourceAssociationsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListCostCategoryResourceAssociations", params, optFns, c.addOperationListCostCategoryResourceAssociationsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListCostCategoryResourceAssociationsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListCostCategoryResourceAssociationsInput struct { - - // The unique identifier for your cost category. - CostCategoryArn *string - - // The number of entries a paginated response contains. - MaxResults *int32 - - // The token to retrieve the next set of results. Amazon Web Services provides - // the token when the response from a previous call has more results than the - // maximum page size. - NextToken *string - - noSmithyDocumentSerde -} - -type ListCostCategoryResourceAssociationsOutput struct { - - // A reference to a cost category association that contains information on an - // associated resource. - CostCategoryResourceAssociations []types.CostCategoryResourceAssociation - - // The token to retrieve the next set of results. Amazon Web Services provides - // the token when the response from a previous call has more results than the - // maximum page size. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListCostCategoryResourceAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListCostCategoryResourceAssociations{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListCostCategoryResourceAssociations{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListCostCategoryResourceAssociations"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCostCategoryResourceAssociations(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListCostCategoryResourceAssociationsPaginatorOptions is the paginator options -// for ListCostCategoryResourceAssociations -type ListCostCategoryResourceAssociationsPaginatorOptions struct { - // The number of entries a paginated response contains. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListCostCategoryResourceAssociationsPaginator is a paginator for -// ListCostCategoryResourceAssociations -type ListCostCategoryResourceAssociationsPaginator struct { - options ListCostCategoryResourceAssociationsPaginatorOptions - client ListCostCategoryResourceAssociationsAPIClient - params *ListCostCategoryResourceAssociationsInput - nextToken *string - firstPage bool -} - -// NewListCostCategoryResourceAssociationsPaginator returns a new -// ListCostCategoryResourceAssociationsPaginator -func NewListCostCategoryResourceAssociationsPaginator(client ListCostCategoryResourceAssociationsAPIClient, params *ListCostCategoryResourceAssociationsInput, optFns ...func(*ListCostCategoryResourceAssociationsPaginatorOptions)) *ListCostCategoryResourceAssociationsPaginator { - if params == nil { - params = &ListCostCategoryResourceAssociationsInput{} - } - - options := ListCostCategoryResourceAssociationsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListCostCategoryResourceAssociationsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListCostCategoryResourceAssociationsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListCostCategoryResourceAssociations page. -func (p *ListCostCategoryResourceAssociationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCostCategoryResourceAssociationsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListCostCategoryResourceAssociations(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListCostCategoryResourceAssociationsAPIClient is a client that implements the -// ListCostCategoryResourceAssociations operation. -type ListCostCategoryResourceAssociationsAPIClient interface { - ListCostCategoryResourceAssociations(context.Context, *ListCostCategoryResourceAssociationsInput, ...func(*Options)) (*ListCostCategoryResourceAssociationsOutput, error) -} - -var _ ListCostCategoryResourceAssociationsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListCostCategoryResourceAssociations(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListCostCategoryResourceAssociations", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListSavingsPlansPurchaseRecommendationGeneration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListSavingsPlansPurchaseRecommendationGeneration.go deleted file mode 100644 index 44b2345317..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListSavingsPlansPurchaseRecommendationGeneration.go +++ /dev/null @@ -1,260 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves a list of your historical recommendation generations within the past -// 30 days. -func (c *Client) ListSavingsPlansPurchaseRecommendationGeneration(ctx context.Context, params *ListSavingsPlansPurchaseRecommendationGenerationInput, optFns ...func(*Options)) (*ListSavingsPlansPurchaseRecommendationGenerationOutput, error) { - if params == nil { - params = &ListSavingsPlansPurchaseRecommendationGenerationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListSavingsPlansPurchaseRecommendationGeneration", params, optFns, c.addOperationListSavingsPlansPurchaseRecommendationGenerationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListSavingsPlansPurchaseRecommendationGenerationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListSavingsPlansPurchaseRecommendationGenerationInput struct { - - // The status of the recommendation generation. - GenerationStatus types.GenerationStatus - - // The token to retrieve the next set of results. - NextPageToken *string - - // The number of recommendations that you want returned in a single response - // object. - PageSize int32 - - // The IDs for each specific recommendation. - RecommendationIds []string - - noSmithyDocumentSerde -} - -type ListSavingsPlansPurchaseRecommendationGenerationOutput struct { - - // The list of historical recommendation generations. - GenerationSummaryList []types.GenerationSummary - - // The token to retrieve the next set of results. - NextPageToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListSavingsPlansPurchaseRecommendationGenerationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListSavingsPlansPurchaseRecommendationGeneration{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListSavingsPlansPurchaseRecommendationGeneration{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListSavingsPlansPurchaseRecommendationGeneration"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSavingsPlansPurchaseRecommendationGeneration(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListSavingsPlansPurchaseRecommendationGenerationPaginatorOptions is the -// paginator options for ListSavingsPlansPurchaseRecommendationGeneration -type ListSavingsPlansPurchaseRecommendationGenerationPaginatorOptions struct { - // The number of recommendations that you want returned in a single response - // object. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListSavingsPlansPurchaseRecommendationGenerationPaginator is a paginator for -// ListSavingsPlansPurchaseRecommendationGeneration -type ListSavingsPlansPurchaseRecommendationGenerationPaginator struct { - options ListSavingsPlansPurchaseRecommendationGenerationPaginatorOptions - client ListSavingsPlansPurchaseRecommendationGenerationAPIClient - params *ListSavingsPlansPurchaseRecommendationGenerationInput - nextToken *string - firstPage bool -} - -// NewListSavingsPlansPurchaseRecommendationGenerationPaginator returns a new -// ListSavingsPlansPurchaseRecommendationGenerationPaginator -func NewListSavingsPlansPurchaseRecommendationGenerationPaginator(client ListSavingsPlansPurchaseRecommendationGenerationAPIClient, params *ListSavingsPlansPurchaseRecommendationGenerationInput, optFns ...func(*ListSavingsPlansPurchaseRecommendationGenerationPaginatorOptions)) *ListSavingsPlansPurchaseRecommendationGenerationPaginator { - if params == nil { - params = &ListSavingsPlansPurchaseRecommendationGenerationInput{} - } - - options := ListSavingsPlansPurchaseRecommendationGenerationPaginatorOptions{} - if params.PageSize != 0 { - options.Limit = params.PageSize - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListSavingsPlansPurchaseRecommendationGenerationPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextPageToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListSavingsPlansPurchaseRecommendationGenerationPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListSavingsPlansPurchaseRecommendationGeneration -// page. -func (p *ListSavingsPlansPurchaseRecommendationGenerationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSavingsPlansPurchaseRecommendationGenerationOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextPageToken = p.nextToken - - params.PageSize = p.options.Limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListSavingsPlansPurchaseRecommendationGeneration(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextPageToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListSavingsPlansPurchaseRecommendationGenerationAPIClient is a client that -// implements the ListSavingsPlansPurchaseRecommendationGeneration operation. -type ListSavingsPlansPurchaseRecommendationGenerationAPIClient interface { - ListSavingsPlansPurchaseRecommendationGeneration(context.Context, *ListSavingsPlansPurchaseRecommendationGenerationInput, ...func(*Options)) (*ListSavingsPlansPurchaseRecommendationGenerationOutput, error) -} - -var _ ListSavingsPlansPurchaseRecommendationGenerationAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListSavingsPlansPurchaseRecommendationGeneration(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListSavingsPlansPurchaseRecommendationGeneration", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListTagsForResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListTagsForResource.go deleted file mode 100644 index bba2d1fd6f..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ListTagsForResource.go +++ /dev/null @@ -1,161 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns a list of resource tags associated with the resource specified by the -// Amazon Resource Name (ARN). -func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { - if params == nil { - params = &ListTagsForResourceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListTagsForResourceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListTagsForResourceInput struct { - - // The Amazon Resource Name (ARN) of the resource. For a list of supported - // resources, see [ResourceTag]. - // - // [ResourceTag]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_ResourceTag.html - // - // This member is required. - ResourceArn *string - - noSmithyDocumentSerde -} - -type ListTagsForResourceOutput struct { - - // A list of tag key value pairs that are associated with the resource. - ResourceTags []types.ResourceTag - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForResource{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListTagsForResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListTagsForResource", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ProvideAnomalyFeedback.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ProvideAnomalyFeedback.go deleted file mode 100644 index d217a0fbd8..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_ProvideAnomalyFeedback.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Modifies the feedback property of a given cost anomaly. -func (c *Client) ProvideAnomalyFeedback(ctx context.Context, params *ProvideAnomalyFeedbackInput, optFns ...func(*Options)) (*ProvideAnomalyFeedbackOutput, error) { - if params == nil { - params = &ProvideAnomalyFeedbackInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ProvideAnomalyFeedback", params, optFns, c.addOperationProvideAnomalyFeedbackMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ProvideAnomalyFeedbackOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ProvideAnomalyFeedbackInput struct { - - // A cost anomaly ID. - // - // This member is required. - AnomalyId *string - - // Describes whether the cost anomaly was a planned activity or you considered it - // an anomaly. - // - // This member is required. - Feedback types.AnomalyFeedbackType - - noSmithyDocumentSerde -} - -type ProvideAnomalyFeedbackOutput struct { - - // The ID of the modified cost anomaly. - // - // This member is required. - AnomalyId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationProvideAnomalyFeedbackMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpProvideAnomalyFeedback{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpProvideAnomalyFeedback{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ProvideAnomalyFeedback"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpProvideAnomalyFeedbackValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opProvideAnomalyFeedback(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opProvideAnomalyFeedback(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ProvideAnomalyFeedback", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_StartCommitmentPurchaseAnalysis.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_StartCommitmentPurchaseAnalysis.go deleted file mode 100644 index ff7d17f0a8..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_StartCommitmentPurchaseAnalysis.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Specifies the parameters of a planned commitment purchase and starts the -// generation of the analysis. This enables you to estimate the cost, coverage, and -// utilization impact of your planned commitment purchases. -func (c *Client) StartCommitmentPurchaseAnalysis(ctx context.Context, params *StartCommitmentPurchaseAnalysisInput, optFns ...func(*Options)) (*StartCommitmentPurchaseAnalysisOutput, error) { - if params == nil { - params = &StartCommitmentPurchaseAnalysisInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "StartCommitmentPurchaseAnalysis", params, optFns, c.addOperationStartCommitmentPurchaseAnalysisMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*StartCommitmentPurchaseAnalysisOutput) - out.ResultMetadata = metadata - return out, nil -} - -type StartCommitmentPurchaseAnalysisInput struct { - - // The configuration for the commitment purchase analysis. - // - // This member is required. - CommitmentPurchaseAnalysisConfiguration *types.CommitmentPurchaseAnalysisConfiguration - - noSmithyDocumentSerde -} - -type StartCommitmentPurchaseAnalysisOutput struct { - - // The analysis ID that's associated with the commitment purchase analysis. - // - // This member is required. - AnalysisId *string - - // The start time of the analysis. - // - // This member is required. - AnalysisStartedTime *string - - // The estimated time for when the analysis will complete. - // - // This member is required. - EstimatedCompletionTime *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationStartCommitmentPurchaseAnalysisMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartCommitmentPurchaseAnalysis{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartCommitmentPurchaseAnalysis{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "StartCommitmentPurchaseAnalysis"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpStartCommitmentPurchaseAnalysisValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartCommitmentPurchaseAnalysis(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opStartCommitmentPurchaseAnalysis(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "StartCommitmentPurchaseAnalysis", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_StartCostAllocationTagBackfill.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_StartCostAllocationTagBackfill.go deleted file mode 100644 index c8f41c7a75..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_StartCostAllocationTagBackfill.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Request a cost allocation tag backfill. This will backfill the activation -// -// status (either active or inactive ) for all tag keys from para:BackfillFrom up -// to the time this request is made. -// -// You can request a backfill once every 24 hours. -func (c *Client) StartCostAllocationTagBackfill(ctx context.Context, params *StartCostAllocationTagBackfillInput, optFns ...func(*Options)) (*StartCostAllocationTagBackfillOutput, error) { - if params == nil { - params = &StartCostAllocationTagBackfillInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "StartCostAllocationTagBackfill", params, optFns, c.addOperationStartCostAllocationTagBackfillMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*StartCostAllocationTagBackfillOutput) - out.ResultMetadata = metadata - return out, nil -} - -type StartCostAllocationTagBackfillInput struct { - - // The date you want the backfill to start from. The date can only be a first day - // of the month (a billing start date). Dates can't precede the previous twelve - // months, or in the future. - // - // This member is required. - BackfillFrom *string - - noSmithyDocumentSerde -} - -type StartCostAllocationTagBackfillOutput struct { - - // An object containing detailed metadata of your new backfill request. - BackfillRequest *types.CostAllocationTagBackfillRequest - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationStartCostAllocationTagBackfillMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartCostAllocationTagBackfill{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartCostAllocationTagBackfill{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "StartCostAllocationTagBackfill"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpStartCostAllocationTagBackfillValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartCostAllocationTagBackfill(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opStartCostAllocationTagBackfill(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "StartCostAllocationTagBackfill", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_StartSavingsPlansPurchaseRecommendationGeneration.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_StartSavingsPlansPurchaseRecommendationGeneration.go deleted file mode 100644 index 41cc8eb92c..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_StartSavingsPlansPurchaseRecommendationGeneration.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Requests a Savings Plans recommendation generation. This enables you to -// calculate a fresh set of Savings Plans recommendations that takes your latest -// usage data and current Savings Plans inventory into account. You can refresh -// Savings Plans recommendations up to three times daily for a consolidated billing -// family. -// -// StartSavingsPlansPurchaseRecommendationGeneration has no request syntax because -// no input parameters are needed to support this operation. -func (c *Client) StartSavingsPlansPurchaseRecommendationGeneration(ctx context.Context, params *StartSavingsPlansPurchaseRecommendationGenerationInput, optFns ...func(*Options)) (*StartSavingsPlansPurchaseRecommendationGenerationOutput, error) { - if params == nil { - params = &StartSavingsPlansPurchaseRecommendationGenerationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "StartSavingsPlansPurchaseRecommendationGeneration", params, optFns, c.addOperationStartSavingsPlansPurchaseRecommendationGenerationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*StartSavingsPlansPurchaseRecommendationGenerationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type StartSavingsPlansPurchaseRecommendationGenerationInput struct { - noSmithyDocumentSerde -} - -type StartSavingsPlansPurchaseRecommendationGenerationOutput struct { - - // The estimated time for when the recommendation generation will complete. - EstimatedCompletionTime *string - - // The start time of the recommendation generation. - GenerationStartedTime *string - - // The ID for this specific recommendation. - RecommendationId *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationStartSavingsPlansPurchaseRecommendationGenerationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartSavingsPlansPurchaseRecommendationGeneration{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartSavingsPlansPurchaseRecommendationGeneration{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "StartSavingsPlansPurchaseRecommendationGeneration"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartSavingsPlansPurchaseRecommendationGeneration(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opStartSavingsPlansPurchaseRecommendationGeneration(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "StartSavingsPlansPurchaseRecommendationGeneration", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_TagResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_TagResource.go deleted file mode 100644 index 52871f0e8d..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_TagResource.go +++ /dev/null @@ -1,191 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// An API operation for adding one or more tags (key-value pairs) to a resource. -// -// You can use the TagResource operation with a resource that already has tags. If -// you specify a new tag key for the resource, this tag is appended to the list of -// tags associated with the resource. If you specify a tag key that is already -// associated with the resource, the new tag value you specify replaces the -// previous value for that tag. -// -// Although the maximum number of array members is 200, user-tag maximum is 50. -// The remaining are reserved for Amazon Web Services use. -func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { - if params == nil { - params = &TagResourceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*TagResourceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type TagResourceInput struct { - - // The Amazon Resource Name (ARN) of the resource. For a list of supported - // resources, see [ResourceTag]. - // - // [ResourceTag]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_ResourceTag.html - // - // This member is required. - ResourceArn *string - - // A list of tag key-value pairs to be added to the resource. - // - // Each tag consists of a key and a value, and each key must be unique for the - // resource. The following restrictions apply to resource tags: - // - // - Although the maximum number of array members is 200, you can assign a - // maximum of 50 user-tags to one resource. The remaining are reserved for Amazon - // Web Services use - // - // - The maximum length of a key is 128 characters - // - // - The maximum length of a value is 256 characters - // - // - Keys and values can only contain alphanumeric characters, spaces, and any - // of the following: _.:/=+@- - // - // - Keys and values are case sensitive - // - // - Keys and values are trimmed for any leading or trailing whitespaces - // - // - Don’t use aws: as a prefix for your keys. This prefix is reserved for Amazon - // Web Services use - // - // This member is required. - ResourceTags []types.ResourceTag - - noSmithyDocumentSerde -} - -type TagResourceOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTagResource{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "TagResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpTagResourceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "TagResource", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_UntagResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_UntagResource.go deleted file mode 100644 index 8fbd08a745..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_UntagResource.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Removes one or more tags from a resource. Specify only tag keys in your -// request. Don't specify the value. -func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { - if params == nil { - params = &UntagResourceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UntagResourceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UntagResourceInput struct { - - // The Amazon Resource Name (ARN) of the resource. For a list of supported - // resources, see [ResourceTag]. - // - // [ResourceTag]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_ResourceTag.html - // - // This member is required. - ResourceArn *string - - // A list of tag keys associated with tags that need to be removed from the - // resource. If you specify a tag key that doesn't exist, it's ignored. Although - // the maximum number of array members is 200, user-tag maximum is 50. The - // remaining are reserved for Amazon Web Services use. - // - // This member is required. - ResourceTagKeys []string - - noSmithyDocumentSerde -} - -type UntagResourceOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpUntagResource{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUntagResource{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UntagResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpUntagResourceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UntagResource", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_UpdateAnomalyMonitor.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_UpdateAnomalyMonitor.go deleted file mode 100644 index 5cf1f54872..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_UpdateAnomalyMonitor.go +++ /dev/null @@ -1,162 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Updates an existing cost anomaly monitor. The changes made are applied going -// forward, and doesn't change anomalies detected in the past. -func (c *Client) UpdateAnomalyMonitor(ctx context.Context, params *UpdateAnomalyMonitorInput, optFns ...func(*Options)) (*UpdateAnomalyMonitorOutput, error) { - if params == nil { - params = &UpdateAnomalyMonitorInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateAnomalyMonitor", params, optFns, c.addOperationUpdateAnomalyMonitorMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateAnomalyMonitorOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateAnomalyMonitorInput struct { - - // Cost anomaly monitor Amazon Resource Names (ARNs). - // - // This member is required. - MonitorArn *string - - // The new name for the cost anomaly monitor. - MonitorName *string - - noSmithyDocumentSerde -} - -type UpdateAnomalyMonitorOutput struct { - - // A cost anomaly monitor ARN. - // - // This member is required. - MonitorArn *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateAnomalyMonitorMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateAnomalyMonitor{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateAnomalyMonitor{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateAnomalyMonitor"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpUpdateAnomalyMonitorValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAnomalyMonitor(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUpdateAnomalyMonitor(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateAnomalyMonitor", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_UpdateAnomalySubscription.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_UpdateAnomalySubscription.go deleted file mode 100644 index 91c99adb00..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_UpdateAnomalySubscription.go +++ /dev/null @@ -1,227 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Updates an existing cost anomaly subscription. Specify the fields that you want -// to update. Omitted fields are unchanged. -// -// The JSON below describes the generic construct for each type. See [Request Parameters] for possible -// values as they apply to AnomalySubscription . -// -// [Request Parameters]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_UpdateAnomalySubscription.html#API_UpdateAnomalySubscription_RequestParameters -func (c *Client) UpdateAnomalySubscription(ctx context.Context, params *UpdateAnomalySubscriptionInput, optFns ...func(*Options)) (*UpdateAnomalySubscriptionOutput, error) { - if params == nil { - params = &UpdateAnomalySubscriptionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateAnomalySubscription", params, optFns, c.addOperationUpdateAnomalySubscriptionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateAnomalySubscriptionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateAnomalySubscriptionInput struct { - - // A cost anomaly subscription Amazon Resource Name (ARN). - // - // This member is required. - SubscriptionArn *string - - // The update to the frequency value that subscribers receive notifications. - Frequency types.AnomalySubscriptionFrequency - - // A list of cost anomaly monitor ARNs. - MonitorArnList []string - - // The update to the subscriber list. - Subscribers []types.Subscriber - - // The new name of the subscription. - SubscriptionName *string - - // (deprecated) - // - // The update to the threshold value for receiving notifications. - // - // This field has been deprecated. To update a threshold, use ThresholdExpression. - // Continued use of Threshold will be treated as shorthand syntax for a - // ThresholdExpression. - // - // You can specify either Threshold or ThresholdExpression, but not both. - // - // Deprecated: Threshold has been deprecated in favor of ThresholdExpression - Threshold *float64 - - // The update to the [Expression] object used to specify the anomalies that you want to - // generate alerts for. This supports dimensions and nested expressions. The - // supported dimensions are ANOMALY_TOTAL_IMPACT_ABSOLUTE and - // ANOMALY_TOTAL_IMPACT_PERCENTAGE , corresponding to an anomaly’s TotalImpact and - // TotalImpactPercentage, respectively (see [Impact]for more details). The supported - // nested expression types are AND and OR . The match option GREATER_THAN_OR_EQUAL - // is required. Values must be numbers between 0 and 10,000,000,000 in string - // format. - // - // You can specify either Threshold or ThresholdExpression, but not both. - // - // The following are examples of valid ThresholdExpressions: - // - // - Absolute threshold: { "Dimensions": { "Key": - // "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], - // "Values": [ "100" ] } } - // - // - Percentage threshold: { "Dimensions": { "Key": - // "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], - // "Values": [ "100" ] } } - // - // - AND two thresholds together: { "And": [ { "Dimensions": { "Key": - // "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], - // "Values": [ "100" ] } }, { "Dimensions": { "Key": - // "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], - // "Values": [ "100" ] } } ] } - // - // - OR two thresholds together: { "Or": [ { "Dimensions": { "Key": - // "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], - // "Values": [ "100" ] } }, { "Dimensions": { "Key": - // "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], - // "Values": [ "100" ] } } ] } - // - // [Impact]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Impact.html - // [Expression]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html - ThresholdExpression *types.Expression - - noSmithyDocumentSerde -} - -type UpdateAnomalySubscriptionOutput struct { - - // A cost anomaly subscription ARN. - // - // This member is required. - SubscriptionArn *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateAnomalySubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateAnomalySubscription{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateAnomalySubscription{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateAnomalySubscription"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpUpdateAnomalySubscriptionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAnomalySubscription(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUpdateAnomalySubscription(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateAnomalySubscription", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_UpdateCostAllocationTagsStatus.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_UpdateCostAllocationTagsStatus.go deleted file mode 100644 index 19441951c8..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_UpdateCostAllocationTagsStatus.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Updates status for cost allocation tags in bulk, with maximum batch size of 20. -// If the tag status that's updated is the same as the existing tag status, the -// request doesn't fail. Instead, it doesn't have any effect on the tag status (for -// example, activating the active tag). -func (c *Client) UpdateCostAllocationTagsStatus(ctx context.Context, params *UpdateCostAllocationTagsStatusInput, optFns ...func(*Options)) (*UpdateCostAllocationTagsStatusOutput, error) { - if params == nil { - params = &UpdateCostAllocationTagsStatusInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateCostAllocationTagsStatus", params, optFns, c.addOperationUpdateCostAllocationTagsStatusMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateCostAllocationTagsStatusOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateCostAllocationTagsStatusInput struct { - - // The list of CostAllocationTagStatusEntry objects that are used to update cost - // allocation tags status for this request. - // - // This member is required. - CostAllocationTagsStatus []types.CostAllocationTagStatusEntry - - noSmithyDocumentSerde -} - -type UpdateCostAllocationTagsStatusOutput struct { - - // A list of UpdateCostAllocationTagsStatusError objects with error details about - // each cost allocation tag that can't be updated. If there's no failure, an empty - // array returns. - Errors []types.UpdateCostAllocationTagsStatusError - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateCostAllocationTagsStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateCostAllocationTagsStatus{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateCostAllocationTagsStatus{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateCostAllocationTagsStatus"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpUpdateCostAllocationTagsStatusValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCostAllocationTagsStatus(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUpdateCostAllocationTagsStatus(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateCostAllocationTagsStatus", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_UpdateCostCategoryDefinition.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_UpdateCostCategoryDefinition.go deleted file mode 100644 index 8f639d9248..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/api_op_UpdateCostCategoryDefinition.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Updates an existing cost category. Changes made to the cost category rules will -// be used to categorize the current month’s expenses and future expenses. This -// won’t change categorization for the previous months. -func (c *Client) UpdateCostCategoryDefinition(ctx context.Context, params *UpdateCostCategoryDefinitionInput, optFns ...func(*Options)) (*UpdateCostCategoryDefinitionOutput, error) { - if params == nil { - params = &UpdateCostCategoryDefinitionInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateCostCategoryDefinition", params, optFns, c.addOperationUpdateCostCategoryDefinitionMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateCostCategoryDefinitionOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateCostCategoryDefinitionInput struct { - - // The unique identifier for your cost category. - // - // This member is required. - CostCategoryArn *string - - // The rule schema version in this particular cost category. - // - // This member is required. - RuleVersion types.CostCategoryRuleVersion - - // The Expression object used to categorize costs. For more information, see [CostCategoryRule]. - // - // [CostCategoryRule]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_CostCategoryRule.html - // - // This member is required. - Rules []types.CostCategoryRule - - // The default value for the cost category. - DefaultValue *string - - // The cost category's effective start date. It can only be a billing start date - // (first day of the month). If the date isn't provided, it's the first day of the - // current month. Dates can't be before the previous twelve months, or in the - // future. - EffectiveStart *string - - // The split charge rules used to allocate your charges between your cost - // category values. - SplitChargeRules []types.CostCategorySplitChargeRule - - noSmithyDocumentSerde -} - -type UpdateCostCategoryDefinitionOutput struct { - - // The unique identifier for your cost category. - CostCategoryArn *string - - // The cost category's effective start date. It can only be a billing start date - // (first day of the month). - EffectiveStart *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateCostCategoryDefinitionMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateCostCategoryDefinition{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateCostCategoryDefinition{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateCostCategoryDefinition"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addTimeOffsetBuild(stack, c); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpUpdateCostCategoryDefinitionValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCostCategoryDefinition(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUpdateCostCategoryDefinition(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateCostCategoryDefinition", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/auth.go deleted file mode 100644 index 003d92a0ad..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/auth.go +++ /dev/null @@ -1,345 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "slices" - "strings" -) - -func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) error { - params.Region = options.Region - return nil -} - -type setLegacyContextSigningOptionsMiddleware struct { -} - -func (*setLegacyContextSigningOptionsMiddleware) ID() string { - return "setLegacyContextSigningOptions" -} - -func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - rscheme := getResolvedAuthScheme(ctx) - schemeID := rscheme.Scheme.SchemeID() - - if sn := awsmiddleware.GetSigningName(ctx); sn != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) - } - } - - if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) - } - } - - return next.HandleFinalize(ctx, in) -} - -func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { - return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) -} - -type withAnonymous struct { - resolver AuthSchemeResolver -} - -var _ AuthSchemeResolver = (*withAnonymous)(nil) - -func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - opts, err := v.resolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return nil, err - } - - opts = append(opts, &smithyauth.Option{ - SchemeID: smithyauth.SchemeIDAnonymous, - }) - return opts, nil -} - -func wrapWithAnonymousAuth(options *Options) { - if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { - return - } - - options.AuthSchemeResolver = &withAnonymous{ - resolver: options.AuthSchemeResolver, - } -} - -// AuthResolverParameters contains the set of inputs necessary for auth scheme -// resolution. -type AuthResolverParameters struct { - // The name of the operation being invoked. - Operation string - - // The region in which the operation is being invoked. - Region string -} - -func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) (*AuthResolverParameters, error) { - params := &AuthResolverParameters{ - Operation: operation, - } - - if err := bindAuthParamsRegion(ctx, params, input, options); err != nil { - return nil, err - } - - return params, nil -} - -// AuthSchemeResolver returns a set of possible authentication options for an -// operation. -type AuthSchemeResolver interface { - ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) -} - -type defaultAuthSchemeResolver struct{} - -var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) - -func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - if overrides, ok := operationAuthOptions[params.Operation]; ok { - return overrides(params), nil - } - return serviceAuthOptions(params), nil -} - -var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} - -func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - { - SchemeID: smithyauth.SchemeIDSigV4, - SignerProperties: func() smithy.Properties { - var props smithy.Properties - smithyhttp.SetSigV4SigningName(&props, "ce") - smithyhttp.SetSigV4SigningRegion(&props, params.Region) - return props - }(), - }, - } -} - -type resolveAuthSchemeMiddleware struct { - operation string - options Options -} - -func (*resolveAuthSchemeMiddleware) ID() string { - return "ResolveAuthScheme" -} - -func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") - defer span.End() - - params, err := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) - if err != nil { - return out, metadata, fmt.Errorf("bind auth scheme params: %w", err) - } - options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) - } - - scheme, ok := m.selectScheme(options) - if !ok { - return out, metadata, fmt.Errorf("could not select an auth scheme") - } - - ctx = setResolvedAuthScheme(ctx, scheme) - - span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) - span.End() - return next.HandleFinalize(ctx, in) -} - -func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { - sorted := sortAuthOptions(options, m.options.AuthSchemePreference) - for _, option := range sorted { - if option.SchemeID == smithyauth.SchemeIDAnonymous { - return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true - } - - for _, scheme := range m.options.AuthSchemes { - if scheme.SchemeID() != option.SchemeID { - continue - } - - if scheme.IdentityResolver(m.options) != nil { - return newResolvedAuthScheme(scheme, option), true - } - } - } - - return nil, false -} - -func sortAuthOptions(options []*smithyauth.Option, preferred []string) []*smithyauth.Option { - byPriority := make([]*smithyauth.Option, 0, len(options)) - for _, prefName := range preferred { - for _, option := range options { - optName := option.SchemeID - if parts := strings.Split(option.SchemeID, "#"); len(parts) == 2 { - optName = parts[1] - } - if prefName == optName { - byPriority = append(byPriority, option) - } - } - } - for _, option := range options { - if !slices.ContainsFunc(byPriority, func(o *smithyauth.Option) bool { - return o.SchemeID == option.SchemeID - }) { - byPriority = append(byPriority, option) - } - } - return byPriority -} - -type resolvedAuthSchemeKey struct{} - -type resolvedAuthScheme struct { - Scheme smithyhttp.AuthScheme - IdentityProperties smithy.Properties - SignerProperties smithy.Properties -} - -func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { - return &resolvedAuthScheme{ - Scheme: scheme, - IdentityProperties: option.IdentityProperties, - SignerProperties: option.SignerProperties, - } -} - -func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { - return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) -} - -func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { - v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) - return v -} - -type getIdentityMiddleware struct { - options Options -} - -func (*getIdentityMiddleware) ID() string { - return "GetIdentity" -} - -func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") - defer span.End() - - rscheme := getResolvedAuthScheme(innerCtx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - resolver := rscheme.Scheme.IdentityResolver(m.options) - if resolver == nil { - return out, metadata, fmt.Errorf("no identity resolver") - } - - identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", - func() (smithyauth.Identity, error) { - return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) - }, - func(o *metrics.RecordMetricOptions) { - o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) - }) - if err != nil { - return out, metadata, fmt.Errorf("get identity: %w", err) - } - - ctx = setIdentity(ctx, identity) - - span.End() - return next.HandleFinalize(ctx, in) -} - -type identityKey struct{} - -func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { - return middleware.WithStackValue(ctx, identityKey{}, identity) -} - -func getIdentity(ctx context.Context) smithyauth.Identity { - v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) - return v -} - -type signRequestMiddleware struct { - options Options -} - -func (*signRequestMiddleware) ID() string { - return "Signing" -} - -func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "SignRequest") - defer span.End() - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - identity := getIdentity(ctx) - if identity == nil { - return out, metadata, fmt.Errorf("no identity") - } - - signer := rscheme.Scheme.Signer() - if signer == nil { - return out, metadata, fmt.Errorf("no signer") - } - - _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { - return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) - }, func(o *metrics.RecordMetricOptions) { - o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) - }) - if err != nil { - return out, metadata, fmt.Errorf("sign request: %w", err) - } - - span.End() - return next.HandleFinalize(ctx, in) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/deserializers.go deleted file mode 100644 index b43f4c79e7..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/deserializers.go +++ /dev/null @@ -1,18088 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - smithy "github.com/aws/smithy-go" - smithyio "github.com/aws/smithy-go/io" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/ptr" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "io" - "math" - "strings" -) - -type awsAwsjson11_deserializeOpCreateAnomalyMonitor struct { -} - -func (*awsAwsjson11_deserializeOpCreateAnomalyMonitor) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpCreateAnomalyMonitor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorCreateAnomalyMonitor(response, &metadata) - } - output := &CreateAnomalyMonitorOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentCreateAnomalyMonitorOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorCreateAnomalyMonitor(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpCreateAnomalySubscription struct { -} - -func (*awsAwsjson11_deserializeOpCreateAnomalySubscription) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpCreateAnomalySubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorCreateAnomalySubscription(response, &metadata) - } - output := &CreateAnomalySubscriptionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentCreateAnomalySubscriptionOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorCreateAnomalySubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("UnknownMonitorException", errorCode): - return awsAwsjson11_deserializeErrorUnknownMonitorException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpCreateCostCategoryDefinition struct { -} - -func (*awsAwsjson11_deserializeOpCreateCostCategoryDefinition) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpCreateCostCategoryDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorCreateCostCategoryDefinition(response, &metadata) - } - output := &CreateCostCategoryDefinitionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentCreateCostCategoryDefinitionOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorCreateCostCategoryDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDeleteAnomalyMonitor struct { -} - -func (*awsAwsjson11_deserializeOpDeleteAnomalyMonitor) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDeleteAnomalyMonitor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteAnomalyMonitor(response, &metadata) - } - output := &DeleteAnomalyMonitorOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentDeleteAnomalyMonitorOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDeleteAnomalyMonitor(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("UnknownMonitorException", errorCode): - return awsAwsjson11_deserializeErrorUnknownMonitorException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDeleteAnomalySubscription struct { -} - -func (*awsAwsjson11_deserializeOpDeleteAnomalySubscription) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDeleteAnomalySubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteAnomalySubscription(response, &metadata) - } - output := &DeleteAnomalySubscriptionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentDeleteAnomalySubscriptionOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDeleteAnomalySubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("UnknownSubscriptionException", errorCode): - return awsAwsjson11_deserializeErrorUnknownSubscriptionException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDeleteCostCategoryDefinition struct { -} - -func (*awsAwsjson11_deserializeOpDeleteCostCategoryDefinition) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDeleteCostCategoryDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteCostCategoryDefinition(response, &metadata) - } - output := &DeleteCostCategoryDefinitionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentDeleteCostCategoryDefinitionOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDeleteCostCategoryDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDescribeCostCategoryDefinition struct { -} - -func (*awsAwsjson11_deserializeOpDescribeCostCategoryDefinition) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDescribeCostCategoryDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeCostCategoryDefinition(response, &metadata) - } - output := &DescribeCostCategoryDefinitionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentDescribeCostCategoryDefinitionOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDescribeCostCategoryDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetAnomalies struct { -} - -func (*awsAwsjson11_deserializeOpGetAnomalies) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetAnomalies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetAnomalies(response, &metadata) - } - output := &GetAnomaliesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetAnomaliesOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetAnomalies(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetAnomalyMonitors struct { -} - -func (*awsAwsjson11_deserializeOpGetAnomalyMonitors) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetAnomalyMonitors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetAnomalyMonitors(response, &metadata) - } - output := &GetAnomalyMonitorsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetAnomalyMonitorsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetAnomalyMonitors(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("UnknownMonitorException", errorCode): - return awsAwsjson11_deserializeErrorUnknownMonitorException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetAnomalySubscriptions struct { -} - -func (*awsAwsjson11_deserializeOpGetAnomalySubscriptions) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetAnomalySubscriptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetAnomalySubscriptions(response, &metadata) - } - output := &GetAnomalySubscriptionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetAnomalySubscriptionsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetAnomalySubscriptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("UnknownSubscriptionException", errorCode): - return awsAwsjson11_deserializeErrorUnknownSubscriptionException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetApproximateUsageRecords struct { -} - -func (*awsAwsjson11_deserializeOpGetApproximateUsageRecords) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetApproximateUsageRecords) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetApproximateUsageRecords(response, &metadata) - } - output := &GetApproximateUsageRecordsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetApproximateUsageRecordsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetApproximateUsageRecords(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetCommitmentPurchaseAnalysis struct { -} - -func (*awsAwsjson11_deserializeOpGetCommitmentPurchaseAnalysis) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetCommitmentPurchaseAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetCommitmentPurchaseAnalysis(response, &metadata) - } - output := &GetCommitmentPurchaseAnalysisOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetCommitmentPurchaseAnalysisOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetCommitmentPurchaseAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AnalysisNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorAnalysisNotFoundException(response, errorBody) - - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetCostAndUsage struct { -} - -func (*awsAwsjson11_deserializeOpGetCostAndUsage) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetCostAndUsage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetCostAndUsage(response, &metadata) - } - output := &GetCostAndUsageOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetCostAndUsageOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetCostAndUsage(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("BillExpirationException", errorCode): - return awsAwsjson11_deserializeErrorBillExpirationException(response, errorBody) - - case strings.EqualFold("BillingViewHealthStatusException", errorCode): - return awsAwsjson11_deserializeErrorBillingViewHealthStatusException(response, errorBody) - - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("RequestChangedException", errorCode): - return awsAwsjson11_deserializeErrorRequestChangedException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetCostAndUsageComparisons struct { -} - -func (*awsAwsjson11_deserializeOpGetCostAndUsageComparisons) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetCostAndUsageComparisons) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetCostAndUsageComparisons(response, &metadata) - } - output := &GetCostAndUsageComparisonsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetCostAndUsageComparisonsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetCostAndUsageComparisons(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("BillingViewHealthStatusException", errorCode): - return awsAwsjson11_deserializeErrorBillingViewHealthStatusException(response, errorBody) - - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetCostAndUsageWithResources struct { -} - -func (*awsAwsjson11_deserializeOpGetCostAndUsageWithResources) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetCostAndUsageWithResources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetCostAndUsageWithResources(response, &metadata) - } - output := &GetCostAndUsageWithResourcesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetCostAndUsageWithResourcesOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetCostAndUsageWithResources(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("BillExpirationException", errorCode): - return awsAwsjson11_deserializeErrorBillExpirationException(response, errorBody) - - case strings.EqualFold("BillingViewHealthStatusException", errorCode): - return awsAwsjson11_deserializeErrorBillingViewHealthStatusException(response, errorBody) - - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("RequestChangedException", errorCode): - return awsAwsjson11_deserializeErrorRequestChangedException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetCostCategories struct { -} - -func (*awsAwsjson11_deserializeOpGetCostCategories) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetCostCategories) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetCostCategories(response, &metadata) - } - output := &GetCostCategoriesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetCostCategoriesOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetCostCategories(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("BillExpirationException", errorCode): - return awsAwsjson11_deserializeErrorBillExpirationException(response, errorBody) - - case strings.EqualFold("BillingViewHealthStatusException", errorCode): - return awsAwsjson11_deserializeErrorBillingViewHealthStatusException(response, errorBody) - - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("RequestChangedException", errorCode): - return awsAwsjson11_deserializeErrorRequestChangedException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetCostComparisonDrivers struct { -} - -func (*awsAwsjson11_deserializeOpGetCostComparisonDrivers) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetCostComparisonDrivers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetCostComparisonDrivers(response, &metadata) - } - output := &GetCostComparisonDriversOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetCostComparisonDriversOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetCostComparisonDrivers(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("BillingViewHealthStatusException", errorCode): - return awsAwsjson11_deserializeErrorBillingViewHealthStatusException(response, errorBody) - - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetCostForecast struct { -} - -func (*awsAwsjson11_deserializeOpGetCostForecast) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetCostForecast) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetCostForecast(response, &metadata) - } - output := &GetCostForecastOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetCostForecastOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetCostForecast(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("BillingViewHealthStatusException", errorCode): - return awsAwsjson11_deserializeErrorBillingViewHealthStatusException(response, errorBody) - - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetDimensionValues struct { -} - -func (*awsAwsjson11_deserializeOpGetDimensionValues) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetDimensionValues) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetDimensionValues(response, &metadata) - } - output := &GetDimensionValuesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetDimensionValuesOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetDimensionValues(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("BillExpirationException", errorCode): - return awsAwsjson11_deserializeErrorBillExpirationException(response, errorBody) - - case strings.EqualFold("BillingViewHealthStatusException", errorCode): - return awsAwsjson11_deserializeErrorBillingViewHealthStatusException(response, errorBody) - - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("RequestChangedException", errorCode): - return awsAwsjson11_deserializeErrorRequestChangedException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetReservationCoverage struct { -} - -func (*awsAwsjson11_deserializeOpGetReservationCoverage) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetReservationCoverage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetReservationCoverage(response, &metadata) - } - output := &GetReservationCoverageOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetReservationCoverageOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetReservationCoverage(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetReservationPurchaseRecommendation struct { -} - -func (*awsAwsjson11_deserializeOpGetReservationPurchaseRecommendation) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetReservationPurchaseRecommendation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetReservationPurchaseRecommendation(response, &metadata) - } - output := &GetReservationPurchaseRecommendationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetReservationPurchaseRecommendationOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetReservationPurchaseRecommendation(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetReservationUtilization struct { -} - -func (*awsAwsjson11_deserializeOpGetReservationUtilization) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetReservationUtilization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetReservationUtilization(response, &metadata) - } - output := &GetReservationUtilizationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetReservationUtilizationOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetReservationUtilization(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetRightsizingRecommendation struct { -} - -func (*awsAwsjson11_deserializeOpGetRightsizingRecommendation) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetRightsizingRecommendation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetRightsizingRecommendation(response, &metadata) - } - output := &GetRightsizingRecommendationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetRightsizingRecommendationOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetRightsizingRecommendation(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetSavingsPlanPurchaseRecommendationDetails struct { -} - -func (*awsAwsjson11_deserializeOpGetSavingsPlanPurchaseRecommendationDetails) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetSavingsPlanPurchaseRecommendationDetails) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetSavingsPlanPurchaseRecommendationDetails(response, &metadata) - } - output := &GetSavingsPlanPurchaseRecommendationDetailsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetSavingsPlanPurchaseRecommendationDetailsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetSavingsPlanPurchaseRecommendationDetails(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetSavingsPlansCoverage struct { -} - -func (*awsAwsjson11_deserializeOpGetSavingsPlansCoverage) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetSavingsPlansCoverage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetSavingsPlansCoverage(response, &metadata) - } - output := &GetSavingsPlansCoverageOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetSavingsPlansCoverageOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetSavingsPlansCoverage(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetSavingsPlansPurchaseRecommendation struct { -} - -func (*awsAwsjson11_deserializeOpGetSavingsPlansPurchaseRecommendation) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetSavingsPlansPurchaseRecommendation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetSavingsPlansPurchaseRecommendation(response, &metadata) - } - output := &GetSavingsPlansPurchaseRecommendationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetSavingsPlansPurchaseRecommendationOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetSavingsPlansPurchaseRecommendation(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetSavingsPlansUtilization struct { -} - -func (*awsAwsjson11_deserializeOpGetSavingsPlansUtilization) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetSavingsPlansUtilization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetSavingsPlansUtilization(response, &metadata) - } - output := &GetSavingsPlansUtilizationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetSavingsPlansUtilizationOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetSavingsPlansUtilization(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetSavingsPlansUtilizationDetails struct { -} - -func (*awsAwsjson11_deserializeOpGetSavingsPlansUtilizationDetails) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetSavingsPlansUtilizationDetails) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetSavingsPlansUtilizationDetails(response, &metadata) - } - output := &GetSavingsPlansUtilizationDetailsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetSavingsPlansUtilizationDetailsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetSavingsPlansUtilizationDetails(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetTags struct { -} - -func (*awsAwsjson11_deserializeOpGetTags) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetTags(response, &metadata) - } - output := &GetTagsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetTagsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("BillExpirationException", errorCode): - return awsAwsjson11_deserializeErrorBillExpirationException(response, errorBody) - - case strings.EqualFold("BillingViewHealthStatusException", errorCode): - return awsAwsjson11_deserializeErrorBillingViewHealthStatusException(response, errorBody) - - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("RequestChangedException", errorCode): - return awsAwsjson11_deserializeErrorRequestChangedException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpGetUsageForecast struct { -} - -func (*awsAwsjson11_deserializeOpGetUsageForecast) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpGetUsageForecast) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetUsageForecast(response, &metadata) - } - output := &GetUsageForecastOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentGetUsageForecastOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorGetUsageForecast(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("BillingViewHealthStatusException", errorCode): - return awsAwsjson11_deserializeErrorBillingViewHealthStatusException(response, errorBody) - - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("UnresolvableUsageUnitException", errorCode): - return awsAwsjson11_deserializeErrorUnresolvableUsageUnitException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListCommitmentPurchaseAnalyses struct { -} - -func (*awsAwsjson11_deserializeOpListCommitmentPurchaseAnalyses) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListCommitmentPurchaseAnalyses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListCommitmentPurchaseAnalyses(response, &metadata) - } - output := &ListCommitmentPurchaseAnalysesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListCommitmentPurchaseAnalysesOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListCommitmentPurchaseAnalyses(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListCostAllocationTagBackfillHistory struct { -} - -func (*awsAwsjson11_deserializeOpListCostAllocationTagBackfillHistory) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListCostAllocationTagBackfillHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListCostAllocationTagBackfillHistory(response, &metadata) - } - output := &ListCostAllocationTagBackfillHistoryOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListCostAllocationTagBackfillHistoryOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListCostAllocationTagBackfillHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListCostAllocationTags struct { -} - -func (*awsAwsjson11_deserializeOpListCostAllocationTags) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListCostAllocationTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListCostAllocationTags(response, &metadata) - } - output := &ListCostAllocationTagsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListCostAllocationTagsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListCostAllocationTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListCostCategoryDefinitions struct { -} - -func (*awsAwsjson11_deserializeOpListCostCategoryDefinitions) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListCostCategoryDefinitions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListCostCategoryDefinitions(response, &metadata) - } - output := &ListCostCategoryDefinitionsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListCostCategoryDefinitionsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListCostCategoryDefinitions(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListCostCategoryResourceAssociations struct { -} - -func (*awsAwsjson11_deserializeOpListCostCategoryResourceAssociations) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListCostCategoryResourceAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListCostCategoryResourceAssociations(response, &metadata) - } - output := &ListCostCategoryResourceAssociationsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListCostCategoryResourceAssociationsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListCostCategoryResourceAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListSavingsPlansPurchaseRecommendationGeneration struct { -} - -func (*awsAwsjson11_deserializeOpListSavingsPlansPurchaseRecommendationGeneration) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListSavingsPlansPurchaseRecommendationGeneration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListSavingsPlansPurchaseRecommendationGeneration(response, &metadata) - } - output := &ListSavingsPlansPurchaseRecommendationGenerationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListSavingsPlansPurchaseRecommendationGenerationOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListSavingsPlansPurchaseRecommendationGeneration(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListTagsForResource struct { -} - -func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) - } - output := &ListTagsForResourceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpProvideAnomalyFeedback struct { -} - -func (*awsAwsjson11_deserializeOpProvideAnomalyFeedback) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpProvideAnomalyFeedback) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorProvideAnomalyFeedback(response, &metadata) - } - output := &ProvideAnomalyFeedbackOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentProvideAnomalyFeedbackOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorProvideAnomalyFeedback(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpStartCommitmentPurchaseAnalysis struct { -} - -func (*awsAwsjson11_deserializeOpStartCommitmentPurchaseAnalysis) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpStartCommitmentPurchaseAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStartCommitmentPurchaseAnalysis(response, &metadata) - } - output := &StartCommitmentPurchaseAnalysisOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentStartCommitmentPurchaseAnalysisOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorStartCommitmentPurchaseAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("GenerationExistsException", errorCode): - return awsAwsjson11_deserializeErrorGenerationExistsException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpStartCostAllocationTagBackfill struct { -} - -func (*awsAwsjson11_deserializeOpStartCostAllocationTagBackfill) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpStartCostAllocationTagBackfill) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStartCostAllocationTagBackfill(response, &metadata) - } - output := &StartCostAllocationTagBackfillOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentStartCostAllocationTagBackfillOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorStartCostAllocationTagBackfill(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("BackfillLimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorBackfillLimitExceededException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpStartSavingsPlansPurchaseRecommendationGeneration struct { -} - -func (*awsAwsjson11_deserializeOpStartSavingsPlansPurchaseRecommendationGeneration) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpStartSavingsPlansPurchaseRecommendationGeneration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStartSavingsPlansPurchaseRecommendationGeneration(response, &metadata) - } - output := &StartSavingsPlansPurchaseRecommendationGenerationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentStartSavingsPlansPurchaseRecommendationGenerationOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorStartSavingsPlansPurchaseRecommendationGeneration(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("GenerationExistsException", errorCode): - return awsAwsjson11_deserializeErrorGenerationExistsException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpTagResource struct { -} - -func (*awsAwsjson11_deserializeOpTagResource) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) - } - output := &TagResourceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyTagsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpUntagResource struct { -} - -func (*awsAwsjson11_deserializeOpUntagResource) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) - } - output := &UntagResourceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpUpdateAnomalyMonitor struct { -} - -func (*awsAwsjson11_deserializeOpUpdateAnomalyMonitor) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpUpdateAnomalyMonitor) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateAnomalyMonitor(response, &metadata) - } - output := &UpdateAnomalyMonitorOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentUpdateAnomalyMonitorOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorUpdateAnomalyMonitor(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("UnknownMonitorException", errorCode): - return awsAwsjson11_deserializeErrorUnknownMonitorException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpUpdateAnomalySubscription struct { -} - -func (*awsAwsjson11_deserializeOpUpdateAnomalySubscription) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpUpdateAnomalySubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateAnomalySubscription(response, &metadata) - } - output := &UpdateAnomalySubscriptionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentUpdateAnomalySubscriptionOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorUpdateAnomalySubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("UnknownMonitorException", errorCode): - return awsAwsjson11_deserializeErrorUnknownMonitorException(response, errorBody) - - case strings.EqualFold("UnknownSubscriptionException", errorCode): - return awsAwsjson11_deserializeErrorUnknownSubscriptionException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpUpdateCostAllocationTagsStatus struct { -} - -func (*awsAwsjson11_deserializeOpUpdateCostAllocationTagsStatus) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpUpdateCostAllocationTagsStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateCostAllocationTagsStatus(response, &metadata) - } - output := &UpdateCostAllocationTagsStatusOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentUpdateCostAllocationTagsStatusOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorUpdateCostAllocationTagsStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpUpdateCostCategoryDefinition struct { -} - -func (*awsAwsjson11_deserializeOpUpdateCostCategoryDefinition) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpUpdateCostCategoryDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateCostCategoryDefinition(response, &metadata) - } - output := &UpdateCostCategoryDefinitionOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentUpdateCostCategoryDefinitionOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorUpdateCostCategoryDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceQuotaExceededException", errorCode): - return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsAwsjson11_deserializeErrorAnalysisNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.AnalysisNotFoundException{} - err := awsAwsjson11_deserializeDocumentAnalysisNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorBackfillLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.BackfillLimitExceededException{} - err := awsAwsjson11_deserializeDocumentBackfillLimitExceededException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorBillExpirationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.BillExpirationException{} - err := awsAwsjson11_deserializeDocumentBillExpirationException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorBillingViewHealthStatusException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.BillingViewHealthStatusException{} - err := awsAwsjson11_deserializeDocumentBillingViewHealthStatusException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorDataUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.DataUnavailableException{} - err := awsAwsjson11_deserializeDocumentDataUnavailableException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorGenerationExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.GenerationExistsException{} - err := awsAwsjson11_deserializeDocumentGenerationExistsException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorInvalidNextTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.InvalidNextTokenException{} - err := awsAwsjson11_deserializeDocumentInvalidNextTokenException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.LimitExceededException{} - err := awsAwsjson11_deserializeDocumentLimitExceededException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorRequestChangedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.RequestChangedException{} - err := awsAwsjson11_deserializeDocumentRequestChangedException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.ResourceNotFoundException{} - err := awsAwsjson11_deserializeDocumentResourceNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.ServiceQuotaExceededException{} - err := awsAwsjson11_deserializeDocumentServiceQuotaExceededException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.TooManyTagsException{} - err := awsAwsjson11_deserializeDocumentTooManyTagsException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorUnknownMonitorException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.UnknownMonitorException{} - err := awsAwsjson11_deserializeDocumentUnknownMonitorException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorUnknownSubscriptionException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.UnknownSubscriptionException{} - err := awsAwsjson11_deserializeDocumentUnknownSubscriptionException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorUnresolvableUsageUnitException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.UnresolvableUsageUnitException{} - err := awsAwsjson11_deserializeDocumentUnresolvableUsageUnitException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeDocumentAnalysisDetails(v **types.AnalysisDetails, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AnalysisDetails - if *v == nil { - sv = &types.AnalysisDetails{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "SavingsPlansPurchaseAnalysisDetails": - if err := awsAwsjson11_deserializeDocumentSavingsPlansPurchaseAnalysisDetails(&sv.SavingsPlansPurchaseAnalysisDetails, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentAnalysisNotFoundException(v **types.AnalysisNotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AnalysisNotFoundException - if *v == nil { - sv = &types.AnalysisNotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentAnalysisSummary(v **types.AnalysisSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AnalysisSummary - if *v == nil { - sv = &types.AnalysisSummary{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AnalysisCompletionTime": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.AnalysisCompletionTime = ptr.String(jtv) - } - - case "AnalysisId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AnalysisId to be of type string, got %T instead", value) - } - sv.AnalysisId = ptr.String(jtv) - } - - case "AnalysisStartedTime": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.AnalysisStartedTime = ptr.String(jtv) - } - - case "AnalysisStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AnalysisStatus to be of type string, got %T instead", value) - } - sv.AnalysisStatus = types.AnalysisStatus(jtv) - } - - case "CommitmentPurchaseAnalysisConfiguration": - if err := awsAwsjson11_deserializeDocumentCommitmentPurchaseAnalysisConfiguration(&sv.CommitmentPurchaseAnalysisConfiguration, value); err != nil { - return err - } - - case "ErrorCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) - } - sv.ErrorCode = types.ErrorCode(jtv) - } - - case "EstimatedCompletionTime": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.EstimatedCompletionTime = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentAnalysisSummaryList(v *[]types.AnalysisSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.AnalysisSummary - if *v == nil { - cv = []types.AnalysisSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.AnalysisSummary - destAddr := &col - if err := awsAwsjson11_deserializeDocumentAnalysisSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentAnomalies(v *[]types.Anomaly, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.Anomaly - if *v == nil { - cv = []types.Anomaly{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.Anomaly - destAddr := &col - if err := awsAwsjson11_deserializeDocumentAnomaly(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentAnomaly(v **types.Anomaly, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Anomaly - if *v == nil { - sv = &types.Anomaly{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AnomalyEndDate": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected YearMonthDay to be of type string, got %T instead", value) - } - sv.AnomalyEndDate = ptr.String(jtv) - } - - case "AnomalyId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.AnomalyId = ptr.String(jtv) - } - - case "AnomalyScore": - if err := awsAwsjson11_deserializeDocumentAnomalyScore(&sv.AnomalyScore, value); err != nil { - return err - } - - case "AnomalyStartDate": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected YearMonthDay to be of type string, got %T instead", value) - } - sv.AnomalyStartDate = ptr.String(jtv) - } - - case "DimensionValue": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.DimensionValue = ptr.String(jtv) - } - - case "Feedback": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AnomalyFeedbackType to be of type string, got %T instead", value) - } - sv.Feedback = types.AnomalyFeedbackType(jtv) - } - - case "Impact": - if err := awsAwsjson11_deserializeDocumentImpact(&sv.Impact, value); err != nil { - return err - } - - case "MonitorArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.MonitorArn = ptr.String(jtv) - } - - case "RootCauses": - if err := awsAwsjson11_deserializeDocumentRootCauses(&sv.RootCauses, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentAnomalyMonitor(v **types.AnomalyMonitor, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AnomalyMonitor - if *v == nil { - sv = &types.AnomalyMonitor{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CreationDate": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected YearMonthDay to be of type string, got %T instead", value) - } - sv.CreationDate = ptr.String(jtv) - } - - case "DimensionalValueCount": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected NonNegativeInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.DimensionalValueCount = int32(i64) - } - - case "LastEvaluatedDate": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected YearMonthDay to be of type string, got %T instead", value) - } - sv.LastEvaluatedDate = ptr.String(jtv) - } - - case "LastUpdatedDate": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected YearMonthDay to be of type string, got %T instead", value) - } - sv.LastUpdatedDate = ptr.String(jtv) - } - - case "MonitorArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.MonitorArn = ptr.String(jtv) - } - - case "MonitorDimension": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected MonitorDimension to be of type string, got %T instead", value) - } - sv.MonitorDimension = types.MonitorDimension(jtv) - } - - case "MonitorName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.MonitorName = ptr.String(jtv) - } - - case "MonitorSpecification": - if err := awsAwsjson11_deserializeDocumentExpression(&sv.MonitorSpecification, value); err != nil { - return err - } - - case "MonitorType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected MonitorType to be of type string, got %T instead", value) - } - sv.MonitorType = types.MonitorType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentAnomalyMonitors(v *[]types.AnomalyMonitor, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.AnomalyMonitor - if *v == nil { - cv = []types.AnomalyMonitor{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.AnomalyMonitor - destAddr := &col - if err := awsAwsjson11_deserializeDocumentAnomalyMonitor(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentAnomalyScore(v **types.AnomalyScore, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AnomalyScore - if *v == nil { - sv = &types.AnomalyScore{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CurrentScore": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CurrentScore = f64 - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.CurrentScore = f64 - - default: - return fmt.Errorf("expected GenericDouble to be a JSON Number, got %T instead", value) - - } - } - - case "MaxScore": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.MaxScore = f64 - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.MaxScore = f64 - - default: - return fmt.Errorf("expected GenericDouble to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentAnomalySubscription(v **types.AnomalySubscription, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AnomalySubscription - if *v == nil { - sv = &types.AnomalySubscription{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AccountId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.AccountId = ptr.String(jtv) - } - - case "Frequency": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AnomalySubscriptionFrequency to be of type string, got %T instead", value) - } - sv.Frequency = types.AnomalySubscriptionFrequency(jtv) - } - - case "MonitorArnList": - if err := awsAwsjson11_deserializeDocumentMonitorArnList(&sv.MonitorArnList, value); err != nil { - return err - } - - case "Subscribers": - if err := awsAwsjson11_deserializeDocumentSubscribers(&sv.Subscribers, value); err != nil { - return err - } - - case "SubscriptionArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.SubscriptionArn = ptr.String(jtv) - } - - case "SubscriptionName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.SubscriptionName = ptr.String(jtv) - } - - case "Threshold": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Threshold = ptr.Float64(f64) - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.Threshold = ptr.Float64(f64) - - default: - return fmt.Errorf("expected NullableNonNegativeDouble to be a JSON Number, got %T instead", value) - - } - } - - case "ThresholdExpression": - if err := awsAwsjson11_deserializeDocumentExpression(&sv.ThresholdExpression, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentAnomalySubscriptions(v *[]types.AnomalySubscription, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.AnomalySubscription - if *v == nil { - cv = []types.AnomalySubscription{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.AnomalySubscription - destAddr := &col - if err := awsAwsjson11_deserializeDocumentAnomalySubscription(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentApproximateUsageRecordsPerService(v *map[string]int64, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var mv map[string]int64 - if *v == nil { - mv = map[string]int64{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal int64 - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected NonNegativeLong to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - parsedVal = i64 - } - mv[key] = parsedVal - - } - *v = mv - return nil -} - -func awsAwsjson11_deserializeDocumentAttributes(v *map[string]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var mv map[string]string - if *v == nil { - mv = map[string]string{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AttributeValue to be of type string, got %T instead", value) - } - parsedVal = jtv - } - mv[key] = parsedVal - - } - *v = mv - return nil -} - -func awsAwsjson11_deserializeDocumentBackfillLimitExceededException(v **types.BackfillLimitExceededException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.BackfillLimitExceededException - if *v == nil { - sv = &types.BackfillLimitExceededException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentBillExpirationException(v **types.BillExpirationException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.BillExpirationException - if *v == nil { - sv = &types.BillExpirationException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentBillingViewHealthStatusException(v **types.BillingViewHealthStatusException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.BillingViewHealthStatusException - if *v == nil { - sv = &types.BillingViewHealthStatusException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCommitmentPurchaseAnalysisConfiguration(v **types.CommitmentPurchaseAnalysisConfiguration, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CommitmentPurchaseAnalysisConfiguration - if *v == nil { - sv = &types.CommitmentPurchaseAnalysisConfiguration{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "SavingsPlansPurchaseAnalysisConfiguration": - if err := awsAwsjson11_deserializeDocumentSavingsPlansPurchaseAnalysisConfiguration(&sv.SavingsPlansPurchaseAnalysisConfiguration, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentComparisonMetrics(v *map[string]types.ComparisonMetricValue, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var mv map[string]types.ComparisonMetricValue - if *v == nil { - mv = map[string]types.ComparisonMetricValue{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal types.ComparisonMetricValue - mapVar := parsedVal - destAddr := &mapVar - if err := awsAwsjson11_deserializeDocumentComparisonMetricValue(&destAddr, value); err != nil { - return err - } - parsedVal = *destAddr - mv[key] = parsedVal - - } - *v = mv - return nil -} - -func awsAwsjson11_deserializeDocumentComparisonMetricValue(v **types.ComparisonMetricValue, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ComparisonMetricValue - if *v == nil { - sv = &types.ComparisonMetricValue{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "BaselineTimePeriodAmount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.BaselineTimePeriodAmount = ptr.String(jtv) - } - - case "ComparisonTimePeriodAmount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.ComparisonTimePeriodAmount = ptr.String(jtv) - } - - case "Difference": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Difference = ptr.String(jtv) - } - - case "Unit": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Unit = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCostAllocationTag(v **types.CostAllocationTag, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CostAllocationTag - if *v == nil { - sv = &types.CostAllocationTag{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "LastUpdatedDate": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.LastUpdatedDate = ptr.String(jtv) - } - - case "LastUsedDate": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.LastUsedDate = ptr.String(jtv) - } - - case "Status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CostAllocationTagStatus to be of type string, got %T instead", value) - } - sv.Status = types.CostAllocationTagStatus(jtv) - } - - case "TagKey": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) - } - sv.TagKey = ptr.String(jtv) - } - - case "Type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CostAllocationTagType to be of type string, got %T instead", value) - } - sv.Type = types.CostAllocationTagType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCostAllocationTagBackfillRequest(v **types.CostAllocationTagBackfillRequest, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CostAllocationTagBackfillRequest - if *v == nil { - sv = &types.CostAllocationTagBackfillRequest{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "BackfillFrom": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.BackfillFrom = ptr.String(jtv) - } - - case "BackfillStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CostAllocationTagBackfillStatus to be of type string, got %T instead", value) - } - sv.BackfillStatus = types.CostAllocationTagBackfillStatus(jtv) - } - - case "CompletedAt": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.CompletedAt = ptr.String(jtv) - } - - case "LastUpdatedAt": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.LastUpdatedAt = ptr.String(jtv) - } - - case "RequestedAt": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.RequestedAt = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCostAllocationTagBackfillRequestList(v *[]types.CostAllocationTagBackfillRequest, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.CostAllocationTagBackfillRequest - if *v == nil { - cv = []types.CostAllocationTagBackfillRequest{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.CostAllocationTagBackfillRequest - destAddr := &col - if err := awsAwsjson11_deserializeDocumentCostAllocationTagBackfillRequest(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentCostAllocationTagList(v *[]types.CostAllocationTag, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.CostAllocationTag - if *v == nil { - cv = []types.CostAllocationTag{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.CostAllocationTag - destAddr := &col - if err := awsAwsjson11_deserializeDocumentCostAllocationTag(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentCostAndUsageComparison(v **types.CostAndUsageComparison, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CostAndUsageComparison - if *v == nil { - sv = &types.CostAndUsageComparison{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CostAndUsageSelector": - if err := awsAwsjson11_deserializeDocumentExpression(&sv.CostAndUsageSelector, value); err != nil { - return err - } - - case "Metrics": - if err := awsAwsjson11_deserializeDocumentComparisonMetrics(&sv.Metrics, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCostAndUsageComparisons(v *[]types.CostAndUsageComparison, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.CostAndUsageComparison - if *v == nil { - cv = []types.CostAndUsageComparison{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.CostAndUsageComparison - destAddr := &col - if err := awsAwsjson11_deserializeDocumentCostAndUsageComparison(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentCostCategory(v **types.CostCategory, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CostCategory - if *v == nil { - sv = &types.CostCategory{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CostCategoryArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.CostCategoryArn = ptr.String(jtv) - } - - case "DefaultValue": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CostCategoryValue to be of type string, got %T instead", value) - } - sv.DefaultValue = ptr.String(jtv) - } - - case "EffectiveEnd": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.EffectiveEnd = ptr.String(jtv) - } - - case "EffectiveStart": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.EffectiveStart = ptr.String(jtv) - } - - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CostCategoryName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "ProcessingStatus": - if err := awsAwsjson11_deserializeDocumentCostCategoryProcessingStatusList(&sv.ProcessingStatus, value); err != nil { - return err - } - - case "Rules": - if err := awsAwsjson11_deserializeDocumentCostCategoryRulesList(&sv.Rules, value); err != nil { - return err - } - - case "RuleVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CostCategoryRuleVersion to be of type string, got %T instead", value) - } - sv.RuleVersion = types.CostCategoryRuleVersion(jtv) - } - - case "SplitChargeRules": - if err := awsAwsjson11_deserializeDocumentCostCategorySplitChargeRulesList(&sv.SplitChargeRules, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCostCategoryInheritedValueDimension(v **types.CostCategoryInheritedValueDimension, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CostCategoryInheritedValueDimension - if *v == nil { - sv = &types.CostCategoryInheritedValueDimension{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "DimensionKey": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.DimensionKey = ptr.String(jtv) - } - - case "DimensionName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CostCategoryInheritedValueDimensionName to be of type string, got %T instead", value) - } - sv.DimensionName = types.CostCategoryInheritedValueDimensionName(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCostCategoryNamesList(v *[]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []string - if *v == nil { - cv = []string{} - } else { - cv = *v - } - - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CostCategoryName to be of type string, got %T instead", value) - } - col = jtv - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentCostCategoryProcessingStatus(v **types.CostCategoryProcessingStatus, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CostCategoryProcessingStatus - if *v == nil { - sv = &types.CostCategoryProcessingStatus{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Component": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CostCategoryStatusComponent to be of type string, got %T instead", value) - } - sv.Component = types.CostCategoryStatusComponent(jtv) - } - - case "Status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CostCategoryStatus to be of type string, got %T instead", value) - } - sv.Status = types.CostCategoryStatus(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCostCategoryProcessingStatusList(v *[]types.CostCategoryProcessingStatus, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.CostCategoryProcessingStatus - if *v == nil { - cv = []types.CostCategoryProcessingStatus{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.CostCategoryProcessingStatus - destAddr := &col - if err := awsAwsjson11_deserializeDocumentCostCategoryProcessingStatus(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentCostCategoryReference(v **types.CostCategoryReference, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CostCategoryReference - if *v == nil { - sv = &types.CostCategoryReference{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CostCategoryArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.CostCategoryArn = ptr.String(jtv) - } - - case "DefaultValue": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CostCategoryValue to be of type string, got %T instead", value) - } - sv.DefaultValue = ptr.String(jtv) - } - - case "EffectiveEnd": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.EffectiveEnd = ptr.String(jtv) - } - - case "EffectiveStart": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.EffectiveStart = ptr.String(jtv) - } - - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CostCategoryName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "NumberOfRules": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected NonNegativeInteger to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.NumberOfRules = int32(i64) - } - - case "ProcessingStatus": - if err := awsAwsjson11_deserializeDocumentCostCategoryProcessingStatusList(&sv.ProcessingStatus, value); err != nil { - return err - } - - case "SupportedResourceTypes": - if err := awsAwsjson11_deserializeDocumentResourceTypes(&sv.SupportedResourceTypes, value); err != nil { - return err - } - - case "Values": - if err := awsAwsjson11_deserializeDocumentCostCategoryValuesList(&sv.Values, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCostCategoryReferencesList(v *[]types.CostCategoryReference, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.CostCategoryReference - if *v == nil { - cv = []types.CostCategoryReference{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.CostCategoryReference - destAddr := &col - if err := awsAwsjson11_deserializeDocumentCostCategoryReference(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentCostCategoryResourceAssociation(v **types.CostCategoryResourceAssociation, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CostCategoryResourceAssociation - if *v == nil { - sv = &types.CostCategoryResourceAssociation{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CostCategoryArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.CostCategoryArn = ptr.String(jtv) - } - - case "CostCategoryName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CostCategoryName to be of type string, got %T instead", value) - } - sv.CostCategoryName = ptr.String(jtv) - } - - case "ResourceArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericArn to be of type string, got %T instead", value) - } - sv.ResourceArn = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCostCategoryResourceAssociations(v *[]types.CostCategoryResourceAssociation, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.CostCategoryResourceAssociation - if *v == nil { - cv = []types.CostCategoryResourceAssociation{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.CostCategoryResourceAssociation - destAddr := &col - if err := awsAwsjson11_deserializeDocumentCostCategoryResourceAssociation(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentCostCategoryRule(v **types.CostCategoryRule, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CostCategoryRule - if *v == nil { - sv = &types.CostCategoryRule{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "InheritedValue": - if err := awsAwsjson11_deserializeDocumentCostCategoryInheritedValueDimension(&sv.InheritedValue, value); err != nil { - return err - } - - case "Rule": - if err := awsAwsjson11_deserializeDocumentExpression(&sv.Rule, value); err != nil { - return err - } - - case "Type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CostCategoryRuleType to be of type string, got %T instead", value) - } - sv.Type = types.CostCategoryRuleType(jtv) - } - - case "Value": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CostCategoryValue to be of type string, got %T instead", value) - } - sv.Value = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCostCategoryRulesList(v *[]types.CostCategoryRule, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.CostCategoryRule - if *v == nil { - cv = []types.CostCategoryRule{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.CostCategoryRule - destAddr := &col - if err := awsAwsjson11_deserializeDocumentCostCategoryRule(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentCostCategorySplitChargeRule(v **types.CostCategorySplitChargeRule, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CostCategorySplitChargeRule - if *v == nil { - sv = &types.CostCategorySplitChargeRule{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Method": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CostCategorySplitChargeMethod to be of type string, got %T instead", value) - } - sv.Method = types.CostCategorySplitChargeMethod(jtv) - } - - case "Parameters": - if err := awsAwsjson11_deserializeDocumentCostCategorySplitChargeRuleParametersList(&sv.Parameters, value); err != nil { - return err - } - - case "Source": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Source = ptr.String(jtv) - } - - case "Targets": - if err := awsAwsjson11_deserializeDocumentCostCategorySplitChargeRuleTargetsList(&sv.Targets, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCostCategorySplitChargeRuleParameter(v **types.CostCategorySplitChargeRuleParameter, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CostCategorySplitChargeRuleParameter - if *v == nil { - sv = &types.CostCategorySplitChargeRuleParameter{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CostCategorySplitChargeRuleParameterType to be of type string, got %T instead", value) - } - sv.Type = types.CostCategorySplitChargeRuleParameterType(jtv) - } - - case "Values": - if err := awsAwsjson11_deserializeDocumentCostCategorySplitChargeRuleParameterValuesList(&sv.Values, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCostCategorySplitChargeRuleParametersList(v *[]types.CostCategorySplitChargeRuleParameter, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.CostCategorySplitChargeRuleParameter - if *v == nil { - cv = []types.CostCategorySplitChargeRuleParameter{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.CostCategorySplitChargeRuleParameter - destAddr := &col - if err := awsAwsjson11_deserializeDocumentCostCategorySplitChargeRuleParameter(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentCostCategorySplitChargeRuleParameterValuesList(v *[]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []string - if *v == nil { - cv = []string{} - } else { - cv = *v - } - - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - col = jtv - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentCostCategorySplitChargeRulesList(v *[]types.CostCategorySplitChargeRule, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.CostCategorySplitChargeRule - if *v == nil { - cv = []types.CostCategorySplitChargeRule{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.CostCategorySplitChargeRule - destAddr := &col - if err := awsAwsjson11_deserializeDocumentCostCategorySplitChargeRule(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentCostCategorySplitChargeRuleTargetsList(v *[]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []string - if *v == nil { - cv = []string{} - } else { - cv = *v - } - - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - col = jtv - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentCostCategoryValues(v **types.CostCategoryValues, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CostCategoryValues - if *v == nil { - sv = &types.CostCategoryValues{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Key": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CostCategoryName to be of type string, got %T instead", value) - } - sv.Key = ptr.String(jtv) - } - - case "MatchOptions": - if err := awsAwsjson11_deserializeDocumentMatchOptions(&sv.MatchOptions, value); err != nil { - return err - } - - case "Values": - if err := awsAwsjson11_deserializeDocumentValues(&sv.Values, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCostCategoryValuesList(v *[]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []string - if *v == nil { - cv = []string{} - } else { - cv = *v - } - - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CostCategoryValue to be of type string, got %T instead", value) - } - col = jtv - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentCostComparisonDriver(v **types.CostComparisonDriver, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CostComparisonDriver - if *v == nil { - sv = &types.CostComparisonDriver{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CostDrivers": - if err := awsAwsjson11_deserializeDocumentCostDrivers(&sv.CostDrivers, value); err != nil { - return err - } - - case "CostSelector": - if err := awsAwsjson11_deserializeDocumentExpression(&sv.CostSelector, value); err != nil { - return err - } - - case "Metrics": - if err := awsAwsjson11_deserializeDocumentComparisonMetrics(&sv.Metrics, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCostComparisonDrivers(v *[]types.CostComparisonDriver, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.CostComparisonDriver - if *v == nil { - cv = []types.CostComparisonDriver{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.CostComparisonDriver - destAddr := &col - if err := awsAwsjson11_deserializeDocumentCostComparisonDriver(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentCostDriver(v **types.CostDriver, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CostDriver - if *v == nil { - sv = &types.CostDriver{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Metrics": - if err := awsAwsjson11_deserializeDocumentComparisonMetrics(&sv.Metrics, value); err != nil { - return err - } - - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "Type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Type = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCostDrivers(v *[]types.CostDriver, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.CostDriver - if *v == nil { - cv = []types.CostDriver{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.CostDriver - destAddr := &col - if err := awsAwsjson11_deserializeDocumentCostDriver(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentCoverage(v **types.Coverage, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Coverage - if *v == nil { - sv = &types.Coverage{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CoverageCost": - if err := awsAwsjson11_deserializeDocumentCoverageCost(&sv.CoverageCost, value); err != nil { - return err - } - - case "CoverageHours": - if err := awsAwsjson11_deserializeDocumentCoverageHours(&sv.CoverageHours, value); err != nil { - return err - } - - case "CoverageNormalizedUnits": - if err := awsAwsjson11_deserializeDocumentCoverageNormalizedUnits(&sv.CoverageNormalizedUnits, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCoverageByTime(v **types.CoverageByTime, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CoverageByTime - if *v == nil { - sv = &types.CoverageByTime{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Groups": - if err := awsAwsjson11_deserializeDocumentReservationCoverageGroups(&sv.Groups, value); err != nil { - return err - } - - case "TimePeriod": - if err := awsAwsjson11_deserializeDocumentDateInterval(&sv.TimePeriod, value); err != nil { - return err - } - - case "Total": - if err := awsAwsjson11_deserializeDocumentCoverage(&sv.Total, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCoverageCost(v **types.CoverageCost, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CoverageCost - if *v == nil { - sv = &types.CoverageCost{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "OnDemandCost": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OnDemandCost to be of type string, got %T instead", value) - } - sv.OnDemandCost = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCoverageHours(v **types.CoverageHours, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CoverageHours - if *v == nil { - sv = &types.CoverageHours{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CoverageHoursPercentage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CoverageHoursPercentage to be of type string, got %T instead", value) - } - sv.CoverageHoursPercentage = ptr.String(jtv) - } - - case "OnDemandHours": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OnDemandHours to be of type string, got %T instead", value) - } - sv.OnDemandHours = ptr.String(jtv) - } - - case "ReservedHours": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ReservedHours to be of type string, got %T instead", value) - } - sv.ReservedHours = ptr.String(jtv) - } - - case "TotalRunningHours": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TotalRunningHours to be of type string, got %T instead", value) - } - sv.TotalRunningHours = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCoverageNormalizedUnits(v **types.CoverageNormalizedUnits, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CoverageNormalizedUnits - if *v == nil { - sv = &types.CoverageNormalizedUnits{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CoverageNormalizedUnitsPercentage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CoverageNormalizedUnitsPercentage to be of type string, got %T instead", value) - } - sv.CoverageNormalizedUnitsPercentage = ptr.String(jtv) - } - - case "OnDemandNormalizedUnits": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OnDemandNormalizedUnits to be of type string, got %T instead", value) - } - sv.OnDemandNormalizedUnits = ptr.String(jtv) - } - - case "ReservedNormalizedUnits": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ReservedNormalizedUnits to be of type string, got %T instead", value) - } - sv.ReservedNormalizedUnits = ptr.String(jtv) - } - - case "TotalRunningNormalizedUnits": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TotalRunningNormalizedUnits to be of type string, got %T instead", value) - } - sv.TotalRunningNormalizedUnits = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCoveragesByTime(v *[]types.CoverageByTime, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.CoverageByTime - if *v == nil { - cv = []types.CoverageByTime{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.CoverageByTime - destAddr := &col - if err := awsAwsjson11_deserializeDocumentCoverageByTime(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentCurrentInstance(v **types.CurrentInstance, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CurrentInstance - if *v == nil { - sv = &types.CurrentInstance{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CurrencyCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrencyCode = ptr.String(jtv) - } - - case "InstanceName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.InstanceName = ptr.String(jtv) - } - - case "MonthlyCost": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.MonthlyCost = ptr.String(jtv) - } - - case "OnDemandHoursInLookbackPeriod": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.OnDemandHoursInLookbackPeriod = ptr.String(jtv) - } - - case "ReservationCoveredHoursInLookbackPeriod": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.ReservationCoveredHoursInLookbackPeriod = ptr.String(jtv) - } - - case "ResourceDetails": - if err := awsAwsjson11_deserializeDocumentResourceDetails(&sv.ResourceDetails, value); err != nil { - return err - } - - case "ResourceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.ResourceId = ptr.String(jtv) - } - - case "ResourceUtilization": - if err := awsAwsjson11_deserializeDocumentResourceUtilization(&sv.ResourceUtilization, value); err != nil { - return err - } - - case "SavingsPlansCoveredHoursInLookbackPeriod": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.SavingsPlansCoveredHoursInLookbackPeriod = ptr.String(jtv) - } - - case "Tags": - if err := awsAwsjson11_deserializeDocumentTagValuesList(&sv.Tags, value); err != nil { - return err - } - - case "TotalRunningHoursInLookbackPeriod": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.TotalRunningHoursInLookbackPeriod = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentDataUnavailableException(v **types.DataUnavailableException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.DataUnavailableException - if *v == nil { - sv = &types.DataUnavailableException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentDateInterval(v **types.DateInterval, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.DateInterval - if *v == nil { - sv = &types.DateInterval{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "End": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected YearMonthDay to be of type string, got %T instead", value) - } - sv.End = ptr.String(jtv) - } - - case "Start": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected YearMonthDay to be of type string, got %T instead", value) - } - sv.Start = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentDimensionValues(v **types.DimensionValues, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.DimensionValues - if *v == nil { - sv = &types.DimensionValues{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Key": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Dimension to be of type string, got %T instead", value) - } - sv.Key = types.Dimension(jtv) - } - - case "MatchOptions": - if err := awsAwsjson11_deserializeDocumentMatchOptions(&sv.MatchOptions, value); err != nil { - return err - } - - case "Values": - if err := awsAwsjson11_deserializeDocumentValues(&sv.Values, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentDimensionValuesWithAttributes(v **types.DimensionValuesWithAttributes, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.DimensionValuesWithAttributes - if *v == nil { - sv = &types.DimensionValuesWithAttributes{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Attributes": - if err := awsAwsjson11_deserializeDocumentAttributes(&sv.Attributes, value); err != nil { - return err - } - - case "Value": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Value to be of type string, got %T instead", value) - } - sv.Value = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentDimensionValuesWithAttributesList(v *[]types.DimensionValuesWithAttributes, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.DimensionValuesWithAttributes - if *v == nil { - cv = []types.DimensionValuesWithAttributes{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.DimensionValuesWithAttributes - destAddr := &col - if err := awsAwsjson11_deserializeDocumentDimensionValuesWithAttributes(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentDiskResourceUtilization(v **types.DiskResourceUtilization, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.DiskResourceUtilization - if *v == nil { - sv = &types.DiskResourceUtilization{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "DiskReadBytesPerSecond": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.DiskReadBytesPerSecond = ptr.String(jtv) - } - - case "DiskReadOpsPerSecond": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.DiskReadOpsPerSecond = ptr.String(jtv) - } - - case "DiskWriteBytesPerSecond": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.DiskWriteBytesPerSecond = ptr.String(jtv) - } - - case "DiskWriteOpsPerSecond": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.DiskWriteOpsPerSecond = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentDynamoDBCapacityDetails(v **types.DynamoDBCapacityDetails, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.DynamoDBCapacityDetails - if *v == nil { - sv = &types.DynamoDBCapacityDetails{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CapacityUnits": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CapacityUnits = ptr.String(jtv) - } - - case "Region": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Region = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentEBSResourceUtilization(v **types.EBSResourceUtilization, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.EBSResourceUtilization - if *v == nil { - sv = &types.EBSResourceUtilization{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "EbsReadBytesPerSecond": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EbsReadBytesPerSecond = ptr.String(jtv) - } - - case "EbsReadOpsPerSecond": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EbsReadOpsPerSecond = ptr.String(jtv) - } - - case "EbsWriteBytesPerSecond": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EbsWriteBytesPerSecond = ptr.String(jtv) - } - - case "EbsWriteOpsPerSecond": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EbsWriteOpsPerSecond = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentEC2InstanceDetails(v **types.EC2InstanceDetails, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.EC2InstanceDetails - if *v == nil { - sv = &types.EC2InstanceDetails{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AvailabilityZone": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.AvailabilityZone = ptr.String(jtv) - } - - case "CurrentGeneration": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected GenericBoolean to be of type *bool, got %T instead", value) - } - sv.CurrentGeneration = jtv - } - - case "Family": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Family = ptr.String(jtv) - } - - case "InstanceType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.InstanceType = ptr.String(jtv) - } - - case "Platform": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Platform = ptr.String(jtv) - } - - case "Region": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Region = ptr.String(jtv) - } - - case "SizeFlexEligible": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected GenericBoolean to be of type *bool, got %T instead", value) - } - sv.SizeFlexEligible = jtv - } - - case "Tenancy": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Tenancy = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentEC2ResourceDetails(v **types.EC2ResourceDetails, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.EC2ResourceDetails - if *v == nil { - sv = &types.EC2ResourceDetails{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "HourlyOnDemandRate": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.HourlyOnDemandRate = ptr.String(jtv) - } - - case "InstanceType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.InstanceType = ptr.String(jtv) - } - - case "Memory": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Memory = ptr.String(jtv) - } - - case "NetworkPerformance": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.NetworkPerformance = ptr.String(jtv) - } - - case "Platform": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Platform = ptr.String(jtv) - } - - case "Region": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Region = ptr.String(jtv) - } - - case "Sku": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Sku = ptr.String(jtv) - } - - case "Storage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Storage = ptr.String(jtv) - } - - case "Vcpu": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Vcpu = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentEC2ResourceUtilization(v **types.EC2ResourceUtilization, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.EC2ResourceUtilization - if *v == nil { - sv = &types.EC2ResourceUtilization{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "DiskResourceUtilization": - if err := awsAwsjson11_deserializeDocumentDiskResourceUtilization(&sv.DiskResourceUtilization, value); err != nil { - return err - } - - case "EBSResourceUtilization": - if err := awsAwsjson11_deserializeDocumentEBSResourceUtilization(&sv.EBSResourceUtilization, value); err != nil { - return err - } - - case "MaxCpuUtilizationPercentage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.MaxCpuUtilizationPercentage = ptr.String(jtv) - } - - case "MaxMemoryUtilizationPercentage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.MaxMemoryUtilizationPercentage = ptr.String(jtv) - } - - case "MaxStorageUtilizationPercentage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.MaxStorageUtilizationPercentage = ptr.String(jtv) - } - - case "NetworkResourceUtilization": - if err := awsAwsjson11_deserializeDocumentNetworkResourceUtilization(&sv.NetworkResourceUtilization, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentEC2Specification(v **types.EC2Specification, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.EC2Specification - if *v == nil { - sv = &types.EC2Specification{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "OfferingClass": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OfferingClass to be of type string, got %T instead", value) - } - sv.OfferingClass = types.OfferingClass(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentElastiCacheInstanceDetails(v **types.ElastiCacheInstanceDetails, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ElastiCacheInstanceDetails - if *v == nil { - sv = &types.ElastiCacheInstanceDetails{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CurrentGeneration": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected GenericBoolean to be of type *bool, got %T instead", value) - } - sv.CurrentGeneration = jtv - } - - case "Family": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Family = ptr.String(jtv) - } - - case "NodeType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.NodeType = ptr.String(jtv) - } - - case "ProductDescription": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.ProductDescription = ptr.String(jtv) - } - - case "Region": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Region = ptr.String(jtv) - } - - case "SizeFlexEligible": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected GenericBoolean to be of type *bool, got %T instead", value) - } - sv.SizeFlexEligible = jtv - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentESInstanceDetails(v **types.ESInstanceDetails, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ESInstanceDetails - if *v == nil { - sv = &types.ESInstanceDetails{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CurrentGeneration": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected GenericBoolean to be of type *bool, got %T instead", value) - } - sv.CurrentGeneration = jtv - } - - case "InstanceClass": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.InstanceClass = ptr.String(jtv) - } - - case "InstanceSize": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.InstanceSize = ptr.String(jtv) - } - - case "Region": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Region = ptr.String(jtv) - } - - case "SizeFlexEligible": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected GenericBoolean to be of type *bool, got %T instead", value) - } - sv.SizeFlexEligible = jtv - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentExpression(v **types.Expression, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Expression - if *v == nil { - sv = &types.Expression{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "And": - if err := awsAwsjson11_deserializeDocumentExpressions(&sv.And, value); err != nil { - return err - } - - case "CostCategories": - if err := awsAwsjson11_deserializeDocumentCostCategoryValues(&sv.CostCategories, value); err != nil { - return err - } - - case "Dimensions": - if err := awsAwsjson11_deserializeDocumentDimensionValues(&sv.Dimensions, value); err != nil { - return err - } - - case "Not": - if err := awsAwsjson11_deserializeDocumentExpression(&sv.Not, value); err != nil { - return err - } - - case "Or": - if err := awsAwsjson11_deserializeDocumentExpressions(&sv.Or, value); err != nil { - return err - } - - case "Tags": - if err := awsAwsjson11_deserializeDocumentTagValues(&sv.Tags, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentExpressions(v *[]types.Expression, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.Expression - if *v == nil { - cv = []types.Expression{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.Expression - destAddr := &col - if err := awsAwsjson11_deserializeDocumentExpression(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentFindingReasonCodes(v *[]types.FindingReasonCode, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.FindingReasonCode - if *v == nil { - cv = []types.FindingReasonCode{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.FindingReasonCode - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FindingReasonCode to be of type string, got %T instead", value) - } - col = types.FindingReasonCode(jtv) - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentForecastResult(v **types.ForecastResult, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ForecastResult - if *v == nil { - sv = &types.ForecastResult{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "MeanValue": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.MeanValue = ptr.String(jtv) - } - - case "PredictionIntervalLowerBound": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.PredictionIntervalLowerBound = ptr.String(jtv) - } - - case "PredictionIntervalUpperBound": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.PredictionIntervalUpperBound = ptr.String(jtv) - } - - case "TimePeriod": - if err := awsAwsjson11_deserializeDocumentDateInterval(&sv.TimePeriod, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentForecastResultsByTime(v *[]types.ForecastResult, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.ForecastResult - if *v == nil { - cv = []types.ForecastResult{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ForecastResult - destAddr := &col - if err := awsAwsjson11_deserializeDocumentForecastResult(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentGenerationExistsException(v **types.GenerationExistsException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.GenerationExistsException - if *v == nil { - sv = &types.GenerationExistsException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentGenerationSummary(v **types.GenerationSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.GenerationSummary - if *v == nil { - sv = &types.GenerationSummary{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "EstimatedCompletionTime": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.EstimatedCompletionTime = ptr.String(jtv) - } - - case "GenerationCompletionTime": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.GenerationCompletionTime = ptr.String(jtv) - } - - case "GenerationStartedTime": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.GenerationStartedTime = ptr.String(jtv) - } - - case "GenerationStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenerationStatus to be of type string, got %T instead", value) - } - sv.GenerationStatus = types.GenerationStatus(jtv) - } - - case "RecommendationId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RecommendationId to be of type string, got %T instead", value) - } - sv.RecommendationId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentGenerationSummaryList(v *[]types.GenerationSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.GenerationSummary - if *v == nil { - cv = []types.GenerationSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.GenerationSummary - destAddr := &col - if err := awsAwsjson11_deserializeDocumentGenerationSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentGroup(v **types.Group, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Group - if *v == nil { - sv = &types.Group{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Keys": - if err := awsAwsjson11_deserializeDocumentKeys(&sv.Keys, value); err != nil { - return err - } - - case "Metrics": - if err := awsAwsjson11_deserializeDocumentMetrics(&sv.Metrics, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentGroupDefinition(v **types.GroupDefinition, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.GroupDefinition - if *v == nil { - sv = &types.GroupDefinition{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Key": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GroupDefinitionKey to be of type string, got %T instead", value) - } - sv.Key = ptr.String(jtv) - } - - case "Type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GroupDefinitionType to be of type string, got %T instead", value) - } - sv.Type = types.GroupDefinitionType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentGroupDefinitions(v *[]types.GroupDefinition, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.GroupDefinition - if *v == nil { - cv = []types.GroupDefinition{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.GroupDefinition - destAddr := &col - if err := awsAwsjson11_deserializeDocumentGroupDefinition(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentGroups(v *[]types.Group, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.Group - if *v == nil { - cv = []types.Group{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.Group - destAddr := &col - if err := awsAwsjson11_deserializeDocumentGroup(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentImpact(v **types.Impact, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Impact - if *v == nil { - sv = &types.Impact{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "MaxImpact": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.MaxImpact = f64 - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.MaxImpact = f64 - - default: - return fmt.Errorf("expected GenericDouble to be a JSON Number, got %T instead", value) - - } - } - - case "TotalActualSpend": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.TotalActualSpend = ptr.Float64(f64) - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.TotalActualSpend = ptr.Float64(f64) - - default: - return fmt.Errorf("expected NullableNonNegativeDouble to be a JSON Number, got %T instead", value) - - } - } - - case "TotalExpectedSpend": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.TotalExpectedSpend = ptr.Float64(f64) - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.TotalExpectedSpend = ptr.Float64(f64) - - default: - return fmt.Errorf("expected NullableNonNegativeDouble to be a JSON Number, got %T instead", value) - - } - } - - case "TotalImpact": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.TotalImpact = f64 - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.TotalImpact = f64 - - default: - return fmt.Errorf("expected GenericDouble to be a JSON Number, got %T instead", value) - - } - } - - case "TotalImpactPercentage": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.TotalImpactPercentage = ptr.Float64(f64) - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.TotalImpactPercentage = ptr.Float64(f64) - - default: - return fmt.Errorf("expected NullableNonNegativeDouble to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentInstanceDetails(v **types.InstanceDetails, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InstanceDetails - if *v == nil { - sv = &types.InstanceDetails{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "EC2InstanceDetails": - if err := awsAwsjson11_deserializeDocumentEC2InstanceDetails(&sv.EC2InstanceDetails, value); err != nil { - return err - } - - case "ElastiCacheInstanceDetails": - if err := awsAwsjson11_deserializeDocumentElastiCacheInstanceDetails(&sv.ElastiCacheInstanceDetails, value); err != nil { - return err - } - - case "ESInstanceDetails": - if err := awsAwsjson11_deserializeDocumentESInstanceDetails(&sv.ESInstanceDetails, value); err != nil { - return err - } - - case "MemoryDBInstanceDetails": - if err := awsAwsjson11_deserializeDocumentMemoryDBInstanceDetails(&sv.MemoryDBInstanceDetails, value); err != nil { - return err - } - - case "RDSInstanceDetails": - if err := awsAwsjson11_deserializeDocumentRDSInstanceDetails(&sv.RDSInstanceDetails, value); err != nil { - return err - } - - case "RedshiftInstanceDetails": - if err := awsAwsjson11_deserializeDocumentRedshiftInstanceDetails(&sv.RedshiftInstanceDetails, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentInvalidNextTokenException(v **types.InvalidNextTokenException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InvalidNextTokenException - if *v == nil { - sv = &types.InvalidNextTokenException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentKeys(v *[]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []string - if *v == nil { - cv = []string{} - } else { - cv = *v - } - - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Key to be of type string, got %T instead", value) - } - col = jtv - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.LimitExceededException - if *v == nil { - sv = &types.LimitExceededException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentMatchOptions(v *[]types.MatchOption, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.MatchOption - if *v == nil { - cv = []types.MatchOption{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.MatchOption - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected MatchOption to be of type string, got %T instead", value) - } - col = types.MatchOption(jtv) - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentMemoryDBInstanceDetails(v **types.MemoryDBInstanceDetails, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.MemoryDBInstanceDetails - if *v == nil { - sv = &types.MemoryDBInstanceDetails{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CurrentGeneration": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected GenericBoolean to be of type *bool, got %T instead", value) - } - sv.CurrentGeneration = jtv - } - - case "Family": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Family = ptr.String(jtv) - } - - case "NodeType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.NodeType = ptr.String(jtv) - } - - case "Region": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Region = ptr.String(jtv) - } - - case "SizeFlexEligible": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected GenericBoolean to be of type *bool, got %T instead", value) - } - sv.SizeFlexEligible = jtv - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentMetrics(v *map[string]types.MetricValue, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var mv map[string]types.MetricValue - if *v == nil { - mv = map[string]types.MetricValue{} - } else { - mv = *v - } - - for key, value := range shape { - var parsedVal types.MetricValue - mapVar := parsedVal - destAddr := &mapVar - if err := awsAwsjson11_deserializeDocumentMetricValue(&destAddr, value); err != nil { - return err - } - parsedVal = *destAddr - mv[key] = parsedVal - - } - *v = mv - return nil -} - -func awsAwsjson11_deserializeDocumentMetricsOverLookbackPeriod(v *[]types.RecommendationDetailHourlyMetrics, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.RecommendationDetailHourlyMetrics - if *v == nil { - cv = []types.RecommendationDetailHourlyMetrics{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.RecommendationDetailHourlyMetrics - destAddr := &col - if err := awsAwsjson11_deserializeDocumentRecommendationDetailHourlyMetrics(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentMetricValue(v **types.MetricValue, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.MetricValue - if *v == nil { - sv = &types.MetricValue{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Amount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected MetricAmount to be of type string, got %T instead", value) - } - sv.Amount = ptr.String(jtv) - } - - case "Unit": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected MetricUnit to be of type string, got %T instead", value) - } - sv.Unit = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentModifyRecommendationDetail(v **types.ModifyRecommendationDetail, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ModifyRecommendationDetail - if *v == nil { - sv = &types.ModifyRecommendationDetail{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "TargetInstances": - if err := awsAwsjson11_deserializeDocumentTargetInstancesList(&sv.TargetInstances, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentMonitorArnList(v *[]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []string - if *v == nil { - cv = []string{} - } else { - cv = *v - } - - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - col = jtv - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentNetworkResourceUtilization(v **types.NetworkResourceUtilization, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.NetworkResourceUtilization - if *v == nil { - sv = &types.NetworkResourceUtilization{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "NetworkInBytesPerSecond": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.NetworkInBytesPerSecond = ptr.String(jtv) - } - - case "NetworkOutBytesPerSecond": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.NetworkOutBytesPerSecond = ptr.String(jtv) - } - - case "NetworkPacketsInPerSecond": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.NetworkPacketsInPerSecond = ptr.String(jtv) - } - - case "NetworkPacketsOutPerSecond": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.NetworkPacketsOutPerSecond = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentPlatformDifferences(v *[]types.PlatformDifference, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.PlatformDifference - if *v == nil { - cv = []types.PlatformDifference{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.PlatformDifference - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PlatformDifference to be of type string, got %T instead", value) - } - col = types.PlatformDifference(jtv) - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentRDSInstanceDetails(v **types.RDSInstanceDetails, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.RDSInstanceDetails - if *v == nil { - sv = &types.RDSInstanceDetails{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CurrentGeneration": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected GenericBoolean to be of type *bool, got %T instead", value) - } - sv.CurrentGeneration = jtv - } - - case "DatabaseEdition": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.DatabaseEdition = ptr.String(jtv) - } - - case "DatabaseEngine": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.DatabaseEngine = ptr.String(jtv) - } - - case "DeploymentModel": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.DeploymentModel = ptr.String(jtv) - } - - case "DeploymentOption": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.DeploymentOption = ptr.String(jtv) - } - - case "Family": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Family = ptr.String(jtv) - } - - case "InstanceType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.InstanceType = ptr.String(jtv) - } - - case "LicenseModel": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.LicenseModel = ptr.String(jtv) - } - - case "Region": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Region = ptr.String(jtv) - } - - case "SizeFlexEligible": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected GenericBoolean to be of type *bool, got %T instead", value) - } - sv.SizeFlexEligible = jtv - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentRecommendationDetailData(v **types.RecommendationDetailData, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.RecommendationDetailData - if *v == nil { - sv = &types.RecommendationDetailData{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AccountId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.AccountId = ptr.String(jtv) - } - - case "AccountScope": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountScope to be of type string, got %T instead", value) - } - sv.AccountScope = types.AccountScope(jtv) - } - - case "CurrencyCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrencyCode = ptr.String(jtv) - } - - case "CurrentAverageCoverage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrentAverageCoverage = ptr.String(jtv) - } - - case "CurrentAverageHourlyOnDemandSpend": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrentAverageHourlyOnDemandSpend = ptr.String(jtv) - } - - case "CurrentMaximumHourlyOnDemandSpend": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrentMaximumHourlyOnDemandSpend = ptr.String(jtv) - } - - case "CurrentMinimumHourlyOnDemandSpend": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrentMinimumHourlyOnDemandSpend = ptr.String(jtv) - } - - case "EstimatedAverageCoverage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedAverageCoverage = ptr.String(jtv) - } - - case "EstimatedAverageUtilization": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedAverageUtilization = ptr.String(jtv) - } - - case "EstimatedMonthlySavingsAmount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedMonthlySavingsAmount = ptr.String(jtv) - } - - case "EstimatedOnDemandCost": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedOnDemandCost = ptr.String(jtv) - } - - case "EstimatedOnDemandCostWithCurrentCommitment": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedOnDemandCostWithCurrentCommitment = ptr.String(jtv) - } - - case "EstimatedROI": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedROI = ptr.String(jtv) - } - - case "EstimatedSavingsAmount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedSavingsAmount = ptr.String(jtv) - } - - case "EstimatedSavingsPercentage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedSavingsPercentage = ptr.String(jtv) - } - - case "EstimatedSPCost": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedSPCost = ptr.String(jtv) - } - - case "ExistingHourlyCommitment": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.ExistingHourlyCommitment = ptr.String(jtv) - } - - case "GenerationTimestamp": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.GenerationTimestamp = ptr.String(jtv) - } - - case "HourlyCommitmentToPurchase": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.HourlyCommitmentToPurchase = ptr.String(jtv) - } - - case "InstanceFamily": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.InstanceFamily = ptr.String(jtv) - } - - case "LatestUsageTimestamp": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.LatestUsageTimestamp = ptr.String(jtv) - } - - case "LookbackPeriodInDays": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LookbackPeriodInDays to be of type string, got %T instead", value) - } - sv.LookbackPeriodInDays = types.LookbackPeriodInDays(jtv) - } - - case "MetricsOverLookbackPeriod": - if err := awsAwsjson11_deserializeDocumentMetricsOverLookbackPeriod(&sv.MetricsOverLookbackPeriod, value); err != nil { - return err - } - - case "OfferingId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.OfferingId = ptr.String(jtv) - } - - case "PaymentOption": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PaymentOption to be of type string, got %T instead", value) - } - sv.PaymentOption = types.PaymentOption(jtv) - } - - case "Region": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Region = ptr.String(jtv) - } - - case "SavingsPlansType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SupportedSavingsPlansType to be of type string, got %T instead", value) - } - sv.SavingsPlansType = types.SupportedSavingsPlansType(jtv) - } - - case "TermInYears": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TermInYears to be of type string, got %T instead", value) - } - sv.TermInYears = types.TermInYears(jtv) - } - - case "UpfrontCost": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.UpfrontCost = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentRecommendationDetailHourlyMetrics(v **types.RecommendationDetailHourlyMetrics, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.RecommendationDetailHourlyMetrics - if *v == nil { - sv = &types.RecommendationDetailHourlyMetrics{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CurrentCoverage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrentCoverage = ptr.String(jtv) - } - - case "EstimatedCoverage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedCoverage = ptr.String(jtv) - } - - case "EstimatedNewCommitmentUtilization": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedNewCommitmentUtilization = ptr.String(jtv) - } - - case "EstimatedOnDemandCost": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedOnDemandCost = ptr.String(jtv) - } - - case "StartTime": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.StartTime = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentRedshiftInstanceDetails(v **types.RedshiftInstanceDetails, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.RedshiftInstanceDetails - if *v == nil { - sv = &types.RedshiftInstanceDetails{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CurrentGeneration": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected GenericBoolean to be of type *bool, got %T instead", value) - } - sv.CurrentGeneration = jtv - } - - case "Family": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Family = ptr.String(jtv) - } - - case "NodeType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.NodeType = ptr.String(jtv) - } - - case "Region": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Region = ptr.String(jtv) - } - - case "SizeFlexEligible": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected GenericBoolean to be of type *bool, got %T instead", value) - } - sv.SizeFlexEligible = jtv - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentRequestChangedException(v **types.RequestChangedException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.RequestChangedException - if *v == nil { - sv = &types.RequestChangedException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentReservationAggregates(v **types.ReservationAggregates, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ReservationAggregates - if *v == nil { - sv = &types.ReservationAggregates{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AmortizedRecurringFee": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AmortizedRecurringFee to be of type string, got %T instead", value) - } - sv.AmortizedRecurringFee = ptr.String(jtv) - } - - case "AmortizedUpfrontFee": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AmortizedUpfrontFee to be of type string, got %T instead", value) - } - sv.AmortizedUpfrontFee = ptr.String(jtv) - } - - case "NetRISavings": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NetRISavings to be of type string, got %T instead", value) - } - sv.NetRISavings = ptr.String(jtv) - } - - case "OnDemandCostOfRIHoursUsed": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OnDemandCostOfRIHoursUsed to be of type string, got %T instead", value) - } - sv.OnDemandCostOfRIHoursUsed = ptr.String(jtv) - } - - case "PurchasedHours": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PurchasedHours to be of type string, got %T instead", value) - } - sv.PurchasedHours = ptr.String(jtv) - } - - case "PurchasedUnits": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PurchasedUnits to be of type string, got %T instead", value) - } - sv.PurchasedUnits = ptr.String(jtv) - } - - case "RealizedSavings": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RealizedSavings to be of type string, got %T instead", value) - } - sv.RealizedSavings = ptr.String(jtv) - } - - case "RICostForUnusedHours": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RICostForUnusedHours to be of type string, got %T instead", value) - } - sv.RICostForUnusedHours = ptr.String(jtv) - } - - case "TotalActualHours": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TotalActualHours to be of type string, got %T instead", value) - } - sv.TotalActualHours = ptr.String(jtv) - } - - case "TotalActualUnits": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TotalActualUnits to be of type string, got %T instead", value) - } - sv.TotalActualUnits = ptr.String(jtv) - } - - case "TotalAmortizedFee": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TotalAmortizedFee to be of type string, got %T instead", value) - } - sv.TotalAmortizedFee = ptr.String(jtv) - } - - case "TotalPotentialRISavings": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TotalPotentialRISavings to be of type string, got %T instead", value) - } - sv.TotalPotentialRISavings = ptr.String(jtv) - } - - case "UnrealizedSavings": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected UnrealizedSavings to be of type string, got %T instead", value) - } - sv.UnrealizedSavings = ptr.String(jtv) - } - - case "UnusedHours": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected UnusedHours to be of type string, got %T instead", value) - } - sv.UnusedHours = ptr.String(jtv) - } - - case "UnusedUnits": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected UnusedUnits to be of type string, got %T instead", value) - } - sv.UnusedUnits = ptr.String(jtv) - } - - case "UtilizationPercentage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected UtilizationPercentage to be of type string, got %T instead", value) - } - sv.UtilizationPercentage = ptr.String(jtv) - } - - case "UtilizationPercentageInUnits": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected UtilizationPercentageInUnits to be of type string, got %T instead", value) - } - sv.UtilizationPercentageInUnits = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentReservationCoverageGroup(v **types.ReservationCoverageGroup, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ReservationCoverageGroup - if *v == nil { - sv = &types.ReservationCoverageGroup{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Attributes": - if err := awsAwsjson11_deserializeDocumentAttributes(&sv.Attributes, value); err != nil { - return err - } - - case "Coverage": - if err := awsAwsjson11_deserializeDocumentCoverage(&sv.Coverage, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentReservationCoverageGroups(v *[]types.ReservationCoverageGroup, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.ReservationCoverageGroup - if *v == nil { - cv = []types.ReservationCoverageGroup{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ReservationCoverageGroup - destAddr := &col - if err := awsAwsjson11_deserializeDocumentReservationCoverageGroup(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentReservationPurchaseRecommendation(v **types.ReservationPurchaseRecommendation, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ReservationPurchaseRecommendation - if *v == nil { - sv = &types.ReservationPurchaseRecommendation{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AccountScope": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountScope to be of type string, got %T instead", value) - } - sv.AccountScope = types.AccountScope(jtv) - } - - case "LookbackPeriodInDays": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LookbackPeriodInDays to be of type string, got %T instead", value) - } - sv.LookbackPeriodInDays = types.LookbackPeriodInDays(jtv) - } - - case "PaymentOption": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PaymentOption to be of type string, got %T instead", value) - } - sv.PaymentOption = types.PaymentOption(jtv) - } - - case "RecommendationDetails": - if err := awsAwsjson11_deserializeDocumentReservationPurchaseRecommendationDetails(&sv.RecommendationDetails, value); err != nil { - return err - } - - case "RecommendationSummary": - if err := awsAwsjson11_deserializeDocumentReservationPurchaseRecommendationSummary(&sv.RecommendationSummary, value); err != nil { - return err - } - - case "ServiceSpecification": - if err := awsAwsjson11_deserializeDocumentServiceSpecification(&sv.ServiceSpecification, value); err != nil { - return err - } - - case "TermInYears": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TermInYears to be of type string, got %T instead", value) - } - sv.TermInYears = types.TermInYears(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentReservationPurchaseRecommendationDetail(v **types.ReservationPurchaseRecommendationDetail, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ReservationPurchaseRecommendationDetail - if *v == nil { - sv = &types.ReservationPurchaseRecommendationDetail{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AccountId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.AccountId = ptr.String(jtv) - } - - case "AverageNormalizedUnitsUsedPerHour": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.AverageNormalizedUnitsUsedPerHour = ptr.String(jtv) - } - - case "AverageNumberOfCapacityUnitsUsedPerHour": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.AverageNumberOfCapacityUnitsUsedPerHour = ptr.String(jtv) - } - - case "AverageNumberOfInstancesUsedPerHour": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.AverageNumberOfInstancesUsedPerHour = ptr.String(jtv) - } - - case "AverageUtilization": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.AverageUtilization = ptr.String(jtv) - } - - case "CurrencyCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrencyCode = ptr.String(jtv) - } - - case "EstimatedBreakEvenInMonths": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedBreakEvenInMonths = ptr.String(jtv) - } - - case "EstimatedMonthlyOnDemandCost": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedMonthlyOnDemandCost = ptr.String(jtv) - } - - case "EstimatedMonthlySavingsAmount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedMonthlySavingsAmount = ptr.String(jtv) - } - - case "EstimatedMonthlySavingsPercentage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedMonthlySavingsPercentage = ptr.String(jtv) - } - - case "EstimatedReservationCostForLookbackPeriod": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedReservationCostForLookbackPeriod = ptr.String(jtv) - } - - case "InstanceDetails": - if err := awsAwsjson11_deserializeDocumentInstanceDetails(&sv.InstanceDetails, value); err != nil { - return err - } - - case "MaximumNormalizedUnitsUsedPerHour": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.MaximumNormalizedUnitsUsedPerHour = ptr.String(jtv) - } - - case "MaximumNumberOfCapacityUnitsUsedPerHour": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.MaximumNumberOfCapacityUnitsUsedPerHour = ptr.String(jtv) - } - - case "MaximumNumberOfInstancesUsedPerHour": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.MaximumNumberOfInstancesUsedPerHour = ptr.String(jtv) - } - - case "MinimumNormalizedUnitsUsedPerHour": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.MinimumNormalizedUnitsUsedPerHour = ptr.String(jtv) - } - - case "MinimumNumberOfCapacityUnitsUsedPerHour": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.MinimumNumberOfCapacityUnitsUsedPerHour = ptr.String(jtv) - } - - case "MinimumNumberOfInstancesUsedPerHour": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.MinimumNumberOfInstancesUsedPerHour = ptr.String(jtv) - } - - case "RecommendedNormalizedUnitsToPurchase": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.RecommendedNormalizedUnitsToPurchase = ptr.String(jtv) - } - - case "RecommendedNumberOfCapacityUnitsToPurchase": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.RecommendedNumberOfCapacityUnitsToPurchase = ptr.String(jtv) - } - - case "RecommendedNumberOfInstancesToPurchase": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.RecommendedNumberOfInstancesToPurchase = ptr.String(jtv) - } - - case "RecurringStandardMonthlyCost": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.RecurringStandardMonthlyCost = ptr.String(jtv) - } - - case "ReservedCapacityDetails": - if err := awsAwsjson11_deserializeDocumentReservedCapacityDetails(&sv.ReservedCapacityDetails, value); err != nil { - return err - } - - case "UpfrontCost": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.UpfrontCost = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentReservationPurchaseRecommendationDetails(v *[]types.ReservationPurchaseRecommendationDetail, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.ReservationPurchaseRecommendationDetail - if *v == nil { - cv = []types.ReservationPurchaseRecommendationDetail{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ReservationPurchaseRecommendationDetail - destAddr := &col - if err := awsAwsjson11_deserializeDocumentReservationPurchaseRecommendationDetail(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentReservationPurchaseRecommendationMetadata(v **types.ReservationPurchaseRecommendationMetadata, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ReservationPurchaseRecommendationMetadata - if *v == nil { - sv = &types.ReservationPurchaseRecommendationMetadata{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AdditionalMetadata": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.AdditionalMetadata = ptr.String(jtv) - } - - case "GenerationTimestamp": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.GenerationTimestamp = ptr.String(jtv) - } - - case "RecommendationId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.RecommendationId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentReservationPurchaseRecommendations(v *[]types.ReservationPurchaseRecommendation, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.ReservationPurchaseRecommendation - if *v == nil { - cv = []types.ReservationPurchaseRecommendation{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ReservationPurchaseRecommendation - destAddr := &col - if err := awsAwsjson11_deserializeDocumentReservationPurchaseRecommendation(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentReservationPurchaseRecommendationSummary(v **types.ReservationPurchaseRecommendationSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ReservationPurchaseRecommendationSummary - if *v == nil { - sv = &types.ReservationPurchaseRecommendationSummary{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CurrencyCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrencyCode = ptr.String(jtv) - } - - case "TotalEstimatedMonthlySavingsAmount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.TotalEstimatedMonthlySavingsAmount = ptr.String(jtv) - } - - case "TotalEstimatedMonthlySavingsPercentage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.TotalEstimatedMonthlySavingsPercentage = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentReservationUtilizationGroup(v **types.ReservationUtilizationGroup, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ReservationUtilizationGroup - if *v == nil { - sv = &types.ReservationUtilizationGroup{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Attributes": - if err := awsAwsjson11_deserializeDocumentAttributes(&sv.Attributes, value); err != nil { - return err - } - - case "Key": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ReservationGroupKey to be of type string, got %T instead", value) - } - sv.Key = ptr.String(jtv) - } - - case "Utilization": - if err := awsAwsjson11_deserializeDocumentReservationAggregates(&sv.Utilization, value); err != nil { - return err - } - - case "Value": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ReservationGroupValue to be of type string, got %T instead", value) - } - sv.Value = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentReservationUtilizationGroups(v *[]types.ReservationUtilizationGroup, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.ReservationUtilizationGroup - if *v == nil { - cv = []types.ReservationUtilizationGroup{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ReservationUtilizationGroup - destAddr := &col - if err := awsAwsjson11_deserializeDocumentReservationUtilizationGroup(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentReservedCapacityDetails(v **types.ReservedCapacityDetails, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ReservedCapacityDetails - if *v == nil { - sv = &types.ReservedCapacityDetails{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "DynamoDBCapacityDetails": - if err := awsAwsjson11_deserializeDocumentDynamoDBCapacityDetails(&sv.DynamoDBCapacityDetails, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentResourceDetails(v **types.ResourceDetails, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ResourceDetails - if *v == nil { - sv = &types.ResourceDetails{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "EC2ResourceDetails": - if err := awsAwsjson11_deserializeDocumentEC2ResourceDetails(&sv.EC2ResourceDetails, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ResourceNotFoundException - if *v == nil { - sv = &types.ResourceNotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "ResourceName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.ResourceName = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentResourceTag(v **types.ResourceTag, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ResourceTag - if *v == nil { - sv = &types.ResourceTag{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Key": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourceTagKey to be of type string, got %T instead", value) - } - sv.Key = ptr.String(jtv) - } - - case "Value": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourceTagValue to be of type string, got %T instead", value) - } - sv.Value = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentResourceTagList(v *[]types.ResourceTag, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.ResourceTag - if *v == nil { - cv = []types.ResourceTag{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ResourceTag - destAddr := &col - if err := awsAwsjson11_deserializeDocumentResourceTag(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentResourceTypes(v *[]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []string - if *v == nil { - cv = []string{} - } else { - cv = *v - } - - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) - } - col = jtv - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentResourceUtilization(v **types.ResourceUtilization, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ResourceUtilization - if *v == nil { - sv = &types.ResourceUtilization{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "EC2ResourceUtilization": - if err := awsAwsjson11_deserializeDocumentEC2ResourceUtilization(&sv.EC2ResourceUtilization, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentResultByTime(v **types.ResultByTime, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ResultByTime - if *v == nil { - sv = &types.ResultByTime{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Estimated": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Estimated to be of type *bool, got %T instead", value) - } - sv.Estimated = jtv - } - - case "Groups": - if err := awsAwsjson11_deserializeDocumentGroups(&sv.Groups, value); err != nil { - return err - } - - case "TimePeriod": - if err := awsAwsjson11_deserializeDocumentDateInterval(&sv.TimePeriod, value); err != nil { - return err - } - - case "Total": - if err := awsAwsjson11_deserializeDocumentMetrics(&sv.Total, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentResultsByTime(v *[]types.ResultByTime, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.ResultByTime - if *v == nil { - cv = []types.ResultByTime{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ResultByTime - destAddr := &col - if err := awsAwsjson11_deserializeDocumentResultByTime(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentRightsizingRecommendation(v **types.RightsizingRecommendation, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.RightsizingRecommendation - if *v == nil { - sv = &types.RightsizingRecommendation{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AccountId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.AccountId = ptr.String(jtv) - } - - case "CurrentInstance": - if err := awsAwsjson11_deserializeDocumentCurrentInstance(&sv.CurrentInstance, value); err != nil { - return err - } - - case "FindingReasonCodes": - if err := awsAwsjson11_deserializeDocumentFindingReasonCodes(&sv.FindingReasonCodes, value); err != nil { - return err - } - - case "ModifyRecommendationDetail": - if err := awsAwsjson11_deserializeDocumentModifyRecommendationDetail(&sv.ModifyRecommendationDetail, value); err != nil { - return err - } - - case "RightsizingType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RightsizingType to be of type string, got %T instead", value) - } - sv.RightsizingType = types.RightsizingType(jtv) - } - - case "TerminateRecommendationDetail": - if err := awsAwsjson11_deserializeDocumentTerminateRecommendationDetail(&sv.TerminateRecommendationDetail, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentRightsizingRecommendationConfiguration(v **types.RightsizingRecommendationConfiguration, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.RightsizingRecommendationConfiguration - if *v == nil { - sv = &types.RightsizingRecommendationConfiguration{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "BenefitsConsidered": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected GenericBoolean to be of type *bool, got %T instead", value) - } - sv.BenefitsConsidered = jtv - } - - case "RecommendationTarget": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RecommendationTarget to be of type string, got %T instead", value) - } - sv.RecommendationTarget = types.RecommendationTarget(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentRightsizingRecommendationList(v *[]types.RightsizingRecommendation, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.RightsizingRecommendation - if *v == nil { - cv = []types.RightsizingRecommendation{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.RightsizingRecommendation - destAddr := &col - if err := awsAwsjson11_deserializeDocumentRightsizingRecommendation(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentRightsizingRecommendationMetadata(v **types.RightsizingRecommendationMetadata, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.RightsizingRecommendationMetadata - if *v == nil { - sv = &types.RightsizingRecommendationMetadata{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AdditionalMetadata": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.AdditionalMetadata = ptr.String(jtv) - } - - case "GenerationTimestamp": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.GenerationTimestamp = ptr.String(jtv) - } - - case "LookbackPeriodInDays": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LookbackPeriodInDays to be of type string, got %T instead", value) - } - sv.LookbackPeriodInDays = types.LookbackPeriodInDays(jtv) - } - - case "RecommendationId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.RecommendationId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentRightsizingRecommendationSummary(v **types.RightsizingRecommendationSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.RightsizingRecommendationSummary - if *v == nil { - sv = &types.RightsizingRecommendationSummary{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "EstimatedTotalMonthlySavingsAmount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedTotalMonthlySavingsAmount = ptr.String(jtv) - } - - case "SavingsCurrencyCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.SavingsCurrencyCode = ptr.String(jtv) - } - - case "SavingsPercentage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.SavingsPercentage = ptr.String(jtv) - } - - case "TotalRecommendationCount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.TotalRecommendationCount = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentRootCause(v **types.RootCause, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.RootCause - if *v == nil { - sv = &types.RootCause{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Impact": - if err := awsAwsjson11_deserializeDocumentRootCauseImpact(&sv.Impact, value); err != nil { - return err - } - - case "LinkedAccount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.LinkedAccount = ptr.String(jtv) - } - - case "LinkedAccountName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.LinkedAccountName = ptr.String(jtv) - } - - case "Region": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Region = ptr.String(jtv) - } - - case "Service": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Service = ptr.String(jtv) - } - - case "UsageType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.UsageType = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentRootCauseImpact(v **types.RootCauseImpact, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.RootCauseImpact - if *v == nil { - sv = &types.RootCauseImpact{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Contribution": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.Contribution = f64 - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.Contribution = f64 - - default: - return fmt.Errorf("expected GenericDouble to be a JSON Number, got %T instead", value) - - } - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentRootCauses(v *[]types.RootCause, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.RootCause - if *v == nil { - cv = []types.RootCause{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.RootCause - destAddr := &col - if err := awsAwsjson11_deserializeDocumentRootCause(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlans(v **types.SavingsPlans, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.SavingsPlans - if *v == nil { - sv = &types.SavingsPlans{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "InstanceFamily": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.InstanceFamily = ptr.String(jtv) - } - - case "OfferingId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.OfferingId = ptr.String(jtv) - } - - case "PaymentOption": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PaymentOption to be of type string, got %T instead", value) - } - sv.PaymentOption = types.PaymentOption(jtv) - } - - case "Region": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Region = ptr.String(jtv) - } - - case "SavingsPlansCommitment": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.SavingsPlansCommitment = ptr.Float64(f64) - - case string: - var f64 float64 - switch { - case strings.EqualFold(jtv, "NaN"): - f64 = math.NaN() - - case strings.EqualFold(jtv, "Infinity"): - f64 = math.Inf(1) - - case strings.EqualFold(jtv, "-Infinity"): - f64 = math.Inf(-1) - - default: - return fmt.Errorf("unknown JSON number value: %s", jtv) - - } - sv.SavingsPlansCommitment = ptr.Float64(f64) - - default: - return fmt.Errorf("expected SavingsPlansCommitment to be a JSON Number, got %T instead", value) - - } - } - - case "SavingsPlansType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SupportedSavingsPlansType to be of type string, got %T instead", value) - } - sv.SavingsPlansType = types.SupportedSavingsPlansType(jtv) - } - - case "TermInYears": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TermInYears to be of type string, got %T instead", value) - } - sv.TermInYears = types.TermInYears(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansAmortizedCommitment(v **types.SavingsPlansAmortizedCommitment, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.SavingsPlansAmortizedCommitment - if *v == nil { - sv = &types.SavingsPlansAmortizedCommitment{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AmortizedRecurringCommitment": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.AmortizedRecurringCommitment = ptr.String(jtv) - } - - case "AmortizedUpfrontCommitment": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.AmortizedUpfrontCommitment = ptr.String(jtv) - } - - case "TotalAmortizedCommitment": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.TotalAmortizedCommitment = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansCoverage(v **types.SavingsPlansCoverage, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.SavingsPlansCoverage - if *v == nil { - sv = &types.SavingsPlansCoverage{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Attributes": - if err := awsAwsjson11_deserializeDocumentAttributes(&sv.Attributes, value); err != nil { - return err - } - - case "Coverage": - if err := awsAwsjson11_deserializeDocumentSavingsPlansCoverageData(&sv.Coverage, value); err != nil { - return err - } - - case "TimePeriod": - if err := awsAwsjson11_deserializeDocumentDateInterval(&sv.TimePeriod, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansCoverageData(v **types.SavingsPlansCoverageData, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.SavingsPlansCoverageData - if *v == nil { - sv = &types.SavingsPlansCoverageData{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CoveragePercentage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CoveragePercentage = ptr.String(jtv) - } - - case "OnDemandCost": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.OnDemandCost = ptr.String(jtv) - } - - case "SpendCoveredBySavingsPlans": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.SpendCoveredBySavingsPlans = ptr.String(jtv) - } - - case "TotalCost": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.TotalCost = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansCoverages(v *[]types.SavingsPlansCoverage, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.SavingsPlansCoverage - if *v == nil { - cv = []types.SavingsPlansCoverage{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.SavingsPlansCoverage - destAddr := &col - if err := awsAwsjson11_deserializeDocumentSavingsPlansCoverage(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansDetails(v **types.SavingsPlansDetails, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.SavingsPlansDetails - if *v == nil { - sv = &types.SavingsPlansDetails{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "InstanceFamily": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.InstanceFamily = ptr.String(jtv) - } - - case "OfferingId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.OfferingId = ptr.String(jtv) - } - - case "Region": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Region = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansPurchaseAnalysisConfiguration(v **types.SavingsPlansPurchaseAnalysisConfiguration, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.SavingsPlansPurchaseAnalysisConfiguration - if *v == nil { - sv = &types.SavingsPlansPurchaseAnalysisConfiguration{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AccountId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) - } - sv.AccountId = ptr.String(jtv) - } - - case "AccountScope": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountScope to be of type string, got %T instead", value) - } - sv.AccountScope = types.AccountScope(jtv) - } - - case "AnalysisType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AnalysisType to be of type string, got %T instead", value) - } - sv.AnalysisType = types.AnalysisType(jtv) - } - - case "LookBackTimePeriod": - if err := awsAwsjson11_deserializeDocumentDateInterval(&sv.LookBackTimePeriod, value); err != nil { - return err - } - - case "SavingsPlansToAdd": - if err := awsAwsjson11_deserializeDocumentSavingsPlansToAdd(&sv.SavingsPlansToAdd, value); err != nil { - return err - } - - case "SavingsPlansToExclude": - if err := awsAwsjson11_deserializeDocumentSavingsPlansToExclude(&sv.SavingsPlansToExclude, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansPurchaseAnalysisDetails(v **types.SavingsPlansPurchaseAnalysisDetails, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.SavingsPlansPurchaseAnalysisDetails - if *v == nil { - sv = &types.SavingsPlansPurchaseAnalysisDetails{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AdditionalMetadata": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.AdditionalMetadata = ptr.String(jtv) - } - - case "CurrencyCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrencyCode = ptr.String(jtv) - } - - case "CurrentAverageCoverage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrentAverageCoverage = ptr.String(jtv) - } - - case "CurrentAverageHourlyOnDemandSpend": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrentAverageHourlyOnDemandSpend = ptr.String(jtv) - } - - case "CurrentMaximumHourlyOnDemandSpend": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrentMaximumHourlyOnDemandSpend = ptr.String(jtv) - } - - case "CurrentMinimumHourlyOnDemandSpend": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrentMinimumHourlyOnDemandSpend = ptr.String(jtv) - } - - case "CurrentOnDemandSpend": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrentOnDemandSpend = ptr.String(jtv) - } - - case "EstimatedAverageCoverage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedAverageCoverage = ptr.String(jtv) - } - - case "EstimatedAverageUtilization": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedAverageUtilization = ptr.String(jtv) - } - - case "EstimatedCommitmentCost": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedCommitmentCost = ptr.String(jtv) - } - - case "EstimatedMonthlySavingsAmount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedMonthlySavingsAmount = ptr.String(jtv) - } - - case "EstimatedOnDemandCost": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedOnDemandCost = ptr.String(jtv) - } - - case "EstimatedOnDemandCostWithCurrentCommitment": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedOnDemandCostWithCurrentCommitment = ptr.String(jtv) - } - - case "EstimatedROI": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedROI = ptr.String(jtv) - } - - case "EstimatedSavingsAmount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedSavingsAmount = ptr.String(jtv) - } - - case "EstimatedSavingsPercentage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedSavingsPercentage = ptr.String(jtv) - } - - case "ExistingHourlyCommitment": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.ExistingHourlyCommitment = ptr.String(jtv) - } - - case "HourlyCommitmentToPurchase": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.HourlyCommitmentToPurchase = ptr.String(jtv) - } - - case "LatestUsageTimestamp": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.LatestUsageTimestamp = ptr.String(jtv) - } - - case "LookbackPeriodInHours": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.LookbackPeriodInHours = ptr.String(jtv) - } - - case "MetricsOverLookbackPeriod": - if err := awsAwsjson11_deserializeDocumentMetricsOverLookbackPeriod(&sv.MetricsOverLookbackPeriod, value); err != nil { - return err - } - - case "UpfrontCost": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.UpfrontCost = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansPurchaseRecommendation(v **types.SavingsPlansPurchaseRecommendation, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.SavingsPlansPurchaseRecommendation - if *v == nil { - sv = &types.SavingsPlansPurchaseRecommendation{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AccountScope": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountScope to be of type string, got %T instead", value) - } - sv.AccountScope = types.AccountScope(jtv) - } - - case "LookbackPeriodInDays": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LookbackPeriodInDays to be of type string, got %T instead", value) - } - sv.LookbackPeriodInDays = types.LookbackPeriodInDays(jtv) - } - - case "PaymentOption": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PaymentOption to be of type string, got %T instead", value) - } - sv.PaymentOption = types.PaymentOption(jtv) - } - - case "SavingsPlansPurchaseRecommendationDetails": - if err := awsAwsjson11_deserializeDocumentSavingsPlansPurchaseRecommendationDetailList(&sv.SavingsPlansPurchaseRecommendationDetails, value); err != nil { - return err - } - - case "SavingsPlansPurchaseRecommendationSummary": - if err := awsAwsjson11_deserializeDocumentSavingsPlansPurchaseRecommendationSummary(&sv.SavingsPlansPurchaseRecommendationSummary, value); err != nil { - return err - } - - case "SavingsPlansType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SupportedSavingsPlansType to be of type string, got %T instead", value) - } - sv.SavingsPlansType = types.SupportedSavingsPlansType(jtv) - } - - case "TermInYears": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TermInYears to be of type string, got %T instead", value) - } - sv.TermInYears = types.TermInYears(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansPurchaseRecommendationDetail(v **types.SavingsPlansPurchaseRecommendationDetail, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.SavingsPlansPurchaseRecommendationDetail - if *v == nil { - sv = &types.SavingsPlansPurchaseRecommendationDetail{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AccountId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.AccountId = ptr.String(jtv) - } - - case "CurrencyCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrencyCode = ptr.String(jtv) - } - - case "CurrentAverageHourlyOnDemandSpend": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrentAverageHourlyOnDemandSpend = ptr.String(jtv) - } - - case "CurrentMaximumHourlyOnDemandSpend": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrentMaximumHourlyOnDemandSpend = ptr.String(jtv) - } - - case "CurrentMinimumHourlyOnDemandSpend": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrentMinimumHourlyOnDemandSpend = ptr.String(jtv) - } - - case "EstimatedAverageUtilization": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedAverageUtilization = ptr.String(jtv) - } - - case "EstimatedMonthlySavingsAmount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedMonthlySavingsAmount = ptr.String(jtv) - } - - case "EstimatedOnDemandCost": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedOnDemandCost = ptr.String(jtv) - } - - case "EstimatedOnDemandCostWithCurrentCommitment": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedOnDemandCostWithCurrentCommitment = ptr.String(jtv) - } - - case "EstimatedROI": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedROI = ptr.String(jtv) - } - - case "EstimatedSavingsAmount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedSavingsAmount = ptr.String(jtv) - } - - case "EstimatedSavingsPercentage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedSavingsPercentage = ptr.String(jtv) - } - - case "EstimatedSPCost": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedSPCost = ptr.String(jtv) - } - - case "HourlyCommitmentToPurchase": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.HourlyCommitmentToPurchase = ptr.String(jtv) - } - - case "RecommendationDetailId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RecommendationDetailId to be of type string, got %T instead", value) - } - sv.RecommendationDetailId = ptr.String(jtv) - } - - case "SavingsPlansDetails": - if err := awsAwsjson11_deserializeDocumentSavingsPlansDetails(&sv.SavingsPlansDetails, value); err != nil { - return err - } - - case "UpfrontCost": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.UpfrontCost = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansPurchaseRecommendationDetailList(v *[]types.SavingsPlansPurchaseRecommendationDetail, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.SavingsPlansPurchaseRecommendationDetail - if *v == nil { - cv = []types.SavingsPlansPurchaseRecommendationDetail{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.SavingsPlansPurchaseRecommendationDetail - destAddr := &col - if err := awsAwsjson11_deserializeDocumentSavingsPlansPurchaseRecommendationDetail(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansPurchaseRecommendationMetadata(v **types.SavingsPlansPurchaseRecommendationMetadata, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.SavingsPlansPurchaseRecommendationMetadata - if *v == nil { - sv = &types.SavingsPlansPurchaseRecommendationMetadata{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AdditionalMetadata": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.AdditionalMetadata = ptr.String(jtv) - } - - case "GenerationTimestamp": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.GenerationTimestamp = ptr.String(jtv) - } - - case "RecommendationId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.RecommendationId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansPurchaseRecommendationSummary(v **types.SavingsPlansPurchaseRecommendationSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.SavingsPlansPurchaseRecommendationSummary - if *v == nil { - sv = &types.SavingsPlansPurchaseRecommendationSummary{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CurrencyCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrencyCode = ptr.String(jtv) - } - - case "CurrentOnDemandSpend": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrentOnDemandSpend = ptr.String(jtv) - } - - case "DailyCommitmentToPurchase": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.DailyCommitmentToPurchase = ptr.String(jtv) - } - - case "EstimatedMonthlySavingsAmount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedMonthlySavingsAmount = ptr.String(jtv) - } - - case "EstimatedOnDemandCostWithCurrentCommitment": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedOnDemandCostWithCurrentCommitment = ptr.String(jtv) - } - - case "EstimatedROI": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedROI = ptr.String(jtv) - } - - case "EstimatedSavingsAmount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedSavingsAmount = ptr.String(jtv) - } - - case "EstimatedSavingsPercentage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedSavingsPercentage = ptr.String(jtv) - } - - case "EstimatedTotalCost": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedTotalCost = ptr.String(jtv) - } - - case "HourlyCommitmentToPurchase": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.HourlyCommitmentToPurchase = ptr.String(jtv) - } - - case "TotalRecommendationCount": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.TotalRecommendationCount = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansSavings(v **types.SavingsPlansSavings, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.SavingsPlansSavings - if *v == nil { - sv = &types.SavingsPlansSavings{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "NetSavings": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.NetSavings = ptr.String(jtv) - } - - case "OnDemandCostEquivalent": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.OnDemandCostEquivalent = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansToAdd(v *[]types.SavingsPlans, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.SavingsPlans - if *v == nil { - cv = []types.SavingsPlans{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.SavingsPlans - destAddr := &col - if err := awsAwsjson11_deserializeDocumentSavingsPlans(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansToExclude(v *[]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []string - if *v == nil { - cv = []string{} - } else { - cv = *v - } - - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SavingsPlansId to be of type string, got %T instead", value) - } - col = jtv - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansUtilization(v **types.SavingsPlansUtilization, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.SavingsPlansUtilization - if *v == nil { - sv = &types.SavingsPlansUtilization{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "TotalCommitment": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.TotalCommitment = ptr.String(jtv) - } - - case "UnusedCommitment": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.UnusedCommitment = ptr.String(jtv) - } - - case "UsedCommitment": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.UsedCommitment = ptr.String(jtv) - } - - case "UtilizationPercentage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.UtilizationPercentage = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansUtilizationAggregates(v **types.SavingsPlansUtilizationAggregates, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.SavingsPlansUtilizationAggregates - if *v == nil { - sv = &types.SavingsPlansUtilizationAggregates{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AmortizedCommitment": - if err := awsAwsjson11_deserializeDocumentSavingsPlansAmortizedCommitment(&sv.AmortizedCommitment, value); err != nil { - return err - } - - case "Savings": - if err := awsAwsjson11_deserializeDocumentSavingsPlansSavings(&sv.Savings, value); err != nil { - return err - } - - case "Utilization": - if err := awsAwsjson11_deserializeDocumentSavingsPlansUtilization(&sv.Utilization, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansUtilizationByTime(v **types.SavingsPlansUtilizationByTime, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.SavingsPlansUtilizationByTime - if *v == nil { - sv = &types.SavingsPlansUtilizationByTime{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AmortizedCommitment": - if err := awsAwsjson11_deserializeDocumentSavingsPlansAmortizedCommitment(&sv.AmortizedCommitment, value); err != nil { - return err - } - - case "Savings": - if err := awsAwsjson11_deserializeDocumentSavingsPlansSavings(&sv.Savings, value); err != nil { - return err - } - - case "TimePeriod": - if err := awsAwsjson11_deserializeDocumentDateInterval(&sv.TimePeriod, value); err != nil { - return err - } - - case "Utilization": - if err := awsAwsjson11_deserializeDocumentSavingsPlansUtilization(&sv.Utilization, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansUtilizationDetail(v **types.SavingsPlansUtilizationDetail, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.SavingsPlansUtilizationDetail - if *v == nil { - sv = &types.SavingsPlansUtilizationDetail{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AmortizedCommitment": - if err := awsAwsjson11_deserializeDocumentSavingsPlansAmortizedCommitment(&sv.AmortizedCommitment, value); err != nil { - return err - } - - case "Attributes": - if err := awsAwsjson11_deserializeDocumentAttributes(&sv.Attributes, value); err != nil { - return err - } - - case "Savings": - if err := awsAwsjson11_deserializeDocumentSavingsPlansSavings(&sv.Savings, value); err != nil { - return err - } - - case "SavingsPlanArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SavingsPlanArn to be of type string, got %T instead", value) - } - sv.SavingsPlanArn = ptr.String(jtv) - } - - case "Utilization": - if err := awsAwsjson11_deserializeDocumentSavingsPlansUtilization(&sv.Utilization, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansUtilizationDetails(v *[]types.SavingsPlansUtilizationDetail, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.SavingsPlansUtilizationDetail - if *v == nil { - cv = []types.SavingsPlansUtilizationDetail{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.SavingsPlansUtilizationDetail - destAddr := &col - if err := awsAwsjson11_deserializeDocumentSavingsPlansUtilizationDetail(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentSavingsPlansUtilizationsByTime(v *[]types.SavingsPlansUtilizationByTime, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.SavingsPlansUtilizationByTime - if *v == nil { - cv = []types.SavingsPlansUtilizationByTime{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.SavingsPlansUtilizationByTime - destAddr := &col - if err := awsAwsjson11_deserializeDocumentSavingsPlansUtilizationByTime(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ServiceQuotaExceededException - if *v == nil { - sv = &types.ServiceQuotaExceededException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentServiceSpecification(v **types.ServiceSpecification, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ServiceSpecification - if *v == nil { - sv = &types.ServiceSpecification{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "EC2Specification": - if err := awsAwsjson11_deserializeDocumentEC2Specification(&sv.EC2Specification, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentSubscriber(v **types.Subscriber, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Subscriber - if *v == nil { - sv = &types.Subscriber{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Address": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SubscriberAddress to be of type string, got %T instead", value) - } - sv.Address = ptr.String(jtv) - } - - case "Status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SubscriberStatus to be of type string, got %T instead", value) - } - sv.Status = types.SubscriberStatus(jtv) - } - - case "Type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SubscriberType to be of type string, got %T instead", value) - } - sv.Type = types.SubscriberType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentSubscribers(v *[]types.Subscriber, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.Subscriber - if *v == nil { - cv = []types.Subscriber{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.Subscriber - destAddr := &col - if err := awsAwsjson11_deserializeDocumentSubscriber(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentTagList(v *[]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []string - if *v == nil { - cv = []string{} - } else { - cv = *v - } - - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Entity to be of type string, got %T instead", value) - } - col = jtv - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentTagValues(v **types.TagValues, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.TagValues - if *v == nil { - sv = &types.TagValues{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Key": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) - } - sv.Key = ptr.String(jtv) - } - - case "MatchOptions": - if err := awsAwsjson11_deserializeDocumentMatchOptions(&sv.MatchOptions, value); err != nil { - return err - } - - case "Values": - if err := awsAwsjson11_deserializeDocumentValues(&sv.Values, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentTagValuesList(v *[]types.TagValues, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.TagValues - if *v == nil { - cv = []types.TagValues{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.TagValues - destAddr := &col - if err := awsAwsjson11_deserializeDocumentTagValues(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentTargetInstance(v **types.TargetInstance, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.TargetInstance - if *v == nil { - sv = &types.TargetInstance{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CurrencyCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrencyCode = ptr.String(jtv) - } - - case "DefaultTargetInstance": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected GenericBoolean to be of type *bool, got %T instead", value) - } - sv.DefaultTargetInstance = jtv - } - - case "EstimatedMonthlyCost": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedMonthlyCost = ptr.String(jtv) - } - - case "EstimatedMonthlySavings": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedMonthlySavings = ptr.String(jtv) - } - - case "ExpectedResourceUtilization": - if err := awsAwsjson11_deserializeDocumentResourceUtilization(&sv.ExpectedResourceUtilization, value); err != nil { - return err - } - - case "PlatformDifferences": - if err := awsAwsjson11_deserializeDocumentPlatformDifferences(&sv.PlatformDifferences, value); err != nil { - return err - } - - case "ResourceDetails": - if err := awsAwsjson11_deserializeDocumentResourceDetails(&sv.ResourceDetails, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentTargetInstancesList(v *[]types.TargetInstance, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.TargetInstance - if *v == nil { - cv = []types.TargetInstance{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.TargetInstance - destAddr := &col - if err := awsAwsjson11_deserializeDocumentTargetInstance(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentTerminateRecommendationDetail(v **types.TerminateRecommendationDetail, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.TerminateRecommendationDetail - if *v == nil { - sv = &types.TerminateRecommendationDetail{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CurrencyCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.CurrencyCode = ptr.String(jtv) - } - - case "EstimatedMonthlySavings": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.EstimatedMonthlySavings = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.TooManyTagsException - if *v == nil { - sv = &types.TooManyTagsException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "ResourceName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.ResourceName = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentUnknownMonitorException(v **types.UnknownMonitorException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.UnknownMonitorException - if *v == nil { - sv = &types.UnknownMonitorException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentUnknownSubscriptionException(v **types.UnknownSubscriptionException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.UnknownSubscriptionException - if *v == nil { - sv = &types.UnknownSubscriptionException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentUnresolvableUsageUnitException(v **types.UnresolvableUsageUnitException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.UnresolvableUsageUnitException - if *v == nil { - sv = &types.UnresolvableUsageUnitException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentUpdateCostAllocationTagsStatusError(v **types.UpdateCostAllocationTagsStatusError, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.UpdateCostAllocationTagsStatusError - if *v == nil { - sv = &types.UpdateCostAllocationTagsStatusError{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Code": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.Code = ptr.String(jtv) - } - - case "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "TagKey": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) - } - sv.TagKey = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentUpdateCostAllocationTagsStatusErrors(v *[]types.UpdateCostAllocationTagsStatusError, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.UpdateCostAllocationTagsStatusError - if *v == nil { - cv = []types.UpdateCostAllocationTagsStatusError{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.UpdateCostAllocationTagsStatusError - destAddr := &col - if err := awsAwsjson11_deserializeDocumentUpdateCostAllocationTagsStatusError(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentUtilizationByTime(v **types.UtilizationByTime, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.UtilizationByTime - if *v == nil { - sv = &types.UtilizationByTime{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Groups": - if err := awsAwsjson11_deserializeDocumentReservationUtilizationGroups(&sv.Groups, value); err != nil { - return err - } - - case "TimePeriod": - if err := awsAwsjson11_deserializeDocumentDateInterval(&sv.TimePeriod, value); err != nil { - return err - } - - case "Total": - if err := awsAwsjson11_deserializeDocumentReservationAggregates(&sv.Total, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentUtilizationsByTime(v *[]types.UtilizationByTime, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.UtilizationByTime - if *v == nil { - cv = []types.UtilizationByTime{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.UtilizationByTime - destAddr := &col - if err := awsAwsjson11_deserializeDocumentUtilizationByTime(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentValues(v *[]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []string - if *v == nil { - cv = []string{} - } else { - cv = *v - } - - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Value to be of type string, got %T instead", value) - } - col = jtv - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeOpDocumentCreateAnomalyMonitorOutput(v **CreateAnomalyMonitorOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *CreateAnomalyMonitorOutput - if *v == nil { - sv = &CreateAnomalyMonitorOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "MonitorArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.MonitorArn = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentCreateAnomalySubscriptionOutput(v **CreateAnomalySubscriptionOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *CreateAnomalySubscriptionOutput - if *v == nil { - sv = &CreateAnomalySubscriptionOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "SubscriptionArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.SubscriptionArn = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentCreateCostCategoryDefinitionOutput(v **CreateCostCategoryDefinitionOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *CreateCostCategoryDefinitionOutput - if *v == nil { - sv = &CreateCostCategoryDefinitionOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CostCategoryArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.CostCategoryArn = ptr.String(jtv) - } - - case "EffectiveStart": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.EffectiveStart = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentDeleteAnomalyMonitorOutput(v **DeleteAnomalyMonitorOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DeleteAnomalyMonitorOutput - if *v == nil { - sv = &DeleteAnomalyMonitorOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentDeleteAnomalySubscriptionOutput(v **DeleteAnomalySubscriptionOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DeleteAnomalySubscriptionOutput - if *v == nil { - sv = &DeleteAnomalySubscriptionOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentDeleteCostCategoryDefinitionOutput(v **DeleteCostCategoryDefinitionOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DeleteCostCategoryDefinitionOutput - if *v == nil { - sv = &DeleteCostCategoryDefinitionOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CostCategoryArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.CostCategoryArn = ptr.String(jtv) - } - - case "EffectiveEnd": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.EffectiveEnd = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentDescribeCostCategoryDefinitionOutput(v **DescribeCostCategoryDefinitionOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeCostCategoryDefinitionOutput - if *v == nil { - sv = &DescribeCostCategoryDefinitionOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CostCategory": - if err := awsAwsjson11_deserializeDocumentCostCategory(&sv.CostCategory, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetAnomaliesOutput(v **GetAnomaliesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetAnomaliesOutput - if *v == nil { - sv = &GetAnomaliesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Anomalies": - if err := awsAwsjson11_deserializeDocumentAnomalies(&sv.Anomalies, value); err != nil { - return err - } - - case "NextPageToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextPageToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetAnomalyMonitorsOutput(v **GetAnomalyMonitorsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetAnomalyMonitorsOutput - if *v == nil { - sv = &GetAnomalyMonitorsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AnomalyMonitors": - if err := awsAwsjson11_deserializeDocumentAnomalyMonitors(&sv.AnomalyMonitors, value); err != nil { - return err - } - - case "NextPageToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextPageToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetAnomalySubscriptionsOutput(v **GetAnomalySubscriptionsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetAnomalySubscriptionsOutput - if *v == nil { - sv = &GetAnomalySubscriptionsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AnomalySubscriptions": - if err := awsAwsjson11_deserializeDocumentAnomalySubscriptions(&sv.AnomalySubscriptions, value); err != nil { - return err - } - - case "NextPageToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextPageToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetApproximateUsageRecordsOutput(v **GetApproximateUsageRecordsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetApproximateUsageRecordsOutput - if *v == nil { - sv = &GetApproximateUsageRecordsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "LookbackPeriod": - if err := awsAwsjson11_deserializeDocumentDateInterval(&sv.LookbackPeriod, value); err != nil { - return err - } - - case "Services": - if err := awsAwsjson11_deserializeDocumentApproximateUsageRecordsPerService(&sv.Services, value); err != nil { - return err - } - - case "TotalRecords": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected NonNegativeLong to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.TotalRecords = i64 - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetCommitmentPurchaseAnalysisOutput(v **GetCommitmentPurchaseAnalysisOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetCommitmentPurchaseAnalysisOutput - if *v == nil { - sv = &GetCommitmentPurchaseAnalysisOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AnalysisCompletionTime": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.AnalysisCompletionTime = ptr.String(jtv) - } - - case "AnalysisDetails": - if err := awsAwsjson11_deserializeDocumentAnalysisDetails(&sv.AnalysisDetails, value); err != nil { - return err - } - - case "AnalysisId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AnalysisId to be of type string, got %T instead", value) - } - sv.AnalysisId = ptr.String(jtv) - } - - case "AnalysisStartedTime": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.AnalysisStartedTime = ptr.String(jtv) - } - - case "AnalysisStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AnalysisStatus to be of type string, got %T instead", value) - } - sv.AnalysisStatus = types.AnalysisStatus(jtv) - } - - case "CommitmentPurchaseAnalysisConfiguration": - if err := awsAwsjson11_deserializeDocumentCommitmentPurchaseAnalysisConfiguration(&sv.CommitmentPurchaseAnalysisConfiguration, value); err != nil { - return err - } - - case "ErrorCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) - } - sv.ErrorCode = types.ErrorCode(jtv) - } - - case "EstimatedCompletionTime": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.EstimatedCompletionTime = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetCostAndUsageComparisonsOutput(v **GetCostAndUsageComparisonsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetCostAndUsageComparisonsOutput - if *v == nil { - sv = &GetCostAndUsageComparisonsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CostAndUsageComparisons": - if err := awsAwsjson11_deserializeDocumentCostAndUsageComparisons(&sv.CostAndUsageComparisons, value); err != nil { - return err - } - - case "NextPageToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextPageToken = ptr.String(jtv) - } - - case "TotalCostAndUsage": - if err := awsAwsjson11_deserializeDocumentComparisonMetrics(&sv.TotalCostAndUsage, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetCostAndUsageOutput(v **GetCostAndUsageOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetCostAndUsageOutput - if *v == nil { - sv = &GetCostAndUsageOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "DimensionValueAttributes": - if err := awsAwsjson11_deserializeDocumentDimensionValuesWithAttributesList(&sv.DimensionValueAttributes, value); err != nil { - return err - } - - case "GroupDefinitions": - if err := awsAwsjson11_deserializeDocumentGroupDefinitions(&sv.GroupDefinitions, value); err != nil { - return err - } - - case "NextPageToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextPageToken = ptr.String(jtv) - } - - case "ResultsByTime": - if err := awsAwsjson11_deserializeDocumentResultsByTime(&sv.ResultsByTime, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetCostAndUsageWithResourcesOutput(v **GetCostAndUsageWithResourcesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetCostAndUsageWithResourcesOutput - if *v == nil { - sv = &GetCostAndUsageWithResourcesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "DimensionValueAttributes": - if err := awsAwsjson11_deserializeDocumentDimensionValuesWithAttributesList(&sv.DimensionValueAttributes, value); err != nil { - return err - } - - case "GroupDefinitions": - if err := awsAwsjson11_deserializeDocumentGroupDefinitions(&sv.GroupDefinitions, value); err != nil { - return err - } - - case "NextPageToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextPageToken = ptr.String(jtv) - } - - case "ResultsByTime": - if err := awsAwsjson11_deserializeDocumentResultsByTime(&sv.ResultsByTime, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetCostCategoriesOutput(v **GetCostCategoriesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetCostCategoriesOutput - if *v == nil { - sv = &GetCostCategoriesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CostCategoryNames": - if err := awsAwsjson11_deserializeDocumentCostCategoryNamesList(&sv.CostCategoryNames, value); err != nil { - return err - } - - case "CostCategoryValues": - if err := awsAwsjson11_deserializeDocumentCostCategoryValuesList(&sv.CostCategoryValues, value); err != nil { - return err - } - - case "NextPageToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextPageToken = ptr.String(jtv) - } - - case "ReturnSize": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected PageSize to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.ReturnSize = ptr.Int32(int32(i64)) - } - - case "TotalSize": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected PageSize to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.TotalSize = ptr.Int32(int32(i64)) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetCostComparisonDriversOutput(v **GetCostComparisonDriversOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetCostComparisonDriversOutput - if *v == nil { - sv = &GetCostComparisonDriversOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CostComparisonDrivers": - if err := awsAwsjson11_deserializeDocumentCostComparisonDrivers(&sv.CostComparisonDrivers, value); err != nil { - return err - } - - case "NextPageToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextPageToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetCostForecastOutput(v **GetCostForecastOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetCostForecastOutput - if *v == nil { - sv = &GetCostForecastOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "ForecastResultsByTime": - if err := awsAwsjson11_deserializeDocumentForecastResultsByTime(&sv.ForecastResultsByTime, value); err != nil { - return err - } - - case "Total": - if err := awsAwsjson11_deserializeDocumentMetricValue(&sv.Total, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetDimensionValuesOutput(v **GetDimensionValuesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetDimensionValuesOutput - if *v == nil { - sv = &GetDimensionValuesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "DimensionValues": - if err := awsAwsjson11_deserializeDocumentDimensionValuesWithAttributesList(&sv.DimensionValues, value); err != nil { - return err - } - - case "NextPageToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextPageToken = ptr.String(jtv) - } - - case "ReturnSize": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected PageSize to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.ReturnSize = ptr.Int32(int32(i64)) - } - - case "TotalSize": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected PageSize to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.TotalSize = ptr.Int32(int32(i64)) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetReservationCoverageOutput(v **GetReservationCoverageOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetReservationCoverageOutput - if *v == nil { - sv = &GetReservationCoverageOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CoveragesByTime": - if err := awsAwsjson11_deserializeDocumentCoveragesByTime(&sv.CoveragesByTime, value); err != nil { - return err - } - - case "NextPageToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextPageToken = ptr.String(jtv) - } - - case "Total": - if err := awsAwsjson11_deserializeDocumentCoverage(&sv.Total, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetReservationPurchaseRecommendationOutput(v **GetReservationPurchaseRecommendationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetReservationPurchaseRecommendationOutput - if *v == nil { - sv = &GetReservationPurchaseRecommendationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Metadata": - if err := awsAwsjson11_deserializeDocumentReservationPurchaseRecommendationMetadata(&sv.Metadata, value); err != nil { - return err - } - - case "NextPageToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextPageToken = ptr.String(jtv) - } - - case "Recommendations": - if err := awsAwsjson11_deserializeDocumentReservationPurchaseRecommendations(&sv.Recommendations, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetReservationUtilizationOutput(v **GetReservationUtilizationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetReservationUtilizationOutput - if *v == nil { - sv = &GetReservationUtilizationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "NextPageToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextPageToken = ptr.String(jtv) - } - - case "Total": - if err := awsAwsjson11_deserializeDocumentReservationAggregates(&sv.Total, value); err != nil { - return err - } - - case "UtilizationsByTime": - if err := awsAwsjson11_deserializeDocumentUtilizationsByTime(&sv.UtilizationsByTime, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetRightsizingRecommendationOutput(v **GetRightsizingRecommendationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetRightsizingRecommendationOutput - if *v == nil { - sv = &GetRightsizingRecommendationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Configuration": - if err := awsAwsjson11_deserializeDocumentRightsizingRecommendationConfiguration(&sv.Configuration, value); err != nil { - return err - } - - case "Metadata": - if err := awsAwsjson11_deserializeDocumentRightsizingRecommendationMetadata(&sv.Metadata, value); err != nil { - return err - } - - case "NextPageToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextPageToken = ptr.String(jtv) - } - - case "RightsizingRecommendations": - if err := awsAwsjson11_deserializeDocumentRightsizingRecommendationList(&sv.RightsizingRecommendations, value); err != nil { - return err - } - - case "Summary": - if err := awsAwsjson11_deserializeDocumentRightsizingRecommendationSummary(&sv.Summary, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetSavingsPlanPurchaseRecommendationDetailsOutput(v **GetSavingsPlanPurchaseRecommendationDetailsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetSavingsPlanPurchaseRecommendationDetailsOutput - if *v == nil { - sv = &GetSavingsPlanPurchaseRecommendationDetailsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "RecommendationDetailData": - if err := awsAwsjson11_deserializeDocumentRecommendationDetailData(&sv.RecommendationDetailData, value); err != nil { - return err - } - - case "RecommendationDetailId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RecommendationDetailId to be of type string, got %T instead", value) - } - sv.RecommendationDetailId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetSavingsPlansCoverageOutput(v **GetSavingsPlansCoverageOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetSavingsPlansCoverageOutput - if *v == nil { - sv = &GetSavingsPlansCoverageOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "SavingsPlansCoverages": - if err := awsAwsjson11_deserializeDocumentSavingsPlansCoverages(&sv.SavingsPlansCoverages, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetSavingsPlansPurchaseRecommendationOutput(v **GetSavingsPlansPurchaseRecommendationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetSavingsPlansPurchaseRecommendationOutput - if *v == nil { - sv = &GetSavingsPlansPurchaseRecommendationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Metadata": - if err := awsAwsjson11_deserializeDocumentSavingsPlansPurchaseRecommendationMetadata(&sv.Metadata, value); err != nil { - return err - } - - case "NextPageToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextPageToken = ptr.String(jtv) - } - - case "SavingsPlansPurchaseRecommendation": - if err := awsAwsjson11_deserializeDocumentSavingsPlansPurchaseRecommendation(&sv.SavingsPlansPurchaseRecommendation, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetSavingsPlansUtilizationDetailsOutput(v **GetSavingsPlansUtilizationDetailsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetSavingsPlansUtilizationDetailsOutput - if *v == nil { - sv = &GetSavingsPlansUtilizationDetailsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "SavingsPlansUtilizationDetails": - if err := awsAwsjson11_deserializeDocumentSavingsPlansUtilizationDetails(&sv.SavingsPlansUtilizationDetails, value); err != nil { - return err - } - - case "TimePeriod": - if err := awsAwsjson11_deserializeDocumentDateInterval(&sv.TimePeriod, value); err != nil { - return err - } - - case "Total": - if err := awsAwsjson11_deserializeDocumentSavingsPlansUtilizationAggregates(&sv.Total, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetSavingsPlansUtilizationOutput(v **GetSavingsPlansUtilizationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetSavingsPlansUtilizationOutput - if *v == nil { - sv = &GetSavingsPlansUtilizationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "SavingsPlansUtilizationsByTime": - if err := awsAwsjson11_deserializeDocumentSavingsPlansUtilizationsByTime(&sv.SavingsPlansUtilizationsByTime, value); err != nil { - return err - } - - case "Total": - if err := awsAwsjson11_deserializeDocumentSavingsPlansUtilizationAggregates(&sv.Total, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetTagsOutput(v **GetTagsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetTagsOutput - if *v == nil { - sv = &GetTagsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "NextPageToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextPageToken = ptr.String(jtv) - } - - case "ReturnSize": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected PageSize to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.ReturnSize = ptr.Int32(int32(i64)) - } - - case "Tags": - if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil { - return err - } - - case "TotalSize": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected PageSize to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.TotalSize = ptr.Int32(int32(i64)) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentGetUsageForecastOutput(v **GetUsageForecastOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *GetUsageForecastOutput - if *v == nil { - sv = &GetUsageForecastOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "ForecastResultsByTime": - if err := awsAwsjson11_deserializeDocumentForecastResultsByTime(&sv.ForecastResultsByTime, value); err != nil { - return err - } - - case "Total": - if err := awsAwsjson11_deserializeDocumentMetricValue(&sv.Total, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListCommitmentPurchaseAnalysesOutput(v **ListCommitmentPurchaseAnalysesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListCommitmentPurchaseAnalysesOutput - if *v == nil { - sv = &ListCommitmentPurchaseAnalysesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AnalysisSummaryList": - if err := awsAwsjson11_deserializeDocumentAnalysisSummaryList(&sv.AnalysisSummaryList, value); err != nil { - return err - } - - case "NextPageToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextPageToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListCostAllocationTagBackfillHistoryOutput(v **ListCostAllocationTagBackfillHistoryOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListCostAllocationTagBackfillHistoryOutput - if *v == nil { - sv = &ListCostAllocationTagBackfillHistoryOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "BackfillRequests": - if err := awsAwsjson11_deserializeDocumentCostAllocationTagBackfillRequestList(&sv.BackfillRequests, value); err != nil { - return err - } - - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListCostAllocationTagsOutput(v **ListCostAllocationTagsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListCostAllocationTagsOutput - if *v == nil { - sv = &ListCostAllocationTagsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CostAllocationTags": - if err := awsAwsjson11_deserializeDocumentCostAllocationTagList(&sv.CostAllocationTags, value); err != nil { - return err - } - - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListCostCategoryDefinitionsOutput(v **ListCostCategoryDefinitionsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListCostCategoryDefinitionsOutput - if *v == nil { - sv = &ListCostCategoryDefinitionsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CostCategoryReferences": - if err := awsAwsjson11_deserializeDocumentCostCategoryReferencesList(&sv.CostCategoryReferences, value); err != nil { - return err - } - - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListCostCategoryResourceAssociationsOutput(v **ListCostCategoryResourceAssociationsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListCostCategoryResourceAssociationsOutput - if *v == nil { - sv = &ListCostCategoryResourceAssociationsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CostCategoryResourceAssociations": - if err := awsAwsjson11_deserializeDocumentCostCategoryResourceAssociations(&sv.CostCategoryResourceAssociations, value); err != nil { - return err - } - - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListSavingsPlansPurchaseRecommendationGenerationOutput(v **ListSavingsPlansPurchaseRecommendationGenerationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListSavingsPlansPurchaseRecommendationGenerationOutput - if *v == nil { - sv = &ListSavingsPlansPurchaseRecommendationGenerationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "GenerationSummaryList": - if err := awsAwsjson11_deserializeDocumentGenerationSummaryList(&sv.GenerationSummaryList, value); err != nil { - return err - } - - case "NextPageToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) - } - sv.NextPageToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListTagsForResourceOutput - if *v == nil { - sv = &ListTagsForResourceOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "ResourceTags": - if err := awsAwsjson11_deserializeDocumentResourceTagList(&sv.ResourceTags, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentProvideAnomalyFeedbackOutput(v **ProvideAnomalyFeedbackOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ProvideAnomalyFeedbackOutput - if *v == nil { - sv = &ProvideAnomalyFeedbackOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AnomalyId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.AnomalyId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentStartCommitmentPurchaseAnalysisOutput(v **StartCommitmentPurchaseAnalysisOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *StartCommitmentPurchaseAnalysisOutput - if *v == nil { - sv = &StartCommitmentPurchaseAnalysisOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AnalysisId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AnalysisId to be of type string, got %T instead", value) - } - sv.AnalysisId = ptr.String(jtv) - } - - case "AnalysisStartedTime": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.AnalysisStartedTime = ptr.String(jtv) - } - - case "EstimatedCompletionTime": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.EstimatedCompletionTime = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentStartCostAllocationTagBackfillOutput(v **StartCostAllocationTagBackfillOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *StartCostAllocationTagBackfillOutput - if *v == nil { - sv = &StartCostAllocationTagBackfillOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "BackfillRequest": - if err := awsAwsjson11_deserializeDocumentCostAllocationTagBackfillRequest(&sv.BackfillRequest, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentStartSavingsPlansPurchaseRecommendationGenerationOutput(v **StartSavingsPlansPurchaseRecommendationGenerationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *StartSavingsPlansPurchaseRecommendationGenerationOutput - if *v == nil { - sv = &StartSavingsPlansPurchaseRecommendationGenerationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "EstimatedCompletionTime": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.EstimatedCompletionTime = ptr.String(jtv) - } - - case "GenerationStartedTime": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.GenerationStartedTime = ptr.String(jtv) - } - - case "RecommendationId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RecommendationId to be of type string, got %T instead", value) - } - sv.RecommendationId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *TagResourceOutput - if *v == nil { - sv = &TagResourceOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UntagResourceOutput - if *v == nil { - sv = &UntagResourceOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentUpdateAnomalyMonitorOutput(v **UpdateAnomalyMonitorOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateAnomalyMonitorOutput - if *v == nil { - sv = &UpdateAnomalyMonitorOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "MonitorArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.MonitorArn = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentUpdateAnomalySubscriptionOutput(v **UpdateAnomalySubscriptionOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateAnomalySubscriptionOutput - if *v == nil { - sv = &UpdateAnomalySubscriptionOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "SubscriptionArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) - } - sv.SubscriptionArn = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentUpdateCostAllocationTagsStatusOutput(v **UpdateCostAllocationTagsStatusOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateCostAllocationTagsStatusOutput - if *v == nil { - sv = &UpdateCostAllocationTagsStatusOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Errors": - if err := awsAwsjson11_deserializeDocumentUpdateCostAllocationTagsStatusErrors(&sv.Errors, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentUpdateCostCategoryDefinitionOutput(v **UpdateCostCategoryDefinitionOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateCostCategoryDefinitionOutput - if *v == nil { - sv = &UpdateCostCategoryDefinitionOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CostCategoryArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.CostCategoryArn = ptr.String(jtv) - } - - case "EffectiveStart": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) - } - sv.EffectiveStart = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type protocolErrorInfo struct { - Type string `json:"__type"` - Message string - Code any // nonstandard for awsjson but some services do present the type here -} - -func getProtocolErrorInfo(decoder *json.Decoder) (protocolErrorInfo, error) { - var errInfo protocolErrorInfo - if err := decoder.Decode(&errInfo); err != nil { - if err == io.EOF { - return errInfo, nil - } - return errInfo, err - } - - return errInfo, nil -} - -func resolveProtocolErrorType(headerType string, bodyInfo protocolErrorInfo) (string, bool) { - if len(headerType) != 0 { - return headerType, true - } else if len(bodyInfo.Type) != 0 { - return bodyInfo.Type, true - } else if code, ok := bodyInfo.Code.(string); ok && len(code) != 0 { - return code, true - } - return "", false -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/doc.go deleted file mode 100644 index 3f00e298b6..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/doc.go +++ /dev/null @@ -1,22 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -// Package costexplorer provides the API client, operations, and parameter types -// for AWS Cost Explorer Service. -// -// You can use the Cost Explorer API to programmatically query your cost and usage -// data. You can query for aggregated data such as total monthly costs or total -// daily usage. You can also query for granular data. This might include the number -// of daily write operations for Amazon DynamoDB database tables in your production -// environment. -// -// # Service Endpoint -// -// The Cost Explorer API provides the following endpoint: -// -// - https://ce.us-east-1.amazonaws.com -// -// For information about the costs that are associated with the Cost Explorer API, -// see [Amazon Web Services Cost Management Pricing]. -// -// [Amazon Web Services Cost Management Pricing]: http://aws.amazon.com/aws-cost-management/pricing/ -package costexplorer diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/endpoints.go deleted file mode 100644 index d094c4347e..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/endpoints.go +++ /dev/null @@ -1,860 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "errors" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - "github.com/aws/aws-sdk-go-v2/internal/endpoints" - "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" - internalendpoints "github.com/aws/aws-sdk-go-v2/service/costexplorer/internal/endpoints" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - smithyendpoints "github.com/aws/smithy-go/endpoints" - "github.com/aws/smithy-go/endpoints/private/rulesfn" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/ptr" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" - "net/url" - "os" - "strings" -) - -// EndpointResolverOptions is the service endpoint resolver options -type EndpointResolverOptions = internalendpoints.Options - -// EndpointResolver interface for resolving service endpoints. -type EndpointResolver interface { - ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) -} - -var _ EndpointResolver = &internalendpoints.Resolver{} - -// NewDefaultEndpointResolver constructs a new service endpoint resolver -func NewDefaultEndpointResolver() *internalendpoints.Resolver { - return internalendpoints.New() -} - -// EndpointResolverFunc is a helper utility that wraps a function so it satisfies -// the EndpointResolver interface. This is useful when you want to add additional -// endpoint resolving logic, or stub out specific endpoints with custom values. -type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) - -func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return fn(region, options) -} - -// EndpointResolverFromURL returns an EndpointResolver configured using the -// provided endpoint url. By default, the resolved endpoint resolver uses the -// client region as signing region, and the endpoint source is set to -// EndpointSourceCustom.You can provide functional options to configure endpoint -// values for the resolved endpoint. -func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { - e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} - for _, fn := range optFns { - fn(&e) - } - - return EndpointResolverFunc( - func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { - if len(e.SigningRegion) == 0 { - e.SigningRegion = region - } - return e, nil - }, - ) -} - -type ResolveEndpoint struct { - Resolver EndpointResolver - Options EndpointResolverOptions -} - -func (*ResolveEndpoint) ID() string { - return "ResolveEndpoint" -} - -func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.Resolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - eo := m.Options - eo.Logger = middleware.GetLogger(ctx) - - var endpoint aws.Endpoint - endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) - if err != nil { - nf := (&aws.EndpointNotFoundError{}) - if errors.As(err, &nf) { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) - return next.HandleSerialize(ctx, in) - } - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL, err = url.Parse(endpoint.URL) - if err != nil { - return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) - } - - if len(awsmiddleware.GetSigningName(ctx)) == 0 { - signingName := endpoint.SigningName - if len(signingName) == 0 { - signingName = "ce" - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - } - ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) - ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) - ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) - return next.HandleSerialize(ctx, in) -} -func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { - return stack.Serialize.Insert(&ResolveEndpoint{ - Resolver: o.EndpointResolver, - Options: o.EndpointOptions, - }, "OperationSerializer", middleware.Before) -} - -func removeResolveEndpointMiddleware(stack *middleware.Stack) error { - _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) - return err -} - -type wrappedEndpointResolver struct { - awsResolver aws.EndpointResolverWithOptions -} - -func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return w.awsResolver.ResolveEndpoint(ServiceID, region, options) -} - -type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) - -func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { - return a(service, region) -} - -var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) - -// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. -// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, -// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked -// via its middleware. -// -// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. -func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { - var resolver aws.EndpointResolverWithOptions - - if awsResolverWithOptions != nil { - resolver = awsResolverWithOptions - } else if awsResolver != nil { - resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) - } - - return &wrappedEndpointResolver{ - awsResolver: resolver, - } -} - -func finalizeClientEndpointResolverOptions(options *Options) { - options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() - - if len(options.EndpointOptions.ResolvedRegion) == 0 { - const fipsInfix = "-fips-" - const fipsPrefix = "fips-" - const fipsSuffix = "-fips" - - if strings.Contains(options.Region, fipsInfix) || - strings.Contains(options.Region, fipsPrefix) || - strings.Contains(options.Region, fipsSuffix) { - options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( - options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") - options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled - } - } - -} - -func resolveEndpointResolverV2(options *Options) { - if options.EndpointResolverV2 == nil { - options.EndpointResolverV2 = NewDefaultEndpointResolverV2() - } -} - -func resolveBaseEndpoint(cfg aws.Config, o *Options) { - if cfg.BaseEndpoint != nil { - o.BaseEndpoint = cfg.BaseEndpoint - } - - _, g := os.LookupEnv("AWS_ENDPOINT_URL") - _, s := os.LookupEnv("AWS_ENDPOINT_URL_COST_EXPLORER") - - if g && !s { - return - } - - value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "Cost Explorer", cfg.ConfigSources) - if found && err == nil { - o.BaseEndpoint = &value - } -} - -func bindRegion(region string) (*string, error) { - if region == "" { - return nil, nil - } - if !rulesfn.IsValidHostLabel(region, true) { - return nil, fmt.Errorf("invalid input region %s", region) - } - - return aws.String(endpoints.MapFIPSRegion(region)), nil -} - -// EndpointParameters provides the parameters that influence how endpoints are -// resolved. -type EndpointParameters struct { - // When true, use the dual-stack endpoint. If the configured endpoint does not - // support dual-stack, dispatching the request MAY return an error. - // - // Defaults to - // false if no value is provided. - // - // AWS::UseDualStack - UseDualStack *bool - - // When true, send this request to the FIPS-compliant regional endpoint. If the - // configured endpoint does not have a FIPS compliant endpoint, dispatching the - // request will return an error. - // - // Defaults to false if no value is - // provided. - // - // AWS::UseFIPS - UseFIPS *bool - - // Override the endpoint used to send this request - // - // Parameter is - // required. - // - // SDK::Endpoint - Endpoint *string - - // The AWS region used to dispatch the request. - // - // Parameter is - // required. - // - // AWS::Region - Region *string -} - -// ValidateRequired validates required parameters are set. -func (p EndpointParameters) ValidateRequired() error { - if p.UseDualStack == nil { - return fmt.Errorf("parameter UseDualStack is required") - } - - if p.UseFIPS == nil { - return fmt.Errorf("parameter UseFIPS is required") - } - - return nil -} - -// WithDefaults returns a shallow copy of EndpointParameterswith default values -// applied to members where applicable. -func (p EndpointParameters) WithDefaults() EndpointParameters { - if p.UseDualStack == nil { - p.UseDualStack = ptr.Bool(false) - } - - if p.UseFIPS == nil { - p.UseFIPS = ptr.Bool(false) - } - return p -} - -type stringSlice []string - -func (s stringSlice) Get(i int) *string { - if i < 0 || i >= len(s) { - return nil - } - - v := s[i] - return &v -} - -// EndpointResolverV2 provides the interface for resolving service endpoints. -type EndpointResolverV2 interface { - // ResolveEndpoint attempts to resolve the endpoint with the provided options, - // returning the endpoint if found. Otherwise an error is returned. - ResolveEndpoint(ctx context.Context, params EndpointParameters) ( - smithyendpoints.Endpoint, error, - ) -} - -// resolver provides the implementation for resolving endpoints. -type resolver struct{} - -func NewDefaultEndpointResolverV2() EndpointResolverV2 { - return &resolver{} -} - -// ResolveEndpoint attempts to resolve the endpoint with the provided options, -// returning the endpoint if found. Otherwise an error is returned. -func (r *resolver) ResolveEndpoint( - ctx context.Context, params EndpointParameters, -) ( - endpoint smithyendpoints.Endpoint, err error, -) { - params = params.WithDefaults() - if err = params.ValidateRequired(); err != nil { - return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) - } - _UseDualStack := *params.UseDualStack - _ = _UseDualStack - _UseFIPS := *params.UseFIPS - _ = _UseFIPS - - if exprVal := params.Endpoint; exprVal != nil { - _Endpoint := *exprVal - _ = _Endpoint - if _UseFIPS == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") - } - if _UseDualStack == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") - } - uriString := _Endpoint - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if exprVal := params.Region; exprVal != nil { - _Region := *exprVal - _ = _Region - if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { - _PartitionResult := *exprVal - _ = _PartitionResult - if _PartitionResult.Name == "aws" { - if _UseFIPS == false { - if _UseDualStack == true { - uriString := "https://ce.us-east-1.api.aws" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - } - } - if _PartitionResult.Name == "aws-cn" { - if _UseFIPS == false { - if _UseDualStack == true { - uriString := "https://ce.cn-northwest-1.api.amazonwebservices.com.cn" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "cn-northwest-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - } - } - if _PartitionResult.Name == "aws-iso" { - if _UseFIPS == false { - if _UseDualStack == false { - uriString := "https://ce.us-iso-east-1.c2s.ic.gov" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-iso-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - } - } - if _PartitionResult.Name == "aws-iso-b" { - if _UseFIPS == false { - if _UseDualStack == false { - uriString := "https://ce.us-isob-east-1.sc2s.sgov.gov" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-isob-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - } - } - if _PartitionResult.Name == "aws-iso-e" { - if _UseFIPS == false { - if _UseDualStack == false { - uriString := "https://ce.eu-isoe-west-1.cloud.adc-e.uk" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "eu-isoe-west-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - } - } - if _PartitionResult.Name == "aws-iso-f" { - if _UseFIPS == false { - if _UseDualStack == false { - uriString := "https://ce.us-isof-south-1.csp.hci.ic.gov" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "us-isof-south-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - } - } - if _PartitionResult.Name == "aws-eusc" { - if _UseFIPS == false { - if _UseDualStack == true { - uriString := "https://ce.eusc-de-east-1.api.amazonwebservices.eu" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "eusc-de-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - } - } - if _PartitionResult.Name == "aws-eusc" { - if _UseFIPS == false { - if _UseDualStack == false { - uriString := "https://ce.eusc-de-east-1.api.amazonwebservices.eu" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, "eusc-de-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - } - } - if _UseFIPS == true { - if _UseDualStack == true { - if true == _PartitionResult.SupportsFIPS { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://ce-fips.") - out.WriteString(_PartitionResult.ImplicitGlobalRegion) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, _PartitionResult.ImplicitGlobalRegion) - return sp - }(), - }, - }) - return out - }(), - }, nil - } - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") - } - } - if _UseFIPS == true { - if _UseDualStack == false { - if _PartitionResult.SupportsFIPS == true { - uriString := func() string { - var out strings.Builder - out.WriteString("https://ce-fips.") - out.WriteString(_PartitionResult.ImplicitGlobalRegion) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, _PartitionResult.ImplicitGlobalRegion) - return sp - }(), - }, - }) - return out - }(), - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") - } - } - if _UseFIPS == false { - if _UseDualStack == true { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://ce.") - out.WriteString(_PartitionResult.ImplicitGlobalRegion) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, _PartitionResult.ImplicitGlobalRegion) - return sp - }(), - }, - }) - return out - }(), - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") - } - } - uriString := func() string { - var out strings.Builder - out.WriteString("https://ce.") - out.WriteString(_PartitionResult.ImplicitGlobalRegion) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningRegion(&sp, _PartitionResult.ImplicitGlobalRegion) - return sp - }(), - }, - }) - return out - }(), - }, nil - } - return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") -} - -type endpointParamsBinder interface { - bindEndpointParams(*EndpointParameters) -} - -func bindEndpointParams(ctx context.Context, input interface{}, options Options) (*EndpointParameters, error) { - params := &EndpointParameters{} - - params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) - params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) - params.Endpoint = options.BaseEndpoint - region, err := bindRegion(options.Region) - if err != nil { - return nil, err - } - params.Region = region - - if b, ok := input.(endpointParamsBinder); ok { - b.bindEndpointParams(params) - } - - return params, nil -} - -type resolveEndpointV2Middleware struct { - options Options -} - -func (*resolveEndpointV2Middleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "ResolveEndpoint") - defer span.End() - - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleFinalize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.options.EndpointResolverV2 == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params, err := bindEndpointParams(ctx, getOperationInput(ctx), m.options) - if err != nil { - return out, metadata, fmt.Errorf("failed to bind endpoint params, %w", err) - } - endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", - func() (smithyendpoints.Endpoint, error) { - return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) - }) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) - - if endpt.URI.RawPath == "" && req.URL.RawPath != "" { - endpt.URI.RawPath = endpt.URI.Path - } - req.URL.Scheme = endpt.URI.Scheme - req.URL.Host = endpt.URI.Host - req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) - req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) - for k := range endpt.Headers { - req.Header.Set(k, endpt.Headers.Get(k)) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) - for _, o := range opts { - rscheme.SignerProperties.SetAll(&o.SignerProperties) - } - - span.End() - return next.HandleFinalize(ctx, in) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/generated.json deleted file mode 100644 index 1ca0509322..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/generated.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "dependencies": { - "github.com/aws/aws-sdk-go-v2": "v1.4.0", - "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", - "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", - "github.com/aws/smithy-go": "v1.4.0" - }, - "files": [ - "api_client.go", - "api_client_test.go", - "api_op_CreateAnomalyMonitor.go", - "api_op_CreateAnomalySubscription.go", - "api_op_CreateCostCategoryDefinition.go", - "api_op_DeleteAnomalyMonitor.go", - "api_op_DeleteAnomalySubscription.go", - "api_op_DeleteCostCategoryDefinition.go", - "api_op_DescribeCostCategoryDefinition.go", - "api_op_GetAnomalies.go", - "api_op_GetAnomalyMonitors.go", - "api_op_GetAnomalySubscriptions.go", - "api_op_GetApproximateUsageRecords.go", - "api_op_GetCommitmentPurchaseAnalysis.go", - "api_op_GetCostAndUsage.go", - "api_op_GetCostAndUsageComparisons.go", - "api_op_GetCostAndUsageWithResources.go", - "api_op_GetCostCategories.go", - "api_op_GetCostComparisonDrivers.go", - "api_op_GetCostForecast.go", - "api_op_GetDimensionValues.go", - "api_op_GetReservationCoverage.go", - "api_op_GetReservationPurchaseRecommendation.go", - "api_op_GetReservationUtilization.go", - "api_op_GetRightsizingRecommendation.go", - "api_op_GetSavingsPlanPurchaseRecommendationDetails.go", - "api_op_GetSavingsPlansCoverage.go", - "api_op_GetSavingsPlansPurchaseRecommendation.go", - "api_op_GetSavingsPlansUtilization.go", - "api_op_GetSavingsPlansUtilizationDetails.go", - "api_op_GetTags.go", - "api_op_GetUsageForecast.go", - "api_op_ListCommitmentPurchaseAnalyses.go", - "api_op_ListCostAllocationTagBackfillHistory.go", - "api_op_ListCostAllocationTags.go", - "api_op_ListCostCategoryDefinitions.go", - "api_op_ListCostCategoryResourceAssociations.go", - "api_op_ListSavingsPlansPurchaseRecommendationGeneration.go", - "api_op_ListTagsForResource.go", - "api_op_ProvideAnomalyFeedback.go", - "api_op_StartCommitmentPurchaseAnalysis.go", - "api_op_StartCostAllocationTagBackfill.go", - "api_op_StartSavingsPlansPurchaseRecommendationGeneration.go", - "api_op_TagResource.go", - "api_op_UntagResource.go", - "api_op_UpdateAnomalyMonitor.go", - "api_op_UpdateAnomalySubscription.go", - "api_op_UpdateCostAllocationTagsStatus.go", - "api_op_UpdateCostCategoryDefinition.go", - "auth.go", - "deserializers.go", - "doc.go", - "endpoints.go", - "endpoints_config_test.go", - "endpoints_test.go", - "generated.json", - "internal/endpoints/endpoints.go", - "internal/endpoints/endpoints_test.go", - "options.go", - "serializers.go", - "snapshot_test.go", - "sra_operation_order_test.go", - "types/enums.go", - "types/errors.go", - "types/types.go", - "validators.go" - ], - "go": "1.24", - "module": "github.com/aws/aws-sdk-go-v2/service/costexplorer", - "unstable": false -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/go_module_metadata.go deleted file mode 100644 index 1bb62feddd..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package costexplorer - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "1.63.5" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/internal/endpoints/endpoints.go deleted file mode 100644 index d6fd8a9c34..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/internal/endpoints/endpoints.go +++ /dev/null @@ -1,388 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package endpoints - -import ( - "github.com/aws/aws-sdk-go-v2/aws" - endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" - "github.com/aws/smithy-go/logging" - "regexp" -) - -// Options is the endpoint resolver configuration options -type Options struct { - // Logger is a logging implementation that log events should be sent to. - Logger logging.Logger - - // LogDeprecated indicates that deprecated endpoints should be logged to the - // provided logger. - LogDeprecated bool - - // ResolvedRegion is used to override the region to be resolved, rather then the - // using the value passed to the ResolveEndpoint method. This value is used by the - // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative - // name. You must not set this value directly in your application. - ResolvedRegion string - - // DisableHTTPS informs the resolver to return an endpoint that does not use the - // HTTPS scheme. - DisableHTTPS bool - - // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. - UseDualStackEndpoint aws.DualStackEndpointState - - // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. - UseFIPSEndpoint aws.FIPSEndpointState -} - -func (o Options) GetResolvedRegion() string { - return o.ResolvedRegion -} - -func (o Options) GetDisableHTTPS() bool { - return o.DisableHTTPS -} - -func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { - return o.UseDualStackEndpoint -} - -func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { - return o.UseFIPSEndpoint -} - -func transformToSharedOptions(options Options) endpoints.Options { - return endpoints.Options{ - Logger: options.Logger, - LogDeprecated: options.LogDeprecated, - ResolvedRegion: options.ResolvedRegion, - DisableHTTPS: options.DisableHTTPS, - UseDualStackEndpoint: options.UseDualStackEndpoint, - UseFIPSEndpoint: options.UseFIPSEndpoint, - } -} - -// Resolver Cost Explorer endpoint resolver -type Resolver struct { - partitions endpoints.Partitions -} - -// ResolveEndpoint resolves the service endpoint for the given region and options -func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { - if len(region) == 0 { - return endpoint, &aws.MissingRegionError{} - } - - opt := transformToSharedOptions(options) - return r.partitions.ResolveEndpoint(region, opt) -} - -// New returns a new Resolver -func New() *Resolver { - return &Resolver{ - partitions: defaultPartitions, - } -} - -var partitionRegexp = struct { - Aws *regexp.Regexp - AwsCn *regexp.Regexp - AwsEusc *regexp.Regexp - AwsIso *regexp.Regexp - AwsIsoB *regexp.Regexp - AwsIsoE *regexp.Regexp - AwsIsoF *regexp.Regexp - AwsUsGov *regexp.Regexp -}{ - - Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), - AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), - AwsEusc: regexp.MustCompile("^eusc\\-(de)\\-\\w+\\-\\d+$"), - AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), - AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), - AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), - AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), - AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), -} - -var defaultPartitions = endpoints.Partitions{ - { - ID: "aws", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ce.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ce-fips.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "ce-fips.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "ce.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.Aws, - IsRegionalized: false, - PartitionEndpoint: "aws-global", - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "aws-global", - }: endpoints.Endpoint{ - Hostname: "ce.us-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-east-1", - }, - }, - }, - }, - { - ID: "aws-cn", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ce.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ce-fips.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "ce-fips.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "ce.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsCn, - IsRegionalized: false, - PartitionEndpoint: "aws-cn-global", - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "aws-cn-global", - }: endpoints.Endpoint{ - Hostname: "ce.cn-northwest-1.amazonaws.com.cn", - CredentialScope: endpoints.CredentialScope{ - Region: "cn-northwest-1", - }, - }, - }, - }, - { - ID: "aws-eusc", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ce.{region}.api.amazonwebservices.eu", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ce-fips.{region}.amazonaws.eu", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "ce-fips.{region}.api.amazonwebservices.eu", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "ce.{region}.amazonaws.eu", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsEusc, - IsRegionalized: true, - }, - { - ID: "aws-iso", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ce-fips.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "ce.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIso, - IsRegionalized: false, - PartitionEndpoint: "aws-iso-global", - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "aws-iso-global", - }: endpoints.Endpoint{ - Hostname: "ce.us-iso-east-1.c2s.ic.gov", - CredentialScope: endpoints.CredentialScope{ - Region: "us-iso-east-1", - }, - }, - }, - }, - { - ID: "aws-iso-b", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ce-fips.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "ce.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoB, - IsRegionalized: false, - PartitionEndpoint: "aws-iso-b-global", - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "aws-iso-b-global", - }: endpoints.Endpoint{ - Hostname: "ce.us-isob-east-1.sc2s.sgov.gov", - CredentialScope: endpoints.CredentialScope{ - Region: "us-isob-east-1", - }, - }, - }, - }, - { - ID: "aws-iso-e", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ce-fips.{region}.cloud.adc-e.uk", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "ce.{region}.cloud.adc-e.uk", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoE, - IsRegionalized: true, - }, - { - ID: "aws-iso-f", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ce-fips.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "ce.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoF, - IsRegionalized: false, - PartitionEndpoint: "aws-iso-f-global", - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "aws-iso-f-global", - }: endpoints.Endpoint{ - Hostname: "ce.us-isof-south-1.csp.hci.ic.gov", - CredentialScope: endpoints.CredentialScope{ - Region: "us-isof-south-1", - }, - }, - }, - }, - { - ID: "aws-us-gov", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "ce.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "ce-fips.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "ce-fips.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "ce.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsUsGov, - IsRegionalized: true, - }, -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/options.go deleted file mode 100644 index 5dcf9eb0f5..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/options.go +++ /dev/null @@ -1,238 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" -) - -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -type Options struct { - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - APIOptions []func(*middleware.Stack) error - - // The optional application specific identifier appended to the User-Agent header. - AppID string - - // This endpoint will be given as input to an EndpointResolverV2. It is used for - // providing a custom base endpoint that is subject to modifications by the - // processing EndpointResolverV2. - BaseEndpoint *string - - // Configures the events that will be sent to the configured logger. - ClientLogMode aws.ClientLogMode - - // The credentials object to use when signing requests. - Credentials aws.CredentialsProvider - - // The configuration DefaultsMode that the SDK should use when constructing the - // clients initial default settings. - DefaultsMode aws.DefaultsMode - - // The endpoint options to be used when attempting to resolve an endpoint. - EndpointOptions EndpointResolverOptions - - // The service endpoint resolver. - // - // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a - // value for this field will likely prevent you from using any endpoint-related - // service features released after the introduction of EndpointResolverV2 and - // BaseEndpoint. - // - // To migrate an EndpointResolver implementation that uses a custom endpoint, set - // the client option BaseEndpoint instead. - EndpointResolver EndpointResolver - - // Resolves the endpoint used for a particular service operation. - EndpointResolverV2 EndpointResolverV2 - - // Signature Version 4 (SigV4) Signer - HTTPSignerV4 HTTPSignerV4 - - // The logger writer interface to write logging messages to. - Logger logging.Logger - - // The client meter provider. - MeterProvider metrics.MeterProvider - - // The region to send requests to. (Required) - Region string - - // RetryMaxAttempts specifies the maximum number attempts an API client will call - // an operation that fails with a retryable error. A value of 0 is ignored, and - // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. - // - // If specified in an operation call's functional options with a value that is - // different than the constructed client's Options, the Client's Retryer will be - // wrapped to use the operation's specific RetryMaxAttempts value. - RetryMaxAttempts int - - // RetryMode specifies the retry mode the API client will be created with, if - // Retryer option is not also specified. - // - // When creating a new API Clients this member will only be used if the Retryer - // Options member is nil. This value will be ignored if Retryer is not nil. - // - // Currently does not support per operation call overrides, may in the future. - RetryMode aws.RetryMode - - // Retryer guides how HTTP requests should be retried in case of recoverable - // failures. When nil the API client will use a default retryer. The kind of - // default retry created by the API client can be changed with the RetryMode - // option. - Retryer aws.Retryer - - // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set - // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You - // should not populate this structure programmatically, or rely on the values here - // within your applications. - RuntimeEnvironment aws.RuntimeEnvironment - - // The client tracer provider. - TracerProvider tracing.TracerProvider - - // The initial DefaultsMode used when the client options were constructed. If the - // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved - // value was at that point in time. - // - // Currently does not support per operation call overrides, may in the future. - resolvedDefaultsMode aws.DefaultsMode - - // The HTTP client to invoke API calls with. Defaults to client's default HTTP - // implementation if nil. - HTTPClient HTTPClient - - // Client registry of operation interceptors. - Interceptors smithyhttp.InterceptorRegistry - - // The auth scheme resolver which determines how to authenticate for each - // operation. - AuthSchemeResolver AuthSchemeResolver - - // The list of auth schemes supported by the client. - AuthSchemes []smithyhttp.AuthScheme - - // Priority list of preferred auth scheme names (e.g. sigv4a). - AuthSchemePreference []string -} - -// Copy creates a clone where the APIOptions list is deep copied. -func (o Options) Copy() Options { - to := o - to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) - copy(to.APIOptions, o.APIOptions) - to.Interceptors = o.Interceptors.Copy() - - return to -} - -func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { - if schemeID == "aws.auth#sigv4" { - return getSigV4IdentityResolver(o) - } - if schemeID == "smithy.api#noAuth" { - return &smithyauth.AnonymousIdentityResolver{} - } - return nil -} - -// WithAPIOptions returns a functional option for setting the Client's APIOptions -// option. -func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { - return func(o *Options) { - o.APIOptions = append(o.APIOptions, optFns...) - } -} - -// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for -// this field will likely prevent you from using any endpoint-related service -// features released after the introduction of EndpointResolverV2 and BaseEndpoint. -// -// To migrate an EndpointResolver implementation that uses a custom endpoint, set -// the client option BaseEndpoint instead. -func WithEndpointResolver(v EndpointResolver) func(*Options) { - return func(o *Options) { - o.EndpointResolver = v - } -} - -// WithEndpointResolverV2 returns a functional option for setting the Client's -// EndpointResolverV2 option. -func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { - return func(o *Options) { - o.EndpointResolverV2 = v - } -} - -func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { - if o.Credentials != nil { - return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} - } - return nil -} - -// WithSigV4SigningName applies an override to the authentication workflow to -// use the given signing name for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing name from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningName(name string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), - middleware.Before, - ) - }) - } -} - -// WithSigV4SigningRegion applies an override to the authentication workflow to -// use the given signing region for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing region from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningRegion(region string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), - middleware.Before, - ) - }) - } -} - -func ignoreAnonymousAuth(options *Options) { - if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { - options.Credentials = nil - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/serializers.go deleted file mode 100644 index 0d9c71bf8a..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/serializers.go +++ /dev/null @@ -1,5362 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "bytes" - "context" - "fmt" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/encoding/httpbinding" - smithyjson "github.com/aws/smithy-go/encoding/json" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "math" - "path" -) - -type awsAwsjson11_serializeOpCreateAnomalyMonitor struct { -} - -func (*awsAwsjson11_serializeOpCreateAnomalyMonitor) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpCreateAnomalyMonitor) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*CreateAnomalyMonitorInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.CreateAnomalyMonitor") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentCreateAnomalyMonitorInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpCreateAnomalySubscription struct { -} - -func (*awsAwsjson11_serializeOpCreateAnomalySubscription) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpCreateAnomalySubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*CreateAnomalySubscriptionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.CreateAnomalySubscription") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentCreateAnomalySubscriptionInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpCreateCostCategoryDefinition struct { -} - -func (*awsAwsjson11_serializeOpCreateCostCategoryDefinition) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpCreateCostCategoryDefinition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*CreateCostCategoryDefinitionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.CreateCostCategoryDefinition") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentCreateCostCategoryDefinitionInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDeleteAnomalyMonitor struct { -} - -func (*awsAwsjson11_serializeOpDeleteAnomalyMonitor) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDeleteAnomalyMonitor) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DeleteAnomalyMonitorInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.DeleteAnomalyMonitor") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeleteAnomalyMonitorInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDeleteAnomalySubscription struct { -} - -func (*awsAwsjson11_serializeOpDeleteAnomalySubscription) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDeleteAnomalySubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DeleteAnomalySubscriptionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.DeleteAnomalySubscription") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeleteAnomalySubscriptionInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDeleteCostCategoryDefinition struct { -} - -func (*awsAwsjson11_serializeOpDeleteCostCategoryDefinition) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDeleteCostCategoryDefinition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DeleteCostCategoryDefinitionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.DeleteCostCategoryDefinition") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeleteCostCategoryDefinitionInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDescribeCostCategoryDefinition struct { -} - -func (*awsAwsjson11_serializeOpDescribeCostCategoryDefinition) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDescribeCostCategoryDefinition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeCostCategoryDefinitionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.DescribeCostCategoryDefinition") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeCostCategoryDefinitionInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetAnomalies struct { -} - -func (*awsAwsjson11_serializeOpGetAnomalies) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetAnomalies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetAnomaliesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetAnomalies") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetAnomaliesInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetAnomalyMonitors struct { -} - -func (*awsAwsjson11_serializeOpGetAnomalyMonitors) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetAnomalyMonitors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetAnomalyMonitorsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetAnomalyMonitors") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetAnomalyMonitorsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetAnomalySubscriptions struct { -} - -func (*awsAwsjson11_serializeOpGetAnomalySubscriptions) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetAnomalySubscriptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetAnomalySubscriptionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetAnomalySubscriptions") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetAnomalySubscriptionsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetApproximateUsageRecords struct { -} - -func (*awsAwsjson11_serializeOpGetApproximateUsageRecords) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetApproximateUsageRecords) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetApproximateUsageRecordsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetApproximateUsageRecords") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetApproximateUsageRecordsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetCommitmentPurchaseAnalysis struct { -} - -func (*awsAwsjson11_serializeOpGetCommitmentPurchaseAnalysis) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetCommitmentPurchaseAnalysis) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetCommitmentPurchaseAnalysisInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetCommitmentPurchaseAnalysis") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetCommitmentPurchaseAnalysisInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetCostAndUsage struct { -} - -func (*awsAwsjson11_serializeOpGetCostAndUsage) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetCostAndUsage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetCostAndUsageInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetCostAndUsage") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetCostAndUsageInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetCostAndUsageComparisons struct { -} - -func (*awsAwsjson11_serializeOpGetCostAndUsageComparisons) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetCostAndUsageComparisons) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetCostAndUsageComparisonsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetCostAndUsageComparisons") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetCostAndUsageComparisonsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetCostAndUsageWithResources struct { -} - -func (*awsAwsjson11_serializeOpGetCostAndUsageWithResources) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetCostAndUsageWithResources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetCostAndUsageWithResourcesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetCostAndUsageWithResources") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetCostAndUsageWithResourcesInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetCostCategories struct { -} - -func (*awsAwsjson11_serializeOpGetCostCategories) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetCostCategories) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetCostCategoriesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetCostCategories") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetCostCategoriesInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetCostComparisonDrivers struct { -} - -func (*awsAwsjson11_serializeOpGetCostComparisonDrivers) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetCostComparisonDrivers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetCostComparisonDriversInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetCostComparisonDrivers") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetCostComparisonDriversInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetCostForecast struct { -} - -func (*awsAwsjson11_serializeOpGetCostForecast) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetCostForecast) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetCostForecastInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetCostForecast") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetCostForecastInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetDimensionValues struct { -} - -func (*awsAwsjson11_serializeOpGetDimensionValues) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetDimensionValues) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetDimensionValuesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetDimensionValues") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetDimensionValuesInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetReservationCoverage struct { -} - -func (*awsAwsjson11_serializeOpGetReservationCoverage) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetReservationCoverage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetReservationCoverageInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetReservationCoverage") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetReservationCoverageInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetReservationPurchaseRecommendation struct { -} - -func (*awsAwsjson11_serializeOpGetReservationPurchaseRecommendation) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetReservationPurchaseRecommendation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetReservationPurchaseRecommendationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetReservationPurchaseRecommendation") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetReservationPurchaseRecommendationInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetReservationUtilization struct { -} - -func (*awsAwsjson11_serializeOpGetReservationUtilization) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetReservationUtilization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetReservationUtilizationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetReservationUtilization") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetReservationUtilizationInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetRightsizingRecommendation struct { -} - -func (*awsAwsjson11_serializeOpGetRightsizingRecommendation) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetRightsizingRecommendation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetRightsizingRecommendationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetRightsizingRecommendation") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetRightsizingRecommendationInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetSavingsPlanPurchaseRecommendationDetails struct { -} - -func (*awsAwsjson11_serializeOpGetSavingsPlanPurchaseRecommendationDetails) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetSavingsPlanPurchaseRecommendationDetails) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetSavingsPlanPurchaseRecommendationDetailsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetSavingsPlanPurchaseRecommendationDetails") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetSavingsPlanPurchaseRecommendationDetailsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetSavingsPlansCoverage struct { -} - -func (*awsAwsjson11_serializeOpGetSavingsPlansCoverage) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetSavingsPlansCoverage) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetSavingsPlansCoverageInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetSavingsPlansCoverage") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetSavingsPlansCoverageInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetSavingsPlansPurchaseRecommendation struct { -} - -func (*awsAwsjson11_serializeOpGetSavingsPlansPurchaseRecommendation) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetSavingsPlansPurchaseRecommendation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetSavingsPlansPurchaseRecommendationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetSavingsPlansPurchaseRecommendation") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetSavingsPlansPurchaseRecommendationInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetSavingsPlansUtilization struct { -} - -func (*awsAwsjson11_serializeOpGetSavingsPlansUtilization) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetSavingsPlansUtilization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetSavingsPlansUtilizationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetSavingsPlansUtilization") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetSavingsPlansUtilizationInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetSavingsPlansUtilizationDetails struct { -} - -func (*awsAwsjson11_serializeOpGetSavingsPlansUtilizationDetails) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetSavingsPlansUtilizationDetails) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetSavingsPlansUtilizationDetailsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetSavingsPlansUtilizationDetails") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetSavingsPlansUtilizationDetailsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetTags struct { -} - -func (*awsAwsjson11_serializeOpGetTags) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetTags) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetTagsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetTags") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetTagsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpGetUsageForecast struct { -} - -func (*awsAwsjson11_serializeOpGetUsageForecast) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpGetUsageForecast) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*GetUsageForecastInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetUsageForecast") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetUsageForecastInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListCommitmentPurchaseAnalyses struct { -} - -func (*awsAwsjson11_serializeOpListCommitmentPurchaseAnalyses) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListCommitmentPurchaseAnalyses) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListCommitmentPurchaseAnalysesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.ListCommitmentPurchaseAnalyses") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListCommitmentPurchaseAnalysesInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListCostAllocationTagBackfillHistory struct { -} - -func (*awsAwsjson11_serializeOpListCostAllocationTagBackfillHistory) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListCostAllocationTagBackfillHistory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListCostAllocationTagBackfillHistoryInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.ListCostAllocationTagBackfillHistory") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListCostAllocationTagBackfillHistoryInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListCostAllocationTags struct { -} - -func (*awsAwsjson11_serializeOpListCostAllocationTags) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListCostAllocationTags) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListCostAllocationTagsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.ListCostAllocationTags") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListCostAllocationTagsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListCostCategoryDefinitions struct { -} - -func (*awsAwsjson11_serializeOpListCostCategoryDefinitions) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListCostCategoryDefinitions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListCostCategoryDefinitionsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.ListCostCategoryDefinitions") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListCostCategoryDefinitionsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListCostCategoryResourceAssociations struct { -} - -func (*awsAwsjson11_serializeOpListCostCategoryResourceAssociations) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListCostCategoryResourceAssociations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListCostCategoryResourceAssociationsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.ListCostCategoryResourceAssociations") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListCostCategoryResourceAssociationsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListSavingsPlansPurchaseRecommendationGeneration struct { -} - -func (*awsAwsjson11_serializeOpListSavingsPlansPurchaseRecommendationGeneration) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListSavingsPlansPurchaseRecommendationGeneration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListSavingsPlansPurchaseRecommendationGenerationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.ListSavingsPlansPurchaseRecommendationGeneration") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListSavingsPlansPurchaseRecommendationGenerationInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListTagsForResource struct { -} - -func (*awsAwsjson11_serializeOpListTagsForResource) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListTagsForResourceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.ListTagsForResource") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpProvideAnomalyFeedback struct { -} - -func (*awsAwsjson11_serializeOpProvideAnomalyFeedback) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpProvideAnomalyFeedback) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ProvideAnomalyFeedbackInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.ProvideAnomalyFeedback") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentProvideAnomalyFeedbackInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpStartCommitmentPurchaseAnalysis struct { -} - -func (*awsAwsjson11_serializeOpStartCommitmentPurchaseAnalysis) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpStartCommitmentPurchaseAnalysis) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*StartCommitmentPurchaseAnalysisInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.StartCommitmentPurchaseAnalysis") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentStartCommitmentPurchaseAnalysisInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpStartCostAllocationTagBackfill struct { -} - -func (*awsAwsjson11_serializeOpStartCostAllocationTagBackfill) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpStartCostAllocationTagBackfill) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*StartCostAllocationTagBackfillInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.StartCostAllocationTagBackfill") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentStartCostAllocationTagBackfillInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpStartSavingsPlansPurchaseRecommendationGeneration struct { -} - -func (*awsAwsjson11_serializeOpStartSavingsPlansPurchaseRecommendationGeneration) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpStartSavingsPlansPurchaseRecommendationGeneration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*StartSavingsPlansPurchaseRecommendationGenerationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.StartSavingsPlansPurchaseRecommendationGeneration") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentStartSavingsPlansPurchaseRecommendationGenerationInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpTagResource struct { -} - -func (*awsAwsjson11_serializeOpTagResource) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*TagResourceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.TagResource") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpUntagResource struct { -} - -func (*awsAwsjson11_serializeOpUntagResource) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UntagResourceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.UntagResource") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpUpdateAnomalyMonitor struct { -} - -func (*awsAwsjson11_serializeOpUpdateAnomalyMonitor) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpUpdateAnomalyMonitor) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdateAnomalyMonitorInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.UpdateAnomalyMonitor") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentUpdateAnomalyMonitorInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpUpdateAnomalySubscription struct { -} - -func (*awsAwsjson11_serializeOpUpdateAnomalySubscription) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpUpdateAnomalySubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdateAnomalySubscriptionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.UpdateAnomalySubscription") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentUpdateAnomalySubscriptionInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpUpdateCostAllocationTagsStatus struct { -} - -func (*awsAwsjson11_serializeOpUpdateCostAllocationTagsStatus) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpUpdateCostAllocationTagsStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdateCostAllocationTagsStatusInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.UpdateCostAllocationTagsStatus") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentUpdateCostAllocationTagsStatusInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpUpdateCostCategoryDefinition struct { -} - -func (*awsAwsjson11_serializeOpUpdateCostCategoryDefinition) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpUpdateCostCategoryDefinition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdateCostCategoryDefinitionInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.UpdateCostCategoryDefinition") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentUpdateCostCategoryDefinitionInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsAwsjson11_serializeDocumentAnalysisIds(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsAwsjson11_serializeDocumentAnomalyDateInterval(v *types.AnomalyDateInterval, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.EndDate != nil { - ok := object.Key("EndDate") - ok.String(*v.EndDate) - } - - if v.StartDate != nil { - ok := object.Key("StartDate") - ok.String(*v.StartDate) - } - - return nil -} - -func awsAwsjson11_serializeDocumentAnomalyMonitor(v *types.AnomalyMonitor, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.CreationDate != nil { - ok := object.Key("CreationDate") - ok.String(*v.CreationDate) - } - - if v.DimensionalValueCount != 0 { - ok := object.Key("DimensionalValueCount") - ok.Integer(v.DimensionalValueCount) - } - - if v.LastEvaluatedDate != nil { - ok := object.Key("LastEvaluatedDate") - ok.String(*v.LastEvaluatedDate) - } - - if v.LastUpdatedDate != nil { - ok := object.Key("LastUpdatedDate") - ok.String(*v.LastUpdatedDate) - } - - if v.MonitorArn != nil { - ok := object.Key("MonitorArn") - ok.String(*v.MonitorArn) - } - - if len(v.MonitorDimension) > 0 { - ok := object.Key("MonitorDimension") - ok.String(string(v.MonitorDimension)) - } - - if v.MonitorName != nil { - ok := object.Key("MonitorName") - ok.String(*v.MonitorName) - } - - if v.MonitorSpecification != nil { - ok := object.Key("MonitorSpecification") - if err := awsAwsjson11_serializeDocumentExpression(v.MonitorSpecification, ok); err != nil { - return err - } - } - - if len(v.MonitorType) > 0 { - ok := object.Key("MonitorType") - ok.String(string(v.MonitorType)) - } - - return nil -} - -func awsAwsjson11_serializeDocumentAnomalySubscription(v *types.AnomalySubscription, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AccountId != nil { - ok := object.Key("AccountId") - ok.String(*v.AccountId) - } - - if len(v.Frequency) > 0 { - ok := object.Key("Frequency") - ok.String(string(v.Frequency)) - } - - if v.MonitorArnList != nil { - ok := object.Key("MonitorArnList") - if err := awsAwsjson11_serializeDocumentMonitorArnList(v.MonitorArnList, ok); err != nil { - return err - } - } - - if v.Subscribers != nil { - ok := object.Key("Subscribers") - if err := awsAwsjson11_serializeDocumentSubscribers(v.Subscribers, ok); err != nil { - return err - } - } - - if v.SubscriptionArn != nil { - ok := object.Key("SubscriptionArn") - ok.String(*v.SubscriptionArn) - } - - if v.SubscriptionName != nil { - ok := object.Key("SubscriptionName") - ok.String(*v.SubscriptionName) - } - - if v.Threshold != nil { - ok := object.Key("Threshold") - switch { - case math.IsNaN(*v.Threshold): - ok.String("NaN") - - case math.IsInf(*v.Threshold, 1): - ok.String("Infinity") - - case math.IsInf(*v.Threshold, -1): - ok.String("-Infinity") - - default: - ok.Double(*v.Threshold) - - } - } - - if v.ThresholdExpression != nil { - ok := object.Key("ThresholdExpression") - if err := awsAwsjson11_serializeDocumentExpression(v.ThresholdExpression, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeDocumentCommitmentPurchaseAnalysisConfiguration(v *types.CommitmentPurchaseAnalysisConfiguration, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.SavingsPlansPurchaseAnalysisConfiguration != nil { - ok := object.Key("SavingsPlansPurchaseAnalysisConfiguration") - if err := awsAwsjson11_serializeDocumentSavingsPlansPurchaseAnalysisConfiguration(v.SavingsPlansPurchaseAnalysisConfiguration, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeDocumentCostAllocationTagKeyList(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsAwsjson11_serializeDocumentCostAllocationTagStatusEntry(v *types.CostAllocationTagStatusEntry, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.Status) > 0 { - ok := object.Key("Status") - ok.String(string(v.Status)) - } - - if v.TagKey != nil { - ok := object.Key("TagKey") - ok.String(*v.TagKey) - } - - return nil -} - -func awsAwsjson11_serializeDocumentCostAllocationTagStatusList(v []types.CostAllocationTagStatusEntry, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsAwsjson11_serializeDocumentCostAllocationTagStatusEntry(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsAwsjson11_serializeDocumentCostCategoryInheritedValueDimension(v *types.CostCategoryInheritedValueDimension, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.DimensionKey != nil { - ok := object.Key("DimensionKey") - ok.String(*v.DimensionKey) - } - - if len(v.DimensionName) > 0 { - ok := object.Key("DimensionName") - ok.String(string(v.DimensionName)) - } - - return nil -} - -func awsAwsjson11_serializeDocumentCostCategoryRule(v *types.CostCategoryRule, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.InheritedValue != nil { - ok := object.Key("InheritedValue") - if err := awsAwsjson11_serializeDocumentCostCategoryInheritedValueDimension(v.InheritedValue, ok); err != nil { - return err - } - } - - if v.Rule != nil { - ok := object.Key("Rule") - if err := awsAwsjson11_serializeDocumentExpression(v.Rule, ok); err != nil { - return err - } - } - - if len(v.Type) > 0 { - ok := object.Key("Type") - ok.String(string(v.Type)) - } - - if v.Value != nil { - ok := object.Key("Value") - ok.String(*v.Value) - } - - return nil -} - -func awsAwsjson11_serializeDocumentCostCategoryRulesList(v []types.CostCategoryRule, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsAwsjson11_serializeDocumentCostCategoryRule(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsAwsjson11_serializeDocumentCostCategorySplitChargeRule(v *types.CostCategorySplitChargeRule, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.Method) > 0 { - ok := object.Key("Method") - ok.String(string(v.Method)) - } - - if v.Parameters != nil { - ok := object.Key("Parameters") - if err := awsAwsjson11_serializeDocumentCostCategorySplitChargeRuleParametersList(v.Parameters, ok); err != nil { - return err - } - } - - if v.Source != nil { - ok := object.Key("Source") - ok.String(*v.Source) - } - - if v.Targets != nil { - ok := object.Key("Targets") - if err := awsAwsjson11_serializeDocumentCostCategorySplitChargeRuleTargetsList(v.Targets, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeDocumentCostCategorySplitChargeRuleParameter(v *types.CostCategorySplitChargeRuleParameter, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.Type) > 0 { - ok := object.Key("Type") - ok.String(string(v.Type)) - } - - if v.Values != nil { - ok := object.Key("Values") - if err := awsAwsjson11_serializeDocumentCostCategorySplitChargeRuleParameterValuesList(v.Values, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeDocumentCostCategorySplitChargeRuleParametersList(v []types.CostCategorySplitChargeRuleParameter, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsAwsjson11_serializeDocumentCostCategorySplitChargeRuleParameter(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsAwsjson11_serializeDocumentCostCategorySplitChargeRuleParameterValuesList(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsAwsjson11_serializeDocumentCostCategorySplitChargeRulesList(v []types.CostCategorySplitChargeRule, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsAwsjson11_serializeDocumentCostCategorySplitChargeRule(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsAwsjson11_serializeDocumentCostCategorySplitChargeRuleTargetsList(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsAwsjson11_serializeDocumentCostCategoryValues(v *types.CostCategoryValues, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Key != nil { - ok := object.Key("Key") - ok.String(*v.Key) - } - - if v.MatchOptions != nil { - ok := object.Key("MatchOptions") - if err := awsAwsjson11_serializeDocumentMatchOptions(v.MatchOptions, ok); err != nil { - return err - } - } - - if v.Values != nil { - ok := object.Key("Values") - if err := awsAwsjson11_serializeDocumentValues(v.Values, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeDocumentDateInterval(v *types.DateInterval, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.End != nil { - ok := object.Key("End") - ok.String(*v.End) - } - - if v.Start != nil { - ok := object.Key("Start") - ok.String(*v.Start) - } - - return nil -} - -func awsAwsjson11_serializeDocumentDimensionValues(v *types.DimensionValues, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.Key) > 0 { - ok := object.Key("Key") - ok.String(string(v.Key)) - } - - if v.MatchOptions != nil { - ok := object.Key("MatchOptions") - if err := awsAwsjson11_serializeDocumentMatchOptions(v.MatchOptions, ok); err != nil { - return err - } - } - - if v.Values != nil { - ok := object.Key("Values") - if err := awsAwsjson11_serializeDocumentValues(v.Values, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeDocumentEC2Specification(v *types.EC2Specification, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.OfferingClass) > 0 { - ok := object.Key("OfferingClass") - ok.String(string(v.OfferingClass)) - } - - return nil -} - -func awsAwsjson11_serializeDocumentExpression(v *types.Expression, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.And != nil { - ok := object.Key("And") - if err := awsAwsjson11_serializeDocumentExpressions(v.And, ok); err != nil { - return err - } - } - - if v.CostCategories != nil { - ok := object.Key("CostCategories") - if err := awsAwsjson11_serializeDocumentCostCategoryValues(v.CostCategories, ok); err != nil { - return err - } - } - - if v.Dimensions != nil { - ok := object.Key("Dimensions") - if err := awsAwsjson11_serializeDocumentDimensionValues(v.Dimensions, ok); err != nil { - return err - } - } - - if v.Not != nil { - ok := object.Key("Not") - if err := awsAwsjson11_serializeDocumentExpression(v.Not, ok); err != nil { - return err - } - } - - if v.Or != nil { - ok := object.Key("Or") - if err := awsAwsjson11_serializeDocumentExpressions(v.Or, ok); err != nil { - return err - } - } - - if v.Tags != nil { - ok := object.Key("Tags") - if err := awsAwsjson11_serializeDocumentTagValues(v.Tags, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeDocumentExpressions(v []types.Expression, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsAwsjson11_serializeDocumentExpression(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsAwsjson11_serializeDocumentGroupDefinition(v *types.GroupDefinition, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Key != nil { - ok := object.Key("Key") - ok.String(*v.Key) - } - - if len(v.Type) > 0 { - ok := object.Key("Type") - ok.String(string(v.Type)) - } - - return nil -} - -func awsAwsjson11_serializeDocumentGroupDefinitions(v []types.GroupDefinition, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsAwsjson11_serializeDocumentGroupDefinition(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsAwsjson11_serializeDocumentMatchOptions(v []types.MatchOption, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsAwsjson11_serializeDocumentMetricNames(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsAwsjson11_serializeDocumentMonitorArnList(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsAwsjson11_serializeDocumentRecommendationIdList(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsAwsjson11_serializeDocumentResourceTag(v *types.ResourceTag, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Key != nil { - ok := object.Key("Key") - ok.String(*v.Key) - } - - if v.Value != nil { - ok := object.Key("Value") - ok.String(*v.Value) - } - - return nil -} - -func awsAwsjson11_serializeDocumentResourceTagKeyList(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsAwsjson11_serializeDocumentResourceTagList(v []types.ResourceTag, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsAwsjson11_serializeDocumentResourceTag(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsAwsjson11_serializeDocumentResourceTypesFilterInput(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsAwsjson11_serializeDocumentRightsizingRecommendationConfiguration(v *types.RightsizingRecommendationConfiguration, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - { - ok := object.Key("BenefitsConsidered") - ok.Boolean(v.BenefitsConsidered) - } - - if len(v.RecommendationTarget) > 0 { - ok := object.Key("RecommendationTarget") - ok.String(string(v.RecommendationTarget)) - } - - return nil -} - -func awsAwsjson11_serializeDocumentSavingsPlans(v *types.SavingsPlans, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.InstanceFamily != nil { - ok := object.Key("InstanceFamily") - ok.String(*v.InstanceFamily) - } - - if v.OfferingId != nil { - ok := object.Key("OfferingId") - ok.String(*v.OfferingId) - } - - if len(v.PaymentOption) > 0 { - ok := object.Key("PaymentOption") - ok.String(string(v.PaymentOption)) - } - - if v.Region != nil { - ok := object.Key("Region") - ok.String(*v.Region) - } - - if v.SavingsPlansCommitment != nil { - ok := object.Key("SavingsPlansCommitment") - switch { - case math.IsNaN(*v.SavingsPlansCommitment): - ok.String("NaN") - - case math.IsInf(*v.SavingsPlansCommitment, 1): - ok.String("Infinity") - - case math.IsInf(*v.SavingsPlansCommitment, -1): - ok.String("-Infinity") - - default: - ok.Double(*v.SavingsPlansCommitment) - - } - } - - if len(v.SavingsPlansType) > 0 { - ok := object.Key("SavingsPlansType") - ok.String(string(v.SavingsPlansType)) - } - - if len(v.TermInYears) > 0 { - ok := object.Key("TermInYears") - ok.String(string(v.TermInYears)) - } - - return nil -} - -func awsAwsjson11_serializeDocumentSavingsPlansDataTypes(v []types.SavingsPlansDataType, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsAwsjson11_serializeDocumentSavingsPlansPurchaseAnalysisConfiguration(v *types.SavingsPlansPurchaseAnalysisConfiguration, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AccountId != nil { - ok := object.Key("AccountId") - ok.String(*v.AccountId) - } - - if len(v.AccountScope) > 0 { - ok := object.Key("AccountScope") - ok.String(string(v.AccountScope)) - } - - if len(v.AnalysisType) > 0 { - ok := object.Key("AnalysisType") - ok.String(string(v.AnalysisType)) - } - - if v.LookBackTimePeriod != nil { - ok := object.Key("LookBackTimePeriod") - if err := awsAwsjson11_serializeDocumentDateInterval(v.LookBackTimePeriod, ok); err != nil { - return err - } - } - - if v.SavingsPlansToAdd != nil { - ok := object.Key("SavingsPlansToAdd") - if err := awsAwsjson11_serializeDocumentSavingsPlansToAdd(v.SavingsPlansToAdd, ok); err != nil { - return err - } - } - - if v.SavingsPlansToExclude != nil { - ok := object.Key("SavingsPlansToExclude") - if err := awsAwsjson11_serializeDocumentSavingsPlansToExclude(v.SavingsPlansToExclude, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeDocumentSavingsPlansToAdd(v []types.SavingsPlans, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsAwsjson11_serializeDocumentSavingsPlans(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsAwsjson11_serializeDocumentSavingsPlansToExclude(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsAwsjson11_serializeDocumentServiceSpecification(v *types.ServiceSpecification, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.EC2Specification != nil { - ok := object.Key("EC2Specification") - if err := awsAwsjson11_serializeDocumentEC2Specification(v.EC2Specification, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeDocumentSortDefinition(v *types.SortDefinition, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Key != nil { - ok := object.Key("Key") - ok.String(*v.Key) - } - - if len(v.SortOrder) > 0 { - ok := object.Key("SortOrder") - ok.String(string(v.SortOrder)) - } - - return nil -} - -func awsAwsjson11_serializeDocumentSortDefinitions(v []types.SortDefinition, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsAwsjson11_serializeDocumentSortDefinition(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsAwsjson11_serializeDocumentSubscriber(v *types.Subscriber, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Address != nil { - ok := object.Key("Address") - ok.String(*v.Address) - } - - if len(v.Status) > 0 { - ok := object.Key("Status") - ok.String(string(v.Status)) - } - - if len(v.Type) > 0 { - ok := object.Key("Type") - ok.String(string(v.Type)) - } - - return nil -} - -func awsAwsjson11_serializeDocumentSubscribers(v []types.Subscriber, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsAwsjson11_serializeDocumentSubscriber(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsAwsjson11_serializeDocumentTagValues(v *types.TagValues, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Key != nil { - ok := object.Key("Key") - ok.String(*v.Key) - } - - if v.MatchOptions != nil { - ok := object.Key("MatchOptions") - if err := awsAwsjson11_serializeDocumentMatchOptions(v.MatchOptions, ok); err != nil { - return err - } - } - - if v.Values != nil { - ok := object.Key("Values") - if err := awsAwsjson11_serializeDocumentValues(v.Values, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeDocumentTotalImpactFilter(v *types.TotalImpactFilter, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.EndValue != 0 { - ok := object.Key("EndValue") - switch { - case math.IsNaN(v.EndValue): - ok.String("NaN") - - case math.IsInf(v.EndValue, 1): - ok.String("Infinity") - - case math.IsInf(v.EndValue, -1): - ok.String("-Infinity") - - default: - ok.Double(v.EndValue) - - } - } - - if len(v.NumericOperator) > 0 { - ok := object.Key("NumericOperator") - ok.String(string(v.NumericOperator)) - } - - { - ok := object.Key("StartValue") - switch { - case math.IsNaN(v.StartValue): - ok.String("NaN") - - case math.IsInf(v.StartValue, 1): - ok.String("Infinity") - - case math.IsInf(v.StartValue, -1): - ok.String("-Infinity") - - default: - ok.Double(v.StartValue) - - } - } - - return nil -} - -func awsAwsjson11_serializeDocumentUsageServices(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsAwsjson11_serializeDocumentValues(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsAwsjson11_serializeOpDocumentCreateAnomalyMonitorInput(v *CreateAnomalyMonitorInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AnomalyMonitor != nil { - ok := object.Key("AnomalyMonitor") - if err := awsAwsjson11_serializeDocumentAnomalyMonitor(v.AnomalyMonitor, ok); err != nil { - return err - } - } - - if v.ResourceTags != nil { - ok := object.Key("ResourceTags") - if err := awsAwsjson11_serializeDocumentResourceTagList(v.ResourceTags, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentCreateAnomalySubscriptionInput(v *CreateAnomalySubscriptionInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AnomalySubscription != nil { - ok := object.Key("AnomalySubscription") - if err := awsAwsjson11_serializeDocumentAnomalySubscription(v.AnomalySubscription, ok); err != nil { - return err - } - } - - if v.ResourceTags != nil { - ok := object.Key("ResourceTags") - if err := awsAwsjson11_serializeDocumentResourceTagList(v.ResourceTags, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentCreateCostCategoryDefinitionInput(v *CreateCostCategoryDefinitionInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.DefaultValue != nil { - ok := object.Key("DefaultValue") - ok.String(*v.DefaultValue) - } - - if v.EffectiveStart != nil { - ok := object.Key("EffectiveStart") - ok.String(*v.EffectiveStart) - } - - if v.Name != nil { - ok := object.Key("Name") - ok.String(*v.Name) - } - - if v.ResourceTags != nil { - ok := object.Key("ResourceTags") - if err := awsAwsjson11_serializeDocumentResourceTagList(v.ResourceTags, ok); err != nil { - return err - } - } - - if v.Rules != nil { - ok := object.Key("Rules") - if err := awsAwsjson11_serializeDocumentCostCategoryRulesList(v.Rules, ok); err != nil { - return err - } - } - - if len(v.RuleVersion) > 0 { - ok := object.Key("RuleVersion") - ok.String(string(v.RuleVersion)) - } - - if v.SplitChargeRules != nil { - ok := object.Key("SplitChargeRules") - if err := awsAwsjson11_serializeDocumentCostCategorySplitChargeRulesList(v.SplitChargeRules, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentDeleteAnomalyMonitorInput(v *DeleteAnomalyMonitorInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MonitorArn != nil { - ok := object.Key("MonitorArn") - ok.String(*v.MonitorArn) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentDeleteAnomalySubscriptionInput(v *DeleteAnomalySubscriptionInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.SubscriptionArn != nil { - ok := object.Key("SubscriptionArn") - ok.String(*v.SubscriptionArn) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentDeleteCostCategoryDefinitionInput(v *DeleteCostCategoryDefinitionInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.CostCategoryArn != nil { - ok := object.Key("CostCategoryArn") - ok.String(*v.CostCategoryArn) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentDescribeCostCategoryDefinitionInput(v *DescribeCostCategoryDefinitionInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.CostCategoryArn != nil { - ok := object.Key("CostCategoryArn") - ok.String(*v.CostCategoryArn) - } - - if v.EffectiveOn != nil { - ok := object.Key("EffectiveOn") - ok.String(*v.EffectiveOn) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetAnomaliesInput(v *GetAnomaliesInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.DateInterval != nil { - ok := object.Key("DateInterval") - if err := awsAwsjson11_serializeDocumentAnomalyDateInterval(v.DateInterval, ok); err != nil { - return err - } - } - - if len(v.Feedback) > 0 { - ok := object.Key("Feedback") - ok.String(string(v.Feedback)) - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.MonitorArn != nil { - ok := object.Key("MonitorArn") - ok.String(*v.MonitorArn) - } - - if v.NextPageToken != nil { - ok := object.Key("NextPageToken") - ok.String(*v.NextPageToken) - } - - if v.TotalImpact != nil { - ok := object.Key("TotalImpact") - if err := awsAwsjson11_serializeDocumentTotalImpactFilter(v.TotalImpact, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetAnomalyMonitorsInput(v *GetAnomalyMonitorsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.MonitorArnList != nil { - ok := object.Key("MonitorArnList") - if err := awsAwsjson11_serializeDocumentValues(v.MonitorArnList, ok); err != nil { - return err - } - } - - if v.NextPageToken != nil { - ok := object.Key("NextPageToken") - ok.String(*v.NextPageToken) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetAnomalySubscriptionsInput(v *GetAnomalySubscriptionsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.MonitorArn != nil { - ok := object.Key("MonitorArn") - ok.String(*v.MonitorArn) - } - - if v.NextPageToken != nil { - ok := object.Key("NextPageToken") - ok.String(*v.NextPageToken) - } - - if v.SubscriptionArnList != nil { - ok := object.Key("SubscriptionArnList") - if err := awsAwsjson11_serializeDocumentValues(v.SubscriptionArnList, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetApproximateUsageRecordsInput(v *GetApproximateUsageRecordsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.ApproximationDimension) > 0 { - ok := object.Key("ApproximationDimension") - ok.String(string(v.ApproximationDimension)) - } - - if len(v.Granularity) > 0 { - ok := object.Key("Granularity") - ok.String(string(v.Granularity)) - } - - if v.Services != nil { - ok := object.Key("Services") - if err := awsAwsjson11_serializeDocumentUsageServices(v.Services, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetCommitmentPurchaseAnalysisInput(v *GetCommitmentPurchaseAnalysisInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AnalysisId != nil { - ok := object.Key("AnalysisId") - ok.String(*v.AnalysisId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetCostAndUsageComparisonsInput(v *GetCostAndUsageComparisonsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.BaselineTimePeriod != nil { - ok := object.Key("BaselineTimePeriod") - if err := awsAwsjson11_serializeDocumentDateInterval(v.BaselineTimePeriod, ok); err != nil { - return err - } - } - - if v.BillingViewArn != nil { - ok := object.Key("BillingViewArn") - ok.String(*v.BillingViewArn) - } - - if v.ComparisonTimePeriod != nil { - ok := object.Key("ComparisonTimePeriod") - if err := awsAwsjson11_serializeDocumentDateInterval(v.ComparisonTimePeriod, ok); err != nil { - return err - } - } - - if v.Filter != nil { - ok := object.Key("Filter") - if err := awsAwsjson11_serializeDocumentExpression(v.Filter, ok); err != nil { - return err - } - } - - if v.GroupBy != nil { - ok := object.Key("GroupBy") - if err := awsAwsjson11_serializeDocumentGroupDefinitions(v.GroupBy, ok); err != nil { - return err - } - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.MetricForComparison != nil { - ok := object.Key("MetricForComparison") - ok.String(*v.MetricForComparison) - } - - if v.NextPageToken != nil { - ok := object.Key("NextPageToken") - ok.String(*v.NextPageToken) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetCostAndUsageInput(v *GetCostAndUsageInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.BillingViewArn != nil { - ok := object.Key("BillingViewArn") - ok.String(*v.BillingViewArn) - } - - if v.Filter != nil { - ok := object.Key("Filter") - if err := awsAwsjson11_serializeDocumentExpression(v.Filter, ok); err != nil { - return err - } - } - - if len(v.Granularity) > 0 { - ok := object.Key("Granularity") - ok.String(string(v.Granularity)) - } - - if v.GroupBy != nil { - ok := object.Key("GroupBy") - if err := awsAwsjson11_serializeDocumentGroupDefinitions(v.GroupBy, ok); err != nil { - return err - } - } - - if v.Metrics != nil { - ok := object.Key("Metrics") - if err := awsAwsjson11_serializeDocumentMetricNames(v.Metrics, ok); err != nil { - return err - } - } - - if v.NextPageToken != nil { - ok := object.Key("NextPageToken") - ok.String(*v.NextPageToken) - } - - if v.TimePeriod != nil { - ok := object.Key("TimePeriod") - if err := awsAwsjson11_serializeDocumentDateInterval(v.TimePeriod, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetCostAndUsageWithResourcesInput(v *GetCostAndUsageWithResourcesInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.BillingViewArn != nil { - ok := object.Key("BillingViewArn") - ok.String(*v.BillingViewArn) - } - - if v.Filter != nil { - ok := object.Key("Filter") - if err := awsAwsjson11_serializeDocumentExpression(v.Filter, ok); err != nil { - return err - } - } - - if len(v.Granularity) > 0 { - ok := object.Key("Granularity") - ok.String(string(v.Granularity)) - } - - if v.GroupBy != nil { - ok := object.Key("GroupBy") - if err := awsAwsjson11_serializeDocumentGroupDefinitions(v.GroupBy, ok); err != nil { - return err - } - } - - if v.Metrics != nil { - ok := object.Key("Metrics") - if err := awsAwsjson11_serializeDocumentMetricNames(v.Metrics, ok); err != nil { - return err - } - } - - if v.NextPageToken != nil { - ok := object.Key("NextPageToken") - ok.String(*v.NextPageToken) - } - - if v.TimePeriod != nil { - ok := object.Key("TimePeriod") - if err := awsAwsjson11_serializeDocumentDateInterval(v.TimePeriod, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetCostCategoriesInput(v *GetCostCategoriesInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.BillingViewArn != nil { - ok := object.Key("BillingViewArn") - ok.String(*v.BillingViewArn) - } - - if v.CostCategoryName != nil { - ok := object.Key("CostCategoryName") - ok.String(*v.CostCategoryName) - } - - if v.Filter != nil { - ok := object.Key("Filter") - if err := awsAwsjson11_serializeDocumentExpression(v.Filter, ok); err != nil { - return err - } - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextPageToken != nil { - ok := object.Key("NextPageToken") - ok.String(*v.NextPageToken) - } - - if v.SearchString != nil { - ok := object.Key("SearchString") - ok.String(*v.SearchString) - } - - if v.SortBy != nil { - ok := object.Key("SortBy") - if err := awsAwsjson11_serializeDocumentSortDefinitions(v.SortBy, ok); err != nil { - return err - } - } - - if v.TimePeriod != nil { - ok := object.Key("TimePeriod") - if err := awsAwsjson11_serializeDocumentDateInterval(v.TimePeriod, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetCostComparisonDriversInput(v *GetCostComparisonDriversInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.BaselineTimePeriod != nil { - ok := object.Key("BaselineTimePeriod") - if err := awsAwsjson11_serializeDocumentDateInterval(v.BaselineTimePeriod, ok); err != nil { - return err - } - } - - if v.BillingViewArn != nil { - ok := object.Key("BillingViewArn") - ok.String(*v.BillingViewArn) - } - - if v.ComparisonTimePeriod != nil { - ok := object.Key("ComparisonTimePeriod") - if err := awsAwsjson11_serializeDocumentDateInterval(v.ComparisonTimePeriod, ok); err != nil { - return err - } - } - - if v.Filter != nil { - ok := object.Key("Filter") - if err := awsAwsjson11_serializeDocumentExpression(v.Filter, ok); err != nil { - return err - } - } - - if v.GroupBy != nil { - ok := object.Key("GroupBy") - if err := awsAwsjson11_serializeDocumentGroupDefinitions(v.GroupBy, ok); err != nil { - return err - } - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.MetricForComparison != nil { - ok := object.Key("MetricForComparison") - ok.String(*v.MetricForComparison) - } - - if v.NextPageToken != nil { - ok := object.Key("NextPageToken") - ok.String(*v.NextPageToken) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetCostForecastInput(v *GetCostForecastInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.BillingViewArn != nil { - ok := object.Key("BillingViewArn") - ok.String(*v.BillingViewArn) - } - - if v.Filter != nil { - ok := object.Key("Filter") - if err := awsAwsjson11_serializeDocumentExpression(v.Filter, ok); err != nil { - return err - } - } - - if len(v.Granularity) > 0 { - ok := object.Key("Granularity") - ok.String(string(v.Granularity)) - } - - if len(v.Metric) > 0 { - ok := object.Key("Metric") - ok.String(string(v.Metric)) - } - - if v.PredictionIntervalLevel != nil { - ok := object.Key("PredictionIntervalLevel") - ok.Integer(*v.PredictionIntervalLevel) - } - - if v.TimePeriod != nil { - ok := object.Key("TimePeriod") - if err := awsAwsjson11_serializeDocumentDateInterval(v.TimePeriod, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetDimensionValuesInput(v *GetDimensionValuesInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.BillingViewArn != nil { - ok := object.Key("BillingViewArn") - ok.String(*v.BillingViewArn) - } - - if len(v.Context) > 0 { - ok := object.Key("Context") - ok.String(string(v.Context)) - } - - if len(v.Dimension) > 0 { - ok := object.Key("Dimension") - ok.String(string(v.Dimension)) - } - - if v.Filter != nil { - ok := object.Key("Filter") - if err := awsAwsjson11_serializeDocumentExpression(v.Filter, ok); err != nil { - return err - } - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextPageToken != nil { - ok := object.Key("NextPageToken") - ok.String(*v.NextPageToken) - } - - if v.SearchString != nil { - ok := object.Key("SearchString") - ok.String(*v.SearchString) - } - - if v.SortBy != nil { - ok := object.Key("SortBy") - if err := awsAwsjson11_serializeDocumentSortDefinitions(v.SortBy, ok); err != nil { - return err - } - } - - if v.TimePeriod != nil { - ok := object.Key("TimePeriod") - if err := awsAwsjson11_serializeDocumentDateInterval(v.TimePeriod, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetReservationCoverageInput(v *GetReservationCoverageInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Filter != nil { - ok := object.Key("Filter") - if err := awsAwsjson11_serializeDocumentExpression(v.Filter, ok); err != nil { - return err - } - } - - if len(v.Granularity) > 0 { - ok := object.Key("Granularity") - ok.String(string(v.Granularity)) - } - - if v.GroupBy != nil { - ok := object.Key("GroupBy") - if err := awsAwsjson11_serializeDocumentGroupDefinitions(v.GroupBy, ok); err != nil { - return err - } - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.Metrics != nil { - ok := object.Key("Metrics") - if err := awsAwsjson11_serializeDocumentMetricNames(v.Metrics, ok); err != nil { - return err - } - } - - if v.NextPageToken != nil { - ok := object.Key("NextPageToken") - ok.String(*v.NextPageToken) - } - - if v.SortBy != nil { - ok := object.Key("SortBy") - if err := awsAwsjson11_serializeDocumentSortDefinition(v.SortBy, ok); err != nil { - return err - } - } - - if v.TimePeriod != nil { - ok := object.Key("TimePeriod") - if err := awsAwsjson11_serializeDocumentDateInterval(v.TimePeriod, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetReservationPurchaseRecommendationInput(v *GetReservationPurchaseRecommendationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AccountId != nil { - ok := object.Key("AccountId") - ok.String(*v.AccountId) - } - - if len(v.AccountScope) > 0 { - ok := object.Key("AccountScope") - ok.String(string(v.AccountScope)) - } - - if v.Filter != nil { - ok := object.Key("Filter") - if err := awsAwsjson11_serializeDocumentExpression(v.Filter, ok); err != nil { - return err - } - } - - if len(v.LookbackPeriodInDays) > 0 { - ok := object.Key("LookbackPeriodInDays") - ok.String(string(v.LookbackPeriodInDays)) - } - - if v.NextPageToken != nil { - ok := object.Key("NextPageToken") - ok.String(*v.NextPageToken) - } - - if v.PageSize != 0 { - ok := object.Key("PageSize") - ok.Integer(v.PageSize) - } - - if len(v.PaymentOption) > 0 { - ok := object.Key("PaymentOption") - ok.String(string(v.PaymentOption)) - } - - if v.Service != nil { - ok := object.Key("Service") - ok.String(*v.Service) - } - - if v.ServiceSpecification != nil { - ok := object.Key("ServiceSpecification") - if err := awsAwsjson11_serializeDocumentServiceSpecification(v.ServiceSpecification, ok); err != nil { - return err - } - } - - if len(v.TermInYears) > 0 { - ok := object.Key("TermInYears") - ok.String(string(v.TermInYears)) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetReservationUtilizationInput(v *GetReservationUtilizationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Filter != nil { - ok := object.Key("Filter") - if err := awsAwsjson11_serializeDocumentExpression(v.Filter, ok); err != nil { - return err - } - } - - if len(v.Granularity) > 0 { - ok := object.Key("Granularity") - ok.String(string(v.Granularity)) - } - - if v.GroupBy != nil { - ok := object.Key("GroupBy") - if err := awsAwsjson11_serializeDocumentGroupDefinitions(v.GroupBy, ok); err != nil { - return err - } - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextPageToken != nil { - ok := object.Key("NextPageToken") - ok.String(*v.NextPageToken) - } - - if v.SortBy != nil { - ok := object.Key("SortBy") - if err := awsAwsjson11_serializeDocumentSortDefinition(v.SortBy, ok); err != nil { - return err - } - } - - if v.TimePeriod != nil { - ok := object.Key("TimePeriod") - if err := awsAwsjson11_serializeDocumentDateInterval(v.TimePeriod, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetRightsizingRecommendationInput(v *GetRightsizingRecommendationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Configuration != nil { - ok := object.Key("Configuration") - if err := awsAwsjson11_serializeDocumentRightsizingRecommendationConfiguration(v.Configuration, ok); err != nil { - return err - } - } - - if v.Filter != nil { - ok := object.Key("Filter") - if err := awsAwsjson11_serializeDocumentExpression(v.Filter, ok); err != nil { - return err - } - } - - if v.NextPageToken != nil { - ok := object.Key("NextPageToken") - ok.String(*v.NextPageToken) - } - - if v.PageSize != 0 { - ok := object.Key("PageSize") - ok.Integer(v.PageSize) - } - - if v.Service != nil { - ok := object.Key("Service") - ok.String(*v.Service) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetSavingsPlanPurchaseRecommendationDetailsInput(v *GetSavingsPlanPurchaseRecommendationDetailsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.RecommendationDetailId != nil { - ok := object.Key("RecommendationDetailId") - ok.String(*v.RecommendationDetailId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetSavingsPlansCoverageInput(v *GetSavingsPlansCoverageInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Filter != nil { - ok := object.Key("Filter") - if err := awsAwsjson11_serializeDocumentExpression(v.Filter, ok); err != nil { - return err - } - } - - if len(v.Granularity) > 0 { - ok := object.Key("Granularity") - ok.String(string(v.Granularity)) - } - - if v.GroupBy != nil { - ok := object.Key("GroupBy") - if err := awsAwsjson11_serializeDocumentGroupDefinitions(v.GroupBy, ok); err != nil { - return err - } - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.Metrics != nil { - ok := object.Key("Metrics") - if err := awsAwsjson11_serializeDocumentMetricNames(v.Metrics, ok); err != nil { - return err - } - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - if v.SortBy != nil { - ok := object.Key("SortBy") - if err := awsAwsjson11_serializeDocumentSortDefinition(v.SortBy, ok); err != nil { - return err - } - } - - if v.TimePeriod != nil { - ok := object.Key("TimePeriod") - if err := awsAwsjson11_serializeDocumentDateInterval(v.TimePeriod, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetSavingsPlansPurchaseRecommendationInput(v *GetSavingsPlansPurchaseRecommendationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.AccountScope) > 0 { - ok := object.Key("AccountScope") - ok.String(string(v.AccountScope)) - } - - if v.Filter != nil { - ok := object.Key("Filter") - if err := awsAwsjson11_serializeDocumentExpression(v.Filter, ok); err != nil { - return err - } - } - - if len(v.LookbackPeriodInDays) > 0 { - ok := object.Key("LookbackPeriodInDays") - ok.String(string(v.LookbackPeriodInDays)) - } - - if v.NextPageToken != nil { - ok := object.Key("NextPageToken") - ok.String(*v.NextPageToken) - } - - if v.PageSize != 0 { - ok := object.Key("PageSize") - ok.Integer(v.PageSize) - } - - if len(v.PaymentOption) > 0 { - ok := object.Key("PaymentOption") - ok.String(string(v.PaymentOption)) - } - - if len(v.SavingsPlansType) > 0 { - ok := object.Key("SavingsPlansType") - ok.String(string(v.SavingsPlansType)) - } - - if len(v.TermInYears) > 0 { - ok := object.Key("TermInYears") - ok.String(string(v.TermInYears)) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetSavingsPlansUtilizationDetailsInput(v *GetSavingsPlansUtilizationDetailsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.DataType != nil { - ok := object.Key("DataType") - if err := awsAwsjson11_serializeDocumentSavingsPlansDataTypes(v.DataType, ok); err != nil { - return err - } - } - - if v.Filter != nil { - ok := object.Key("Filter") - if err := awsAwsjson11_serializeDocumentExpression(v.Filter, ok); err != nil { - return err - } - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - if v.SortBy != nil { - ok := object.Key("SortBy") - if err := awsAwsjson11_serializeDocumentSortDefinition(v.SortBy, ok); err != nil { - return err - } - } - - if v.TimePeriod != nil { - ok := object.Key("TimePeriod") - if err := awsAwsjson11_serializeDocumentDateInterval(v.TimePeriod, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetSavingsPlansUtilizationInput(v *GetSavingsPlansUtilizationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Filter != nil { - ok := object.Key("Filter") - if err := awsAwsjson11_serializeDocumentExpression(v.Filter, ok); err != nil { - return err - } - } - - if len(v.Granularity) > 0 { - ok := object.Key("Granularity") - ok.String(string(v.Granularity)) - } - - if v.SortBy != nil { - ok := object.Key("SortBy") - if err := awsAwsjson11_serializeDocumentSortDefinition(v.SortBy, ok); err != nil { - return err - } - } - - if v.TimePeriod != nil { - ok := object.Key("TimePeriod") - if err := awsAwsjson11_serializeDocumentDateInterval(v.TimePeriod, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetTagsInput(v *GetTagsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.BillingViewArn != nil { - ok := object.Key("BillingViewArn") - ok.String(*v.BillingViewArn) - } - - if v.Filter != nil { - ok := object.Key("Filter") - if err := awsAwsjson11_serializeDocumentExpression(v.Filter, ok); err != nil { - return err - } - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextPageToken != nil { - ok := object.Key("NextPageToken") - ok.String(*v.NextPageToken) - } - - if v.SearchString != nil { - ok := object.Key("SearchString") - ok.String(*v.SearchString) - } - - if v.SortBy != nil { - ok := object.Key("SortBy") - if err := awsAwsjson11_serializeDocumentSortDefinitions(v.SortBy, ok); err != nil { - return err - } - } - - if v.TagKey != nil { - ok := object.Key("TagKey") - ok.String(*v.TagKey) - } - - if v.TimePeriod != nil { - ok := object.Key("TimePeriod") - if err := awsAwsjson11_serializeDocumentDateInterval(v.TimePeriod, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentGetUsageForecastInput(v *GetUsageForecastInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.BillingViewArn != nil { - ok := object.Key("BillingViewArn") - ok.String(*v.BillingViewArn) - } - - if v.Filter != nil { - ok := object.Key("Filter") - if err := awsAwsjson11_serializeDocumentExpression(v.Filter, ok); err != nil { - return err - } - } - - if len(v.Granularity) > 0 { - ok := object.Key("Granularity") - ok.String(string(v.Granularity)) - } - - if len(v.Metric) > 0 { - ok := object.Key("Metric") - ok.String(string(v.Metric)) - } - - if v.PredictionIntervalLevel != nil { - ok := object.Key("PredictionIntervalLevel") - ok.Integer(*v.PredictionIntervalLevel) - } - - if v.TimePeriod != nil { - ok := object.Key("TimePeriod") - if err := awsAwsjson11_serializeDocumentDateInterval(v.TimePeriod, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListCommitmentPurchaseAnalysesInput(v *ListCommitmentPurchaseAnalysesInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AnalysisIds != nil { - ok := object.Key("AnalysisIds") - if err := awsAwsjson11_serializeDocumentAnalysisIds(v.AnalysisIds, ok); err != nil { - return err - } - } - - if len(v.AnalysisStatus) > 0 { - ok := object.Key("AnalysisStatus") - ok.String(string(v.AnalysisStatus)) - } - - if v.NextPageToken != nil { - ok := object.Key("NextPageToken") - ok.String(*v.NextPageToken) - } - - if v.PageSize != 0 { - ok := object.Key("PageSize") - ok.Integer(v.PageSize) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListCostAllocationTagBackfillHistoryInput(v *ListCostAllocationTagBackfillHistoryInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListCostAllocationTagsInput(v *ListCostAllocationTagsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - if len(v.Status) > 0 { - ok := object.Key("Status") - ok.String(string(v.Status)) - } - - if v.TagKeys != nil { - ok := object.Key("TagKeys") - if err := awsAwsjson11_serializeDocumentCostAllocationTagKeyList(v.TagKeys, ok); err != nil { - return err - } - } - - if len(v.Type) > 0 { - ok := object.Key("Type") - ok.String(string(v.Type)) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListCostCategoryDefinitionsInput(v *ListCostCategoryDefinitionsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.EffectiveOn != nil { - ok := object.Key("EffectiveOn") - ok.String(*v.EffectiveOn) - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - if v.SupportedResourceTypes != nil { - ok := object.Key("SupportedResourceTypes") - if err := awsAwsjson11_serializeDocumentResourceTypesFilterInput(v.SupportedResourceTypes, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListCostCategoryResourceAssociationsInput(v *ListCostCategoryResourceAssociationsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.CostCategoryArn != nil { - ok := object.Key("CostCategoryArn") - ok.String(*v.CostCategoryArn) - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListSavingsPlansPurchaseRecommendationGenerationInput(v *ListSavingsPlansPurchaseRecommendationGenerationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.GenerationStatus) > 0 { - ok := object.Key("GenerationStatus") - ok.String(string(v.GenerationStatus)) - } - - if v.NextPageToken != nil { - ok := object.Key("NextPageToken") - ok.String(*v.NextPageToken) - } - - if v.PageSize != 0 { - ok := object.Key("PageSize") - ok.Integer(v.PageSize) - } - - if v.RecommendationIds != nil { - ok := object.Key("RecommendationIds") - if err := awsAwsjson11_serializeDocumentRecommendationIdList(v.RecommendationIds, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ResourceArn != nil { - ok := object.Key("ResourceArn") - ok.String(*v.ResourceArn) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentProvideAnomalyFeedbackInput(v *ProvideAnomalyFeedbackInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AnomalyId != nil { - ok := object.Key("AnomalyId") - ok.String(*v.AnomalyId) - } - - if len(v.Feedback) > 0 { - ok := object.Key("Feedback") - ok.String(string(v.Feedback)) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentStartCommitmentPurchaseAnalysisInput(v *StartCommitmentPurchaseAnalysisInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.CommitmentPurchaseAnalysisConfiguration != nil { - ok := object.Key("CommitmentPurchaseAnalysisConfiguration") - if err := awsAwsjson11_serializeDocumentCommitmentPurchaseAnalysisConfiguration(v.CommitmentPurchaseAnalysisConfiguration, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentStartCostAllocationTagBackfillInput(v *StartCostAllocationTagBackfillInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.BackfillFrom != nil { - ok := object.Key("BackfillFrom") - ok.String(*v.BackfillFrom) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentStartSavingsPlansPurchaseRecommendationGenerationInput(v *StartSavingsPlansPurchaseRecommendationGenerationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - return nil -} - -func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ResourceArn != nil { - ok := object.Key("ResourceArn") - ok.String(*v.ResourceArn) - } - - if v.ResourceTags != nil { - ok := object.Key("ResourceTags") - if err := awsAwsjson11_serializeDocumentResourceTagList(v.ResourceTags, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ResourceArn != nil { - ok := object.Key("ResourceArn") - ok.String(*v.ResourceArn) - } - - if v.ResourceTagKeys != nil { - ok := object.Key("ResourceTagKeys") - if err := awsAwsjson11_serializeDocumentResourceTagKeyList(v.ResourceTagKeys, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentUpdateAnomalyMonitorInput(v *UpdateAnomalyMonitorInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MonitorArn != nil { - ok := object.Key("MonitorArn") - ok.String(*v.MonitorArn) - } - - if v.MonitorName != nil { - ok := object.Key("MonitorName") - ok.String(*v.MonitorName) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentUpdateAnomalySubscriptionInput(v *UpdateAnomalySubscriptionInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.Frequency) > 0 { - ok := object.Key("Frequency") - ok.String(string(v.Frequency)) - } - - if v.MonitorArnList != nil { - ok := object.Key("MonitorArnList") - if err := awsAwsjson11_serializeDocumentMonitorArnList(v.MonitorArnList, ok); err != nil { - return err - } - } - - if v.Subscribers != nil { - ok := object.Key("Subscribers") - if err := awsAwsjson11_serializeDocumentSubscribers(v.Subscribers, ok); err != nil { - return err - } - } - - if v.SubscriptionArn != nil { - ok := object.Key("SubscriptionArn") - ok.String(*v.SubscriptionArn) - } - - if v.SubscriptionName != nil { - ok := object.Key("SubscriptionName") - ok.String(*v.SubscriptionName) - } - - if v.Threshold != nil { - ok := object.Key("Threshold") - switch { - case math.IsNaN(*v.Threshold): - ok.String("NaN") - - case math.IsInf(*v.Threshold, 1): - ok.String("Infinity") - - case math.IsInf(*v.Threshold, -1): - ok.String("-Infinity") - - default: - ok.Double(*v.Threshold) - - } - } - - if v.ThresholdExpression != nil { - ok := object.Key("ThresholdExpression") - if err := awsAwsjson11_serializeDocumentExpression(v.ThresholdExpression, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentUpdateCostAllocationTagsStatusInput(v *UpdateCostAllocationTagsStatusInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.CostAllocationTagsStatus != nil { - ok := object.Key("CostAllocationTagsStatus") - if err := awsAwsjson11_serializeDocumentCostAllocationTagStatusList(v.CostAllocationTagsStatus, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentUpdateCostCategoryDefinitionInput(v *UpdateCostCategoryDefinitionInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.CostCategoryArn != nil { - ok := object.Key("CostCategoryArn") - ok.String(*v.CostCategoryArn) - } - - if v.DefaultValue != nil { - ok := object.Key("DefaultValue") - ok.String(*v.DefaultValue) - } - - if v.EffectiveStart != nil { - ok := object.Key("EffectiveStart") - ok.String(*v.EffectiveStart) - } - - if v.Rules != nil { - ok := object.Key("Rules") - if err := awsAwsjson11_serializeDocumentCostCategoryRulesList(v.Rules, ok); err != nil { - return err - } - } - - if len(v.RuleVersion) > 0 { - ok := object.Key("RuleVersion") - ok.String(string(v.RuleVersion)) - } - - if v.SplitChargeRules != nil { - ok := object.Key("SplitChargeRules") - if err := awsAwsjson11_serializeDocumentCostCategorySplitChargeRulesList(v.SplitChargeRules, ok); err != nil { - return err - } - } - - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/types/enums.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/types/enums.go deleted file mode 100644 index 93123d85d1..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/types/enums.go +++ /dev/null @@ -1,938 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -type AccountScope string - -// Enum values for AccountScope -const ( - AccountScopePayer AccountScope = "PAYER" - AccountScopeLinked AccountScope = "LINKED" -) - -// Values returns all known values for AccountScope. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AccountScope) Values() []AccountScope { - return []AccountScope{ - "PAYER", - "LINKED", - } -} - -type AnalysisStatus string - -// Enum values for AnalysisStatus -const ( - AnalysisStatusSucceeded AnalysisStatus = "SUCCEEDED" - AnalysisStatusProcessing AnalysisStatus = "PROCESSING" - AnalysisStatusFailed AnalysisStatus = "FAILED" -) - -// Values returns all known values for AnalysisStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AnalysisStatus) Values() []AnalysisStatus { - return []AnalysisStatus{ - "SUCCEEDED", - "PROCESSING", - "FAILED", - } -} - -type AnalysisType string - -// Enum values for AnalysisType -const ( - AnalysisTypeMaxSavings AnalysisType = "MAX_SAVINGS" - AnalysisTypeCustomCommitment AnalysisType = "CUSTOM_COMMITMENT" -) - -// Values returns all known values for AnalysisType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AnalysisType) Values() []AnalysisType { - return []AnalysisType{ - "MAX_SAVINGS", - "CUSTOM_COMMITMENT", - } -} - -type AnomalyFeedbackType string - -// Enum values for AnomalyFeedbackType -const ( - AnomalyFeedbackTypeYes AnomalyFeedbackType = "YES" - AnomalyFeedbackTypeNo AnomalyFeedbackType = "NO" - AnomalyFeedbackTypePlannedActivity AnomalyFeedbackType = "PLANNED_ACTIVITY" -) - -// Values returns all known values for AnomalyFeedbackType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AnomalyFeedbackType) Values() []AnomalyFeedbackType { - return []AnomalyFeedbackType{ - "YES", - "NO", - "PLANNED_ACTIVITY", - } -} - -type AnomalySubscriptionFrequency string - -// Enum values for AnomalySubscriptionFrequency -const ( - AnomalySubscriptionFrequencyDaily AnomalySubscriptionFrequency = "DAILY" - AnomalySubscriptionFrequencyImmediate AnomalySubscriptionFrequency = "IMMEDIATE" - AnomalySubscriptionFrequencyWeekly AnomalySubscriptionFrequency = "WEEKLY" -) - -// Values returns all known values for AnomalySubscriptionFrequency. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AnomalySubscriptionFrequency) Values() []AnomalySubscriptionFrequency { - return []AnomalySubscriptionFrequency{ - "DAILY", - "IMMEDIATE", - "WEEKLY", - } -} - -type ApproximationDimension string - -// Enum values for ApproximationDimension -const ( - ApproximationDimensionService ApproximationDimension = "SERVICE" - ApproximationDimensionResource ApproximationDimension = "RESOURCE" -) - -// Values returns all known values for ApproximationDimension. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ApproximationDimension) Values() []ApproximationDimension { - return []ApproximationDimension{ - "SERVICE", - "RESOURCE", - } -} - -type Context string - -// Enum values for Context -const ( - ContextCostAndUsage Context = "COST_AND_USAGE" - ContextReservations Context = "RESERVATIONS" - ContextSavingsPlans Context = "SAVINGS_PLANS" -) - -// Values returns all known values for Context. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (Context) Values() []Context { - return []Context{ - "COST_AND_USAGE", - "RESERVATIONS", - "SAVINGS_PLANS", - } -} - -type CostAllocationTagBackfillStatus string - -// Enum values for CostAllocationTagBackfillStatus -const ( - CostAllocationTagBackfillStatusSucceeded CostAllocationTagBackfillStatus = "SUCCEEDED" - CostAllocationTagBackfillStatusProcessing CostAllocationTagBackfillStatus = "PROCESSING" - CostAllocationTagBackfillStatusFailed CostAllocationTagBackfillStatus = "FAILED" -) - -// Values returns all known values for CostAllocationTagBackfillStatus. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CostAllocationTagBackfillStatus) Values() []CostAllocationTagBackfillStatus { - return []CostAllocationTagBackfillStatus{ - "SUCCEEDED", - "PROCESSING", - "FAILED", - } -} - -type CostAllocationTagStatus string - -// Enum values for CostAllocationTagStatus -const ( - CostAllocationTagStatusActive CostAllocationTagStatus = "Active" - CostAllocationTagStatusInactive CostAllocationTagStatus = "Inactive" -) - -// Values returns all known values for CostAllocationTagStatus. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CostAllocationTagStatus) Values() []CostAllocationTagStatus { - return []CostAllocationTagStatus{ - "Active", - "Inactive", - } -} - -type CostAllocationTagType string - -// Enum values for CostAllocationTagType -const ( - CostAllocationTagTypeAwsGenerated CostAllocationTagType = "AWSGenerated" - CostAllocationTagTypeUserDefined CostAllocationTagType = "UserDefined" -) - -// Values returns all known values for CostAllocationTagType. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CostAllocationTagType) Values() []CostAllocationTagType { - return []CostAllocationTagType{ - "AWSGenerated", - "UserDefined", - } -} - -type CostCategoryInheritedValueDimensionName string - -// Enum values for CostCategoryInheritedValueDimensionName -const ( - CostCategoryInheritedValueDimensionNameLinkedAccountName CostCategoryInheritedValueDimensionName = "LINKED_ACCOUNT_NAME" - CostCategoryInheritedValueDimensionNameTag CostCategoryInheritedValueDimensionName = "TAG" -) - -// Values returns all known values for CostCategoryInheritedValueDimensionName. -// Note that this can be expanded in the future, and so it is only as up to date as -// the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CostCategoryInheritedValueDimensionName) Values() []CostCategoryInheritedValueDimensionName { - return []CostCategoryInheritedValueDimensionName{ - "LINKED_ACCOUNT_NAME", - "TAG", - } -} - -type CostCategoryRuleType string - -// Enum values for CostCategoryRuleType -const ( - CostCategoryRuleTypeRegular CostCategoryRuleType = "REGULAR" - CostCategoryRuleTypeInheritedValue CostCategoryRuleType = "INHERITED_VALUE" -) - -// Values returns all known values for CostCategoryRuleType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CostCategoryRuleType) Values() []CostCategoryRuleType { - return []CostCategoryRuleType{ - "REGULAR", - "INHERITED_VALUE", - } -} - -type CostCategoryRuleVersion string - -// Enum values for CostCategoryRuleVersion -const ( - CostCategoryRuleVersionCostCategoryExpressionV1 CostCategoryRuleVersion = "CostCategoryExpression.v1" -) - -// Values returns all known values for CostCategoryRuleVersion. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CostCategoryRuleVersion) Values() []CostCategoryRuleVersion { - return []CostCategoryRuleVersion{ - "CostCategoryExpression.v1", - } -} - -type CostCategorySplitChargeMethod string - -// Enum values for CostCategorySplitChargeMethod -const ( - CostCategorySplitChargeMethodFixed CostCategorySplitChargeMethod = "FIXED" - CostCategorySplitChargeMethodProportional CostCategorySplitChargeMethod = "PROPORTIONAL" - CostCategorySplitChargeMethodEven CostCategorySplitChargeMethod = "EVEN" -) - -// Values returns all known values for CostCategorySplitChargeMethod. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CostCategorySplitChargeMethod) Values() []CostCategorySplitChargeMethod { - return []CostCategorySplitChargeMethod{ - "FIXED", - "PROPORTIONAL", - "EVEN", - } -} - -type CostCategorySplitChargeRuleParameterType string - -// Enum values for CostCategorySplitChargeRuleParameterType -const ( - CostCategorySplitChargeRuleParameterTypeAllocationPercentages CostCategorySplitChargeRuleParameterType = "ALLOCATION_PERCENTAGES" -) - -// Values returns all known values for CostCategorySplitChargeRuleParameterType. -// Note that this can be expanded in the future, and so it is only as up to date as -// the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CostCategorySplitChargeRuleParameterType) Values() []CostCategorySplitChargeRuleParameterType { - return []CostCategorySplitChargeRuleParameterType{ - "ALLOCATION_PERCENTAGES", - } -} - -type CostCategoryStatus string - -// Enum values for CostCategoryStatus -const ( - CostCategoryStatusProcessing CostCategoryStatus = "PROCESSING" - CostCategoryStatusApplied CostCategoryStatus = "APPLIED" -) - -// Values returns all known values for CostCategoryStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CostCategoryStatus) Values() []CostCategoryStatus { - return []CostCategoryStatus{ - "PROCESSING", - "APPLIED", - } -} - -type CostCategoryStatusComponent string - -// Enum values for CostCategoryStatusComponent -const ( - CostCategoryStatusComponentCostExplorer CostCategoryStatusComponent = "COST_EXPLORER" -) - -// Values returns all known values for CostCategoryStatusComponent. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CostCategoryStatusComponent) Values() []CostCategoryStatusComponent { - return []CostCategoryStatusComponent{ - "COST_EXPLORER", - } -} - -type Dimension string - -// Enum values for Dimension -const ( - DimensionAz Dimension = "AZ" - DimensionInstanceType Dimension = "INSTANCE_TYPE" - DimensionLinkedAccount Dimension = "LINKED_ACCOUNT" - DimensionPayerAccount Dimension = "PAYER_ACCOUNT" - DimensionLinkedAccountName Dimension = "LINKED_ACCOUNT_NAME" - DimensionOperation Dimension = "OPERATION" - DimensionPurchaseType Dimension = "PURCHASE_TYPE" - DimensionRegion Dimension = "REGION" - DimensionService Dimension = "SERVICE" - DimensionServiceCode Dimension = "SERVICE_CODE" - DimensionUsageType Dimension = "USAGE_TYPE" - DimensionUsageTypeGroup Dimension = "USAGE_TYPE_GROUP" - DimensionRecordType Dimension = "RECORD_TYPE" - DimensionOperatingSystem Dimension = "OPERATING_SYSTEM" - DimensionTenancy Dimension = "TENANCY" - DimensionScope Dimension = "SCOPE" - DimensionPlatform Dimension = "PLATFORM" - DimensionSubscriptionId Dimension = "SUBSCRIPTION_ID" - DimensionLegalEntityName Dimension = "LEGAL_ENTITY_NAME" - DimensionDeploymentOption Dimension = "DEPLOYMENT_OPTION" - DimensionDatabaseEngine Dimension = "DATABASE_ENGINE" - DimensionCacheEngine Dimension = "CACHE_ENGINE" - DimensionInstanceTypeFamily Dimension = "INSTANCE_TYPE_FAMILY" - DimensionBillingEntity Dimension = "BILLING_ENTITY" - DimensionReservationId Dimension = "RESERVATION_ID" - DimensionResourceId Dimension = "RESOURCE_ID" - DimensionRightsizingType Dimension = "RIGHTSIZING_TYPE" - DimensionSavingsPlansType Dimension = "SAVINGS_PLANS_TYPE" - DimensionSavingsPlanArn Dimension = "SAVINGS_PLAN_ARN" - DimensionPaymentOption Dimension = "PAYMENT_OPTION" - DimensionAgreementEndDateTimeAfter Dimension = "AGREEMENT_END_DATE_TIME_AFTER" - DimensionAgreementEndDateTimeBefore Dimension = "AGREEMENT_END_DATE_TIME_BEFORE" - DimensionInvoicingEntity Dimension = "INVOICING_ENTITY" - DimensionAnomalyTotalImpactAbsolute Dimension = "ANOMALY_TOTAL_IMPACT_ABSOLUTE" - DimensionAnomalyTotalImpactPercentage Dimension = "ANOMALY_TOTAL_IMPACT_PERCENTAGE" -) - -// Values returns all known values for Dimension. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (Dimension) Values() []Dimension { - return []Dimension{ - "AZ", - "INSTANCE_TYPE", - "LINKED_ACCOUNT", - "PAYER_ACCOUNT", - "LINKED_ACCOUNT_NAME", - "OPERATION", - "PURCHASE_TYPE", - "REGION", - "SERVICE", - "SERVICE_CODE", - "USAGE_TYPE", - "USAGE_TYPE_GROUP", - "RECORD_TYPE", - "OPERATING_SYSTEM", - "TENANCY", - "SCOPE", - "PLATFORM", - "SUBSCRIPTION_ID", - "LEGAL_ENTITY_NAME", - "DEPLOYMENT_OPTION", - "DATABASE_ENGINE", - "CACHE_ENGINE", - "INSTANCE_TYPE_FAMILY", - "BILLING_ENTITY", - "RESERVATION_ID", - "RESOURCE_ID", - "RIGHTSIZING_TYPE", - "SAVINGS_PLANS_TYPE", - "SAVINGS_PLAN_ARN", - "PAYMENT_OPTION", - "AGREEMENT_END_DATE_TIME_AFTER", - "AGREEMENT_END_DATE_TIME_BEFORE", - "INVOICING_ENTITY", - "ANOMALY_TOTAL_IMPACT_ABSOLUTE", - "ANOMALY_TOTAL_IMPACT_PERCENTAGE", - } -} - -type ErrorCode string - -// Enum values for ErrorCode -const ( - ErrorCodeNoUsageFound ErrorCode = "NO_USAGE_FOUND" - ErrorCodeInternalFailure ErrorCode = "INTERNAL_FAILURE" - ErrorCodeInvalidSavingsPlansToAdd ErrorCode = "INVALID_SAVINGS_PLANS_TO_ADD" - ErrorCodeInvalidSavingsPlansToExclude ErrorCode = "INVALID_SAVINGS_PLANS_TO_EXCLUDE" - ErrorCodeInvalidAccountId ErrorCode = "INVALID_ACCOUNT_ID" -) - -// Values returns all known values for ErrorCode. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ErrorCode) Values() []ErrorCode { - return []ErrorCode{ - "NO_USAGE_FOUND", - "INTERNAL_FAILURE", - "INVALID_SAVINGS_PLANS_TO_ADD", - "INVALID_SAVINGS_PLANS_TO_EXCLUDE", - "INVALID_ACCOUNT_ID", - } -} - -type FindingReasonCode string - -// Enum values for FindingReasonCode -const ( - FindingReasonCodeCpuOverProvisioned FindingReasonCode = "CPU_OVER_PROVISIONED" - FindingReasonCodeCpuUnderProvisioned FindingReasonCode = "CPU_UNDER_PROVISIONED" - FindingReasonCodeMemoryOverProvisioned FindingReasonCode = "MEMORY_OVER_PROVISIONED" - FindingReasonCodeMemoryUnderProvisioned FindingReasonCode = "MEMORY_UNDER_PROVISIONED" - FindingReasonCodeEbsThroughputOverProvisioned FindingReasonCode = "EBS_THROUGHPUT_OVER_PROVISIONED" - FindingReasonCodeEbsThroughputUnderProvisioned FindingReasonCode = "EBS_THROUGHPUT_UNDER_PROVISIONED" - FindingReasonCodeEbsIopsOverProvisioned FindingReasonCode = "EBS_IOPS_OVER_PROVISIONED" - FindingReasonCodeEbsIopsUnderProvisioned FindingReasonCode = "EBS_IOPS_UNDER_PROVISIONED" - FindingReasonCodeNetworkBandwidthOverProvisioned FindingReasonCode = "NETWORK_BANDWIDTH_OVER_PROVISIONED" - FindingReasonCodeNetworkBandwidthUnderProvisioned FindingReasonCode = "NETWORK_BANDWIDTH_UNDER_PROVISIONED" - FindingReasonCodeNetworkPpsOverProvisioned FindingReasonCode = "NETWORK_PPS_OVER_PROVISIONED" - FindingReasonCodeNetworkPpsUnderProvisioned FindingReasonCode = "NETWORK_PPS_UNDER_PROVISIONED" - FindingReasonCodeDiskIopsOverProvisioned FindingReasonCode = "DISK_IOPS_OVER_PROVISIONED" - FindingReasonCodeDiskIopsUnderProvisioned FindingReasonCode = "DISK_IOPS_UNDER_PROVISIONED" - FindingReasonCodeDiskThroughputOverProvisioned FindingReasonCode = "DISK_THROUGHPUT_OVER_PROVISIONED" - FindingReasonCodeDiskThroughputUnderProvisioned FindingReasonCode = "DISK_THROUGHPUT_UNDER_PROVISIONED" -) - -// Values returns all known values for FindingReasonCode. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (FindingReasonCode) Values() []FindingReasonCode { - return []FindingReasonCode{ - "CPU_OVER_PROVISIONED", - "CPU_UNDER_PROVISIONED", - "MEMORY_OVER_PROVISIONED", - "MEMORY_UNDER_PROVISIONED", - "EBS_THROUGHPUT_OVER_PROVISIONED", - "EBS_THROUGHPUT_UNDER_PROVISIONED", - "EBS_IOPS_OVER_PROVISIONED", - "EBS_IOPS_UNDER_PROVISIONED", - "NETWORK_BANDWIDTH_OVER_PROVISIONED", - "NETWORK_BANDWIDTH_UNDER_PROVISIONED", - "NETWORK_PPS_OVER_PROVISIONED", - "NETWORK_PPS_UNDER_PROVISIONED", - "DISK_IOPS_OVER_PROVISIONED", - "DISK_IOPS_UNDER_PROVISIONED", - "DISK_THROUGHPUT_OVER_PROVISIONED", - "DISK_THROUGHPUT_UNDER_PROVISIONED", - } -} - -type GenerationStatus string - -// Enum values for GenerationStatus -const ( - GenerationStatusSucceeded GenerationStatus = "SUCCEEDED" - GenerationStatusProcessing GenerationStatus = "PROCESSING" - GenerationStatusFailed GenerationStatus = "FAILED" -) - -// Values returns all known values for GenerationStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (GenerationStatus) Values() []GenerationStatus { - return []GenerationStatus{ - "SUCCEEDED", - "PROCESSING", - "FAILED", - } -} - -type Granularity string - -// Enum values for Granularity -const ( - GranularityDaily Granularity = "DAILY" - GranularityMonthly Granularity = "MONTHLY" - GranularityHourly Granularity = "HOURLY" -) - -// Values returns all known values for Granularity. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (Granularity) Values() []Granularity { - return []Granularity{ - "DAILY", - "MONTHLY", - "HOURLY", - } -} - -type GroupDefinitionType string - -// Enum values for GroupDefinitionType -const ( - GroupDefinitionTypeDimension GroupDefinitionType = "DIMENSION" - GroupDefinitionTypeTag GroupDefinitionType = "TAG" - GroupDefinitionTypeCostCategory GroupDefinitionType = "COST_CATEGORY" -) - -// Values returns all known values for GroupDefinitionType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (GroupDefinitionType) Values() []GroupDefinitionType { - return []GroupDefinitionType{ - "DIMENSION", - "TAG", - "COST_CATEGORY", - } -} - -type LookbackPeriodInDays string - -// Enum values for LookbackPeriodInDays -const ( - LookbackPeriodInDaysSevenDays LookbackPeriodInDays = "SEVEN_DAYS" - LookbackPeriodInDaysThirtyDays LookbackPeriodInDays = "THIRTY_DAYS" - LookbackPeriodInDaysSixtyDays LookbackPeriodInDays = "SIXTY_DAYS" -) - -// Values returns all known values for LookbackPeriodInDays. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (LookbackPeriodInDays) Values() []LookbackPeriodInDays { - return []LookbackPeriodInDays{ - "SEVEN_DAYS", - "THIRTY_DAYS", - "SIXTY_DAYS", - } -} - -type MatchOption string - -// Enum values for MatchOption -const ( - MatchOptionEquals MatchOption = "EQUALS" - MatchOptionAbsent MatchOption = "ABSENT" - MatchOptionStartsWith MatchOption = "STARTS_WITH" - MatchOptionEndsWith MatchOption = "ENDS_WITH" - MatchOptionContains MatchOption = "CONTAINS" - MatchOptionCaseSensitive MatchOption = "CASE_SENSITIVE" - MatchOptionCaseInsensitive MatchOption = "CASE_INSENSITIVE" - MatchOptionGreaterThanOrEqual MatchOption = "GREATER_THAN_OR_EQUAL" -) - -// Values returns all known values for MatchOption. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (MatchOption) Values() []MatchOption { - return []MatchOption{ - "EQUALS", - "ABSENT", - "STARTS_WITH", - "ENDS_WITH", - "CONTAINS", - "CASE_SENSITIVE", - "CASE_INSENSITIVE", - "GREATER_THAN_OR_EQUAL", - } -} - -type Metric string - -// Enum values for Metric -const ( - MetricBlendedCost Metric = "BLENDED_COST" - MetricUnblendedCost Metric = "UNBLENDED_COST" - MetricAmortizedCost Metric = "AMORTIZED_COST" - MetricNetUnblendedCost Metric = "NET_UNBLENDED_COST" - MetricNetAmortizedCost Metric = "NET_AMORTIZED_COST" - MetricUsageQuantity Metric = "USAGE_QUANTITY" - MetricNormalizedUsageAmount Metric = "NORMALIZED_USAGE_AMOUNT" -) - -// Values returns all known values for Metric. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (Metric) Values() []Metric { - return []Metric{ - "BLENDED_COST", - "UNBLENDED_COST", - "AMORTIZED_COST", - "NET_UNBLENDED_COST", - "NET_AMORTIZED_COST", - "USAGE_QUANTITY", - "NORMALIZED_USAGE_AMOUNT", - } -} - -type MonitorDimension string - -// Enum values for MonitorDimension -const ( - MonitorDimensionService MonitorDimension = "SERVICE" - MonitorDimensionLinkedAccount MonitorDimension = "LINKED_ACCOUNT" - MonitorDimensionTag MonitorDimension = "TAG" - MonitorDimensionCostCategory MonitorDimension = "COST_CATEGORY" -) - -// Values returns all known values for MonitorDimension. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (MonitorDimension) Values() []MonitorDimension { - return []MonitorDimension{ - "SERVICE", - "LINKED_ACCOUNT", - "TAG", - "COST_CATEGORY", - } -} - -type MonitorType string - -// Enum values for MonitorType -const ( - MonitorTypeDimensional MonitorType = "DIMENSIONAL" - MonitorTypeCustom MonitorType = "CUSTOM" -) - -// Values returns all known values for MonitorType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (MonitorType) Values() []MonitorType { - return []MonitorType{ - "DIMENSIONAL", - "CUSTOM", - } -} - -type NumericOperator string - -// Enum values for NumericOperator -const ( - NumericOperatorEqual NumericOperator = "EQUAL" - NumericOperatorGreaterThanOrEqual NumericOperator = "GREATER_THAN_OR_EQUAL" - NumericOperatorLessThanOrEqual NumericOperator = "LESS_THAN_OR_EQUAL" - NumericOperatorGreaterThan NumericOperator = "GREATER_THAN" - NumericOperatorLessThan NumericOperator = "LESS_THAN" - NumericOperatorBetween NumericOperator = "BETWEEN" -) - -// Values returns all known values for NumericOperator. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (NumericOperator) Values() []NumericOperator { - return []NumericOperator{ - "EQUAL", - "GREATER_THAN_OR_EQUAL", - "LESS_THAN_OR_EQUAL", - "GREATER_THAN", - "LESS_THAN", - "BETWEEN", - } -} - -type OfferingClass string - -// Enum values for OfferingClass -const ( - OfferingClassStandard OfferingClass = "STANDARD" - OfferingClassConvertible OfferingClass = "CONVERTIBLE" -) - -// Values returns all known values for OfferingClass. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (OfferingClass) Values() []OfferingClass { - return []OfferingClass{ - "STANDARD", - "CONVERTIBLE", - } -} - -type PaymentOption string - -// Enum values for PaymentOption -const ( - PaymentOptionNoUpfront PaymentOption = "NO_UPFRONT" - PaymentOptionPartialUpfront PaymentOption = "PARTIAL_UPFRONT" - PaymentOptionAllUpfront PaymentOption = "ALL_UPFRONT" - PaymentOptionLightUtilization PaymentOption = "LIGHT_UTILIZATION" - PaymentOptionMediumUtilization PaymentOption = "MEDIUM_UTILIZATION" - PaymentOptionHeavyUtilization PaymentOption = "HEAVY_UTILIZATION" -) - -// Values returns all known values for PaymentOption. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (PaymentOption) Values() []PaymentOption { - return []PaymentOption{ - "NO_UPFRONT", - "PARTIAL_UPFRONT", - "ALL_UPFRONT", - "LIGHT_UTILIZATION", - "MEDIUM_UTILIZATION", - "HEAVY_UTILIZATION", - } -} - -type PlatformDifference string - -// Enum values for PlatformDifference -const ( - PlatformDifferenceHypervisor PlatformDifference = "HYPERVISOR" - PlatformDifferenceNetworkInterface PlatformDifference = "NETWORK_INTERFACE" - PlatformDifferenceStorageInterface PlatformDifference = "STORAGE_INTERFACE" - PlatformDifferenceInstanceStoreAvailability PlatformDifference = "INSTANCE_STORE_AVAILABILITY" - PlatformDifferenceVirtualizationType PlatformDifference = "VIRTUALIZATION_TYPE" -) - -// Values returns all known values for PlatformDifference. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (PlatformDifference) Values() []PlatformDifference { - return []PlatformDifference{ - "HYPERVISOR", - "NETWORK_INTERFACE", - "STORAGE_INTERFACE", - "INSTANCE_STORE_AVAILABILITY", - "VIRTUALIZATION_TYPE", - } -} - -type RecommendationTarget string - -// Enum values for RecommendationTarget -const ( - RecommendationTargetSameInstanceFamily RecommendationTarget = "SAME_INSTANCE_FAMILY" - RecommendationTargetCrossInstanceFamily RecommendationTarget = "CROSS_INSTANCE_FAMILY" -) - -// Values returns all known values for RecommendationTarget. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RecommendationTarget) Values() []RecommendationTarget { - return []RecommendationTarget{ - "SAME_INSTANCE_FAMILY", - "CROSS_INSTANCE_FAMILY", - } -} - -type RightsizingType string - -// Enum values for RightsizingType -const ( - RightsizingTypeTerminate RightsizingType = "TERMINATE" - RightsizingTypeModify RightsizingType = "MODIFY" -) - -// Values returns all known values for RightsizingType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (RightsizingType) Values() []RightsizingType { - return []RightsizingType{ - "TERMINATE", - "MODIFY", - } -} - -type SavingsPlansDataType string - -// Enum values for SavingsPlansDataType -const ( - SavingsPlansDataTypeAttributes SavingsPlansDataType = "ATTRIBUTES" - SavingsPlansDataTypeUtilization SavingsPlansDataType = "UTILIZATION" - SavingsPlansDataTypeAmortizedCommitment SavingsPlansDataType = "AMORTIZED_COMMITMENT" - SavingsPlansDataTypeSavings SavingsPlansDataType = "SAVINGS" -) - -// Values returns all known values for SavingsPlansDataType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SavingsPlansDataType) Values() []SavingsPlansDataType { - return []SavingsPlansDataType{ - "ATTRIBUTES", - "UTILIZATION", - "AMORTIZED_COMMITMENT", - "SAVINGS", - } -} - -type SortOrder string - -// Enum values for SortOrder -const ( - SortOrderAscending SortOrder = "ASCENDING" - SortOrderDescending SortOrder = "DESCENDING" -) - -// Values returns all known values for SortOrder. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SortOrder) Values() []SortOrder { - return []SortOrder{ - "ASCENDING", - "DESCENDING", - } -} - -type SubscriberStatus string - -// Enum values for SubscriberStatus -const ( - SubscriberStatusConfirmed SubscriberStatus = "CONFIRMED" - SubscriberStatusDeclined SubscriberStatus = "DECLINED" -) - -// Values returns all known values for SubscriberStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SubscriberStatus) Values() []SubscriberStatus { - return []SubscriberStatus{ - "CONFIRMED", - "DECLINED", - } -} - -type SubscriberType string - -// Enum values for SubscriberType -const ( - SubscriberTypeEmail SubscriberType = "EMAIL" - SubscriberTypeSns SubscriberType = "SNS" -) - -// Values returns all known values for SubscriberType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SubscriberType) Values() []SubscriberType { - return []SubscriberType{ - "EMAIL", - "SNS", - } -} - -type SupportedSavingsPlansType string - -// Enum values for SupportedSavingsPlansType -const ( - SupportedSavingsPlansTypeComputeSp SupportedSavingsPlansType = "COMPUTE_SP" - SupportedSavingsPlansTypeEc2InstanceSp SupportedSavingsPlansType = "EC2_INSTANCE_SP" - SupportedSavingsPlansTypeSagemakerSp SupportedSavingsPlansType = "SAGEMAKER_SP" - SupportedSavingsPlansTypeDatabaseSp SupportedSavingsPlansType = "DATABASE_SP" -) - -// Values returns all known values for SupportedSavingsPlansType. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (SupportedSavingsPlansType) Values() []SupportedSavingsPlansType { - return []SupportedSavingsPlansType{ - "COMPUTE_SP", - "EC2_INSTANCE_SP", - "SAGEMAKER_SP", - "DATABASE_SP", - } -} - -type TermInYears string - -// Enum values for TermInYears -const ( - TermInYearsOneYear TermInYears = "ONE_YEAR" - TermInYearsThreeYears TermInYears = "THREE_YEARS" -) - -// Values returns all known values for TermInYears. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TermInYears) Values() []TermInYears { - return []TermInYears{ - "ONE_YEAR", - "THREE_YEARS", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/types/errors.go deleted file mode 100644 index d376b74a0e..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/types/errors.go +++ /dev/null @@ -1,412 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - "fmt" - smithy "github.com/aws/smithy-go" -) - -// The requested analysis can't be found. -type AnalysisNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *AnalysisNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *AnalysisNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *AnalysisNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "AnalysisNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *AnalysisNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// A request to backfill is already in progress. Once the previous request is -// -// complete, you can create another request. -type BackfillLimitExceededException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *BackfillLimitExceededException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *BackfillLimitExceededException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *BackfillLimitExceededException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "BackfillLimitExceededException" - } - return *e.ErrorCodeOverride -} -func (e *BackfillLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The requested report expired. Update the date interval and try again. -type BillExpirationException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *BillExpirationException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *BillExpirationException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *BillExpirationException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "BillExpirationException" - } - return *e.ErrorCodeOverride -} -func (e *BillExpirationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The billing view status must be HEALTHY to perform this action. Try again when -// -// the status is HEALTHY . -type BillingViewHealthStatusException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *BillingViewHealthStatusException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *BillingViewHealthStatusException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *BillingViewHealthStatusException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "BillingViewHealthStatusException" - } - return *e.ErrorCodeOverride -} -func (e *BillingViewHealthStatusException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The requested data is unavailable. -type DataUnavailableException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *DataUnavailableException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *DataUnavailableException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *DataUnavailableException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "DataUnavailableException" - } - return *e.ErrorCodeOverride -} -func (e *DataUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// A request to generate a recommendation or analysis is already in progress. -type GenerationExistsException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *GenerationExistsException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *GenerationExistsException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *GenerationExistsException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "GenerationExistsException" - } - return *e.ErrorCodeOverride -} -func (e *GenerationExistsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The pagination token is invalid. Try again without a pagination token. -type InvalidNextTokenException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *InvalidNextTokenException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InvalidNextTokenException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InvalidNextTokenException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InvalidNextTokenException" - } - return *e.ErrorCodeOverride -} -func (e *InvalidNextTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// You made too many calls in a short period of time. Try again later. -type LimitExceededException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *LimitExceededException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *LimitExceededException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *LimitExceededException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "LimitExceededException" - } - return *e.ErrorCodeOverride -} -func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Your request parameters changed between pages. Try again with the old -// parameters or without a pagination token. -type RequestChangedException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *RequestChangedException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *RequestChangedException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *RequestChangedException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "RequestChangedException" - } - return *e.ErrorCodeOverride -} -func (e *RequestChangedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The specified ARN in the request doesn't exist. -type ResourceNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - ResourceName *string - - noSmithyDocumentSerde -} - -func (e *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ResourceNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ResourceNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ResourceNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// You've reached the limit on the number of resources you can create, or -// -// exceeded the size of an individual resource. -type ServiceQuotaExceededException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *ServiceQuotaExceededException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ServiceQuotaExceededException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ServiceQuotaExceededException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ServiceQuotaExceededException" - } - return *e.ErrorCodeOverride -} -func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Can occur if you specify a number of tags for a resource greater than the -// maximum 50 user tags per resource. -type TooManyTagsException struct { - Message *string - - ErrorCodeOverride *string - - ResourceName *string - - noSmithyDocumentSerde -} - -func (e *TooManyTagsException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *TooManyTagsException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *TooManyTagsException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "TooManyTagsException" - } - return *e.ErrorCodeOverride -} -func (e *TooManyTagsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The cost anomaly monitor does not exist for the account. -type UnknownMonitorException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *UnknownMonitorException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *UnknownMonitorException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *UnknownMonitorException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "UnknownMonitorException" - } - return *e.ErrorCodeOverride -} -func (e *UnknownMonitorException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The cost anomaly subscription does not exist for the account. -type UnknownSubscriptionException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *UnknownSubscriptionException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *UnknownSubscriptionException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *UnknownSubscriptionException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "UnknownSubscriptionException" - } - return *e.ErrorCodeOverride -} -func (e *UnknownSubscriptionException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Cost Explorer was unable to identify the usage unit. Provide -// UsageType/UsageTypeGroup filter selections that contain matching units, for -// example: hours . -type UnresolvableUsageUnitException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *UnresolvableUsageUnitException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *UnresolvableUsageUnitException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *UnresolvableUsageUnitException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "UnresolvableUsageUnitException" - } - return *e.ErrorCodeOverride -} -func (e *UnresolvableUsageUnitException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/types/types.go deleted file mode 100644 index 78dd2556a8..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/types/types.go +++ /dev/null @@ -1,2870 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - smithydocument "github.com/aws/smithy-go/document" -) - -// Details about the analysis. -type AnalysisDetails struct { - - // Details about the Savings Plans purchase analysis. - SavingsPlansPurchaseAnalysisDetails *SavingsPlansPurchaseAnalysisDetails - - noSmithyDocumentSerde -} - -// A summary of the analysis. -type AnalysisSummary struct { - - // The completion time of the analysis. - AnalysisCompletionTime *string - - // The analysis ID that's associated with the commitment purchase analysis. - AnalysisId *string - - // The start time of the analysis. - AnalysisStartedTime *string - - // The status of the analysis. - AnalysisStatus AnalysisStatus - - // The configuration for the commitment purchase analysis. - CommitmentPurchaseAnalysisConfiguration *CommitmentPurchaseAnalysisConfiguration - - // The error code used for the analysis. - ErrorCode ErrorCode - - // The estimated time for when the analysis will complete. - EstimatedCompletionTime *string - - noSmithyDocumentSerde -} - -// An unusual cost pattern. This consists of the detailed metadata and the current -// status of the anomaly object. -type Anomaly struct { - - // The unique identifier for the anomaly. - // - // This member is required. - AnomalyId *string - - // The latest and maximum score for the anomaly. - // - // This member is required. - AnomalyScore *AnomalyScore - - // The dollar impact for the anomaly. - // - // This member is required. - Impact *Impact - - // The Amazon Resource Name (ARN) for the cost monitor that generated this - // anomaly. - // - // This member is required. - MonitorArn *string - - // The last day the anomaly is detected. - AnomalyEndDate *string - - // The first day the anomaly is detected. - AnomalyStartDate *string - - // The dimension for the anomaly (for example, an Amazon Web Services service in a - // service monitor). - DimensionValue *string - - // The feedback value. - Feedback AnomalyFeedbackType - - // The list of identified root causes for the anomaly. - RootCauses []RootCause - - noSmithyDocumentSerde -} - -// The time period for an anomaly. -type AnomalyDateInterval struct { - - // The first date an anomaly was observed. - // - // This member is required. - StartDate *string - - // The last date an anomaly was observed. - EndDate *string - - noSmithyDocumentSerde -} - -// This object continuously inspects your account's cost data for anomalies. It's -// based on MonitorType and MonitorSpecification . The content consists of detailed -// metadata and the current status of the monitor object. -type AnomalyMonitor struct { - - // The name of the monitor. - // - // This member is required. - MonitorName *string - - // The type of the monitor. - // - // Set this to DIMENSIONAL for an Amazon Web Services managed monitor. Amazon Web - // Services managed monitors automatically track up to the top 5,000 values by cost - // within a dimension of your choosing. Each dimension value is evaluated - // independently. If you start incurring cost in a new value of your chosen - // dimension, it will automatically be analyzed by an Amazon Web Services managed - // monitor. - // - // Set this to CUSTOM for a customer managed monitor. Customer managed monitors - // let you select specific dimension values that get monitored in aggregate. - // - // For more information about monitor types, see [Monitor types] in the Billing and Cost - // Management User Guide. - // - // [Monitor types]: https://docs.aws.amazon.com/cost-management/latest/userguide/getting-started-ad.html#monitor-type-def - // - // This member is required. - MonitorType MonitorType - - // The date when the monitor was created. - CreationDate *string - - // The value for evaluated dimensions. - DimensionalValueCount int32 - - // The date when the monitor last evaluated for anomalies. - LastEvaluatedDate *string - - // The date when the monitor was last updated. - LastUpdatedDate *string - - // The Amazon Resource Name (ARN) value. - MonitorArn *string - - // For customer managed monitors, do not specify this field. - // - // For Amazon Web Services managed monitors, this field controls which cost - // dimension is automatically analyzed by the monitor. For TAG and COST_CATEGORY - // dimensions, you must also specify MonitorSpecification to configure the specific - // tag or cost category key to analyze. - MonitorDimension MonitorDimension - - // An [Expression] object used to control what costs the monitor analyzes for anomalies. - // - // For Amazon Web Services managed monitors: - // - // - If MonitorDimension is SERVICE or LINKED_ACCOUNT , do not specify this field - // - // - If MonitorDimension is TAG , set this field to { "Tags": { "Key": "your tag - // key" } } - // - // - If MonitorDimension is COST_CATEGORY , set this field to { - // "CostCategories": { "Key": "your cost category key" } } - // - // For customer managed monitors: - // - // - To track linked accounts, set this field to { "Dimensions": { "Key": - // "LINKED_ACCOUNT", "Values": [ "your list of up to 10 account IDs" ] } } - // - // - To track cost allocation tags, set this field to { "Tags": { "Key": "your - // tag key", "Values": [ "your list of up to 10 tag values" ] } } - // - // - To track cost categories, set this field to { "CostCategories": { "Key": - // "your cost category key", "Values": [ "your cost category value" ] } } - // - // [Expression]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html - MonitorSpecification *Expression - - noSmithyDocumentSerde -} - -// Quantifies the anomaly. The higher score means that it's more anomalous. -type AnomalyScore struct { - - // The last observed score. - // - // This member is required. - CurrentScore float64 - - // The maximum score that's observed during the AnomalyDateInterval . - // - // This member is required. - MaxScore float64 - - noSmithyDocumentSerde -} - -// An AnomalySubscription resource (also referred to as an alert subscription) -// sends notifications about specific anomalies that meet an alerting criteria -// defined by you. -// -// You can specify the frequency of the alerts and the subscribers to notify. -// -// Anomaly subscriptions can be associated with one or more [AnomalyMonitor]AnomalyMonitor -// resources, and they only send notifications about anomalies detected by those -// associated monitors. You can also configure a threshold to further control which -// anomalies are included in the notifications. -// -// Anomalies that don’t exceed the chosen threshold and therefore don’t trigger -// notifications from an anomaly subscription will still be available on the -// console and from the [GetAnomalies]GetAnomalies API. -// -// [AnomalyMonitor]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_AnomalyMonitor.html -// [GetAnomalies]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_GetAnomalies.html -type AnomalySubscription struct { - - // The frequency that anomaly notifications are sent. Notifications are sent - // either over email (for DAILY and WEEKLY frequencies) or SNS (for IMMEDIATE - // frequency). For more information, see [Creating an Amazon SNS topic for anomaly notifications]. - // - // [Creating an Amazon SNS topic for anomaly notifications]: https://docs.aws.amazon.com/cost-management/latest/userguide/ad-SNS.html - // - // This member is required. - Frequency AnomalySubscriptionFrequency - - // A list of cost anomaly monitors. - // - // This member is required. - MonitorArnList []string - - // A list of subscribers to notify. - // - // This member is required. - Subscribers []Subscriber - - // The name for the subscription. - // - // This member is required. - SubscriptionName *string - - // Your unique account identifier. - AccountId *string - - // The AnomalySubscription Amazon Resource Name (ARN). - SubscriptionArn *string - - // (deprecated) - // - // An absolute dollar value that must be exceeded by the anomaly's total impact - // (see [Impact]for more details) for an anomaly notification to be generated. - // - // This field has been deprecated. To specify a threshold, use - // ThresholdExpression. Continued use of Threshold will be treated as shorthand - // syntax for a ThresholdExpression. - // - // One of Threshold or ThresholdExpression is required for this resource. You - // cannot specify both. - // - // [Impact]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Impact.html - // - // Deprecated: Threshold has been deprecated in favor of ThresholdExpression - Threshold *float64 - - // An [Expression] object used to specify the anomalies that you want to generate alerts for. - // This supports dimensions and nested expressions. The supported dimensions are - // ANOMALY_TOTAL_IMPACT_ABSOLUTE and ANOMALY_TOTAL_IMPACT_PERCENTAGE , - // corresponding to an anomaly’s TotalImpact and TotalImpactPercentage, - // respectively (see [Impact]for more details). The supported nested expression types are - // AND and OR . The match option GREATER_THAN_OR_EQUAL is required. Values must be - // numbers between 0 and 10,000,000,000 in string format. - // - // One of Threshold or ThresholdExpression is required for this resource. You - // cannot specify both. - // - // The following are examples of valid ThresholdExpressions: - // - // - Absolute threshold: { "Dimensions": { "Key": - // "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], - // "Values": [ "100" ] } } - // - // - Percentage threshold: { "Dimensions": { "Key": - // "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], - // "Values": [ "100" ] } } - // - // - AND two thresholds together: { "And": [ { "Dimensions": { "Key": - // "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], - // "Values": [ "100" ] } }, { "Dimensions": { "Key": - // "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], - // "Values": [ "100" ] } } ] } - // - // - OR two thresholds together: { "Or": [ { "Dimensions": { "Key": - // "ANOMALY_TOTAL_IMPACT_ABSOLUTE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], - // "Values": [ "100" ] } }, { "Dimensions": { "Key": - // "ANOMALY_TOTAL_IMPACT_PERCENTAGE", "MatchOptions": [ "GREATER_THAN_OR_EQUAL" ], - // "Values": [ "100" ] } } ] } - // - // [Impact]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Impact.html - // [Expression]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html - ThresholdExpression *Expression - - noSmithyDocumentSerde -} - -// The configuration for the commitment purchase analysis. -type CommitmentPurchaseAnalysisConfiguration struct { - - // The configuration for the Savings Plans purchase analysis. - SavingsPlansPurchaseAnalysisConfiguration *SavingsPlansPurchaseAnalysisConfiguration - - noSmithyDocumentSerde -} - -// Contains cost or usage metric values for comparing two time periods. Each value -// includes amounts for the baseline and comparison time periods, their difference, -// and the unit of measurement. -type ComparisonMetricValue struct { - - // The numeric value for the baseline time period measurement. - BaselineTimePeriodAmount *string - - // The numeric value for the comparison time period measurement. - ComparisonTimePeriodAmount *string - - // The calculated difference between ComparisonTimePeriodAmount and - // BaselineTimePeriodAmount . - Difference *string - - // The unit of measurement applicable to all numeric values in this comparison. - Unit *string - - noSmithyDocumentSerde -} - -// The cost allocation tag structure. This includes detailed metadata for the -// CostAllocationTag object. -type CostAllocationTag struct { - - // The status of a cost allocation tag. - // - // This member is required. - Status CostAllocationTagStatus - - // The key for the cost allocation tag. - // - // This member is required. - TagKey *string - - // The type of cost allocation tag. You can use AWSGenerated or UserDefined type - // tags. AWSGenerated type tags are tags that Amazon Web Services defines and - // applies to support Amazon Web Services resources for cost allocation purposes. - // UserDefined type tags are tags that you define, create, and apply to resources. - // - // This member is required. - Type CostAllocationTagType - - // The last date that the tag was either activated or deactivated. - LastUpdatedDate *string - - // The last month that the tag was used on an Amazon Web Services resource. - LastUsedDate *string - - noSmithyDocumentSerde -} - -// The cost allocation tag backfill request structure that contains metadata and -// -// details of a certain backfill. -type CostAllocationTagBackfillRequest struct { - - // The date the backfill starts from. - BackfillFrom *string - - // The status of the cost allocation tag backfill request. - BackfillStatus CostAllocationTagBackfillStatus - - // The backfill completion time. - CompletedAt *string - - // The time when the backfill status was last updated. - LastUpdatedAt *string - - // The time when the backfill was requested. - RequestedAt *string - - noSmithyDocumentSerde -} - -// The cost allocation tag status. The status of a key can either be active or -// inactive. -type CostAllocationTagStatusEntry struct { - - // The status of a cost allocation tag. - // - // This member is required. - Status CostAllocationTagStatus - - // The key for the cost allocation tag. - // - // This member is required. - TagKey *string - - noSmithyDocumentSerde -} - -// Represents a comparison of cost and usage metrics between two time periods. -type CostAndUsageComparison struct { - - // Use Expression to filter in various Cost Explorer APIs. - // - // Not all Expression types are supported in each API. Refer to the documentation - // for each specific API to see what is supported. - // - // There are two patterns: - // - // - Simple dimension values. - // - // - There are three types of simple dimension values: CostCategories , Tags , - // and Dimensions . - // - // - Specify the CostCategories field to define a filter that acts on Cost - // Categories. - // - // - Specify the Tags field to define a filter that acts on Cost Allocation Tags. - // - // - Specify the Dimensions field to define a filter that acts on the [DimensionValues] - // DimensionValues . - // - // - For each filter type, you can set the dimension name and values for the - // filters that you plan to use. - // - // - For example, you can filter for REGION==us-east-1 OR REGION==us-west-1 . For - // GetRightsizingRecommendation , the Region is a full name (for example, - // REGION==US East (N. Virginia) . - // - // - The corresponding Expression for this example is as follows: { - // "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] } } - // - // - As shown in the previous example, lists of dimension values are combined - // with OR when applying the filter. - // - // - You can also set different match options to further control how the filter - // behaves. Not all APIs support match options. Refer to the documentation for each - // specific API to see what is supported. - // - // - For example, you can filter for linked account names that start with "a". - // - // - The corresponding Expression for this example is as follows: { - // "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": [ "STARTS_WITH" ], - // "Values": [ "a" ] } } - // - // - Compound Expression types with logical operations. - // - // - You can use multiple Expression types and the logical operators AND/OR/NOT - // to create a list of one or more Expression objects. By doing this, you can - // filter by more advanced options. - // - // - For example, you can filter by ((REGION == us-east-1 OR REGION == - // us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer) . - // - // - The corresponding Expression for this example is as follows: { "And": [ - // {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" - // ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": - // {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] } - // - // Because each Expression can have only one operator, the service returns an error - // if more than one is specified. The following example shows an Expression - // object that creates an error: { "And": [ ... ], "Dimensions": { "Key": - // "USAGE_TYPE", "Values": [ "DataTransfer" ] } } - // - // The following is an example of the corresponding error message: "Expression has - // more than one roots. Only one root operator is allowed for each expression: And, - // Or, Not, Dimensions, Tags, CostCategories" - // - // For the GetRightsizingRecommendation action, a combination of OR and NOT isn't - // supported. OR isn't supported between different dimensions, or dimensions and - // tags. NOT operators aren't supported. Dimensions are also limited to - // LINKED_ACCOUNT , REGION , or RIGHTSIZING_TYPE . - // - // For the GetReservationPurchaseRecommendation action, only NOT is supported. AND - // and OR aren't supported. Dimensions are limited to LINKED_ACCOUNT . - // - // [DimensionValues]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html - CostAndUsageSelector *Expression - - // A mapping of metric names to their comparison values. - Metrics map[string]ComparisonMetricValue - - noSmithyDocumentSerde -} - -// The structure of Cost Categories. This includes detailed metadata and the set -// of rules for the CostCategory object. -type CostCategory struct { - - // The unique identifier for your cost category. - // - // This member is required. - CostCategoryArn *string - - // The effective start date of your cost category. - // - // This member is required. - EffectiveStart *string - - // The unique name of the cost category. - // - // This member is required. - Name *string - - // The rule schema version in this particular cost category. - // - // This member is required. - RuleVersion CostCategoryRuleVersion - - // The rules are processed in order. If there are multiple rules that match the - // line item, then the first rule to match is used to determine that cost category - // value. - // - // This member is required. - Rules []CostCategoryRule - - // The default value for the cost category. - DefaultValue *string - - // The effective end date of your cost category. - EffectiveEnd *string - - // The list of processing statuses for Cost Management products for a specific - // cost category. - ProcessingStatus []CostCategoryProcessingStatus - - // The split charge rules that are used to allocate your charges between your - // cost category values. - SplitChargeRules []CostCategorySplitChargeRule - - noSmithyDocumentSerde -} - -// When you create or update a cost category, you can define the CostCategoryRule -// rule type as INHERITED_VALUE . This rule type adds the flexibility to define a -// rule that dynamically inherits the cost category value from the dimension value -// that's defined by CostCategoryInheritedValueDimension . For example, suppose -// that you want to dynamically group costs that are based on the value of a -// specific tag key. First, choose an inherited value rule type, and then choose -// the tag dimension and specify the tag key to use. -type CostCategoryInheritedValueDimension struct { - - // The key to extract cost category values. - DimensionKey *string - - // The name of the dimension that's used to group costs. - // - // If you specify LINKED_ACCOUNT_NAME , the cost category value is based on account - // name. If you specify TAG , the cost category value is based on the value of the - // specified tag key. - DimensionName CostCategoryInheritedValueDimensionName - - noSmithyDocumentSerde -} - -// The list of processing statuses for Cost Management products for a specific -// cost category. -type CostCategoryProcessingStatus struct { - - // The Cost Management product name of the applied status. - Component CostCategoryStatusComponent - - // The process status for a specific cost category. - Status CostCategoryStatus - - noSmithyDocumentSerde -} - -// A reference to a cost category containing only enough information to identify -// the Cost Category. -// -// You can use this information to retrieve the full cost category information -// using DescribeCostCategory . -type CostCategoryReference struct { - - // The unique identifier for your cost category. - CostCategoryArn *string - - // The default value for the cost category. - DefaultValue *string - - // The cost category's effective end date. - EffectiveEnd *string - - // The cost category's effective start date. - EffectiveStart *string - - // The unique name of the cost category. - Name *string - - // The number of rules that are associated with a specific cost category. - NumberOfRules int32 - - // The list of processing statuses for Cost Management products for a specific - // cost category. - ProcessingStatus []CostCategoryProcessingStatus - - // The resource types supported by a specific cost category. - SupportedResourceTypes []string - - // A list of unique cost category values in a specific cost category. - Values []string - - noSmithyDocumentSerde -} - -// A reference to a cost category association that contains information on an -// associated resource. -type CostCategoryResourceAssociation struct { - - // The unique identifier for your cost category. - CostCategoryArn *string - - // The unique name of the cost category. - CostCategoryName *string - - // The unique identifier for an associated resource. - ResourceArn *string - - noSmithyDocumentSerde -} - -// Rules are processed in order. If there are multiple rules that match the line -// item, then the first rule to match is used to determine that cost category -// value. -type CostCategoryRule struct { - - // The value the line item is categorized as if the line item contains the matched - // dimension. - InheritedValue *CostCategoryInheritedValueDimension - - // An [Expression] object used to categorize costs. This supports dimensions, tags, and nested - // expressions. Currently the only dimensions supported are LINKED_ACCOUNT , - // - // SERVICE_CODE , RECORD_TYPE , LINKED_ACCOUNT_NAME , REGION , and USAGE_TYPE . - // - // RECORD_TYPE is a dimension used for Cost Explorer APIs, and is also supported - // for cost category expressions. This dimension uses different terms, depending on - // whether you're using the console or API/JSON editor. For a detailed comparison, - // see [Term Comparisons]in the Billing and Cost Management User Guide. - // - // [Expression]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Expression.html - // [Term Comparisons]: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-cost-categories.html#cost-categories-terms - Rule *Expression - - // You can define the CostCategoryRule rule type as either REGULAR or - // INHERITED_VALUE . The INHERITED_VALUE rule type adds the flexibility to define - // a rule that dynamically inherits the cost category value. This value is from the - // dimension value that's defined by CostCategoryInheritedValueDimension . For - // example, suppose that you want to costs to be dynamically grouped based on the - // value of a specific tag key. First, choose an inherited value rule type, and - // then choose the tag dimension and specify the tag key to use. - Type CostCategoryRuleType - - // The default value for the cost category. - Value *string - - noSmithyDocumentSerde -} - -// Use the split charge rule to split the cost of one cost category value across -// several other target values. -type CostCategorySplitChargeRule struct { - - // The method that's used to define how to split your source costs across your - // targets. - // - // Proportional - Allocates charges across your targets based on the proportional - // weighted cost of each target. - // - // Fixed - Allocates charges across your targets based on your defined allocation - // percentage. - // - // > Even - Allocates costs evenly across all targets. - // - // This member is required. - Method CostCategorySplitChargeMethod - - // The cost category value that you want to split. That value can't be used as a - // source or a target in other split charge rules. To indicate uncategorized costs, - // you can use an empty string as the source. - // - // This member is required. - Source *string - - // The cost category values that you want to split costs across. These values - // can't be used as a source in other split charge rules. - // - // This member is required. - Targets []string - - // The parameters for a split charge method. This is only required for the FIXED - // method. - Parameters []CostCategorySplitChargeRuleParameter - - noSmithyDocumentSerde -} - -// The parameters for a split charge method. -type CostCategorySplitChargeRuleParameter struct { - - // The parameter type. - // - // This member is required. - Type CostCategorySplitChargeRuleParameterType - - // The parameter values. - // - // This member is required. - Values []string - - noSmithyDocumentSerde -} - -// The Cost Categories values used for filtering the costs. -// -// If Values and Key are not specified, the ABSENT MatchOption is applied to all -// Cost Categories. That is, it filters on resources that aren't mapped to any Cost -// Categories. -// -// If Values is provided and Key isn't specified, the ABSENT MatchOption is -// applied to the Cost Categories Key only. That is, it filters on resources -// without the given Cost Categories key. -type CostCategoryValues struct { - - // The unique name of the cost category. - Key *string - - // The match options that you can use to filter your results. MatchOptions is only - // applicable for actions related to cost category. The default values for - // MatchOptions is EQUALS and CASE_SENSITIVE . - MatchOptions []MatchOption - - // The specific value of the cost category. - Values []string - - noSmithyDocumentSerde -} - -// Represents a collection of cost drivers and their associated metrics for cost -// comparison analysis. -type CostComparisonDriver struct { - - // An array of cost drivers, each representing a cost difference between the - // baseline and comparison time periods. Each entry also includes a metric delta - // (for example, usage change) that contributed to the cost variance, along with - // the identifier and type of change. - CostDrivers []CostDriver - - // Use Expression to filter in various Cost Explorer APIs. - // - // Not all Expression types are supported in each API. Refer to the documentation - // for each specific API to see what is supported. - // - // There are two patterns: - // - // - Simple dimension values. - // - // - There are three types of simple dimension values: CostCategories , Tags , - // and Dimensions . - // - // - Specify the CostCategories field to define a filter that acts on Cost - // Categories. - // - // - Specify the Tags field to define a filter that acts on Cost Allocation Tags. - // - // - Specify the Dimensions field to define a filter that acts on the [DimensionValues] - // DimensionValues . - // - // - For each filter type, you can set the dimension name and values for the - // filters that you plan to use. - // - // - For example, you can filter for REGION==us-east-1 OR REGION==us-west-1 . For - // GetRightsizingRecommendation , the Region is a full name (for example, - // REGION==US East (N. Virginia) . - // - // - The corresponding Expression for this example is as follows: { - // "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] } } - // - // - As shown in the previous example, lists of dimension values are combined - // with OR when applying the filter. - // - // - You can also set different match options to further control how the filter - // behaves. Not all APIs support match options. Refer to the documentation for each - // specific API to see what is supported. - // - // - For example, you can filter for linked account names that start with "a". - // - // - The corresponding Expression for this example is as follows: { - // "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": [ "STARTS_WITH" ], - // "Values": [ "a" ] } } - // - // - Compound Expression types with logical operations. - // - // - You can use multiple Expression types and the logical operators AND/OR/NOT - // to create a list of one or more Expression objects. By doing this, you can - // filter by more advanced options. - // - // - For example, you can filter by ((REGION == us-east-1 OR REGION == - // us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer) . - // - // - The corresponding Expression for this example is as follows: { "And": [ - // {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" - // ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": - // {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] } - // - // Because each Expression can have only one operator, the service returns an error - // if more than one is specified. The following example shows an Expression - // object that creates an error: { "And": [ ... ], "Dimensions": { "Key": - // "USAGE_TYPE", "Values": [ "DataTransfer" ] } } - // - // The following is an example of the corresponding error message: "Expression has - // more than one roots. Only one root operator is allowed for each expression: And, - // Or, Not, Dimensions, Tags, CostCategories" - // - // For the GetRightsizingRecommendation action, a combination of OR and NOT isn't - // supported. OR isn't supported between different dimensions, or dimensions and - // tags. NOT operators aren't supported. Dimensions are also limited to - // LINKED_ACCOUNT , REGION , or RIGHTSIZING_TYPE . - // - // For the GetReservationPurchaseRecommendation action, only NOT is supported. AND - // and OR aren't supported. Dimensions are limited to LINKED_ACCOUNT . - // - // [DimensionValues]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html - CostSelector *Expression - - // A mapping of metric names to their comparison values. - Metrics map[string]ComparisonMetricValue - - noSmithyDocumentSerde -} - -// Represents factors that contribute to cost variations between the baseline and -// comparison time periods, including the type of driver, an identifier of the -// driver, and associated metrics. -type CostDriver struct { - - // A mapping of metric names to their comparison values, measuring the impact of - // this cost driver. - Metrics map[string]ComparisonMetricValue - - // The specific identifier of the cost driver. - Name *string - - // The category or classification of the cost driver. - // - // Values include: BUNDLED_DISCOUNT, CREDIT, OUT_OF_CYCLE_CHARGE, REFUND, - // RECURRING_RESERVATION_FEE, RESERVATION_USAGE, RI_VOLUME_DISCOUNT, - // SAVINGS_PLAN_USAGE, SAVINGS_PLAN_RECURRING_FEE, SUPPORT_FEE, TAX, - // UPFRONT_RESERVATION_FEE, USAGE_CHANGE, COMMITMENT - Type *string - - noSmithyDocumentSerde -} - -// The amount of instance usage that a reservation covered. -type Coverage struct { - - // The amount of cost that the reservation covered. - CoverageCost *CoverageCost - - // The amount of instance usage that the reservation covered, in hours. - CoverageHours *CoverageHours - - // The amount of instance usage that the reservation covered, in normalized units. - CoverageNormalizedUnits *CoverageNormalizedUnits - - noSmithyDocumentSerde -} - -// Reservation coverage for a specified period, in hours. -type CoverageByTime struct { - - // The groups of instances that the reservation covered. - Groups []ReservationCoverageGroup - - // The period that this coverage was used over. - TimePeriod *DateInterval - - // The total reservation coverage, in hours. - Total *Coverage - - noSmithyDocumentSerde -} - -// How much it costs to run an instance. -type CoverageCost struct { - - // How much an On-Demand Instance costs. - OnDemandCost *string - - noSmithyDocumentSerde -} - -// How long a running instance either used a reservation or was On-Demand. -type CoverageHours struct { - - // The percentage of instance hours that a reservation covered. - CoverageHoursPercentage *string - - // The number of instance running hours that On-Demand Instances covered. - OnDemandHours *string - - // The number of instance running hours that reservations covered. - ReservedHours *string - - // The total instance usage, in hours. - TotalRunningHours *string - - noSmithyDocumentSerde -} - -// The amount of instance usage, in normalized units. You can use normalized units -// to see your EC2 usage for multiple sizes of instances in a uniform way. For -// example, suppose that you run an xlarge instance and a 2xlarge instance. If you -// run both instances for the same amount of time, the 2xlarge instance uses twice -// as much of your reservation as the xlarge instance, even though both instances -// show only one instance-hour. When you use normalized units instead of -// instance-hours, the xlarge instance used 8 normalized units, and the 2xlarge -// instance used 16 normalized units. -// -// For more information, see [Modifying Reserved Instances] in the Amazon Elastic Compute Cloud User Guide for -// Linux Instances. -// -// [Modifying Reserved Instances]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ri-modifying.html -type CoverageNormalizedUnits struct { - - // The percentage of your used instance normalized units that a reservation covers. - CoverageNormalizedUnitsPercentage *string - - // The number of normalized units that are covered by On-Demand Instances instead - // of a reservation. - OnDemandNormalizedUnits *string - - // The number of normalized units that a reservation covers. - ReservedNormalizedUnits *string - - // The total number of normalized units that you used. - TotalRunningNormalizedUnits *string - - noSmithyDocumentSerde -} - -// Context about the current instance. -type CurrentInstance struct { - - // The currency code that Amazon Web Services used to calculate the costs for this - // instance. - CurrencyCode *string - - // The name that you given an instance. This field shows as blank if you haven't - // given the instance a name. - InstanceName *string - - // The current On-Demand cost of operating this instance on a monthly basis. - MonthlyCost *string - - // The number of hours during the lookback period that's billed at On-Demand rates. - OnDemandHoursInLookbackPeriod *string - - // The number of hours during the lookback period that's covered by reservations. - ReservationCoveredHoursInLookbackPeriod *string - - // Details about the resource and utilization. - ResourceDetails *ResourceDetails - - // Resource ID of the current instance. - ResourceId *string - - // Utilization information of the current instance during the lookback period. - ResourceUtilization *ResourceUtilization - - // The number of hours during the lookback period that's covered by Savings Plans. - SavingsPlansCoveredHoursInLookbackPeriod *string - - // Cost allocation resource tags that are applied to the instance. - Tags []TagValues - - // The total number of hours that the instance ran during the lookback period. - TotalRunningHoursInLookbackPeriod *string - - noSmithyDocumentSerde -} - -// The time period of the request. -type DateInterval struct { - - // The end of the time period. The end date is exclusive. For example, if end is - // 2017-05-01 , Amazon Web Services retrieves cost and usage data from the start - // date up to, but not including, 2017-05-01 . - // - // This member is required. - End *string - - // The beginning of the time period. The start date is inclusive. For example, if - // start is 2017-01-01 , Amazon Web Services retrieves cost and usage data starting - // at 2017-01-01 up to the end date. The start date must be equal to or no later - // than the current date to avoid a validation error. - // - // This member is required. - Start *string - - noSmithyDocumentSerde -} - -// The metadata that you can use to filter and group your results. You can use -// GetDimensionValues to find specific values. -type DimensionValues struct { - - // The names of the metadata types that you can use to filter and group your - // results. For example, AZ returns a list of Availability Zones. - // - // Not all dimensions are supported in each API. Refer to the documentation for - // each specific API to see what is supported. - // - // LINKED_ACCOUNT_NAME and SERVICE_CODE can only be used in [CostCategoryRule]. - // - // ANOMALY_TOTAL_IMPACT_ABSOLUTE and ANOMALY_TOTAL_IMPACT_PERCENTAGE can only be - // used in [AnomalySubscriptions]. - // - // [AnomalySubscriptions]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_AnomalySubscription.html - // [CostCategoryRule]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_CostCategoryRule.html - Key Dimension - - // The match options that you can use to filter your results. - // - // MatchOptions is only applicable for actions related to cost category and - // Anomaly Subscriptions. Refer to the documentation for each specific API to see - // what is supported. - // - // The default values for MatchOptions are EQUALS and CASE_SENSITIVE . - MatchOptions []MatchOption - - // The metadata values that you can use to filter and group your results. You can - // use GetDimensionValues to find specific values. - Values []string - - noSmithyDocumentSerde -} - -// The metadata of a specific type that you can use to filter and group your -// results. You can use GetDimensionValues to find specific values. -type DimensionValuesWithAttributes struct { - - // The attribute that applies to a specific Dimension . - Attributes map[string]string - - // The value of a dimension with a specific attribute. - Value *string - - noSmithyDocumentSerde -} - -// The field that contains a list of disk (local storage) metrics that are -// associated with the current instance. -type DiskResourceUtilization struct { - - // The maximum read throughput operations per second. - DiskReadBytesPerSecond *string - - // The maximum number of read operations per second. - DiskReadOpsPerSecond *string - - // The maximum write throughput operations per second. - DiskWriteBytesPerSecond *string - - // The maximum number of write operations per second. - DiskWriteOpsPerSecond *string - - noSmithyDocumentSerde -} - -// The DynamoDB reservations that Amazon Web Services recommends that you purchase. -type DynamoDBCapacityDetails struct { - - // The capacity unit of the recommended reservation. - CapacityUnits *string - - // The Amazon Web Services Region of the recommended reservation. - Region *string - - noSmithyDocumentSerde -} - -// The EBS field that contains a list of EBS metrics that are associated with the -// current instance. -type EBSResourceUtilization struct { - - // The maximum size of read operations per second - EbsReadBytesPerSecond *string - - // The maximum number of read operations per second. - EbsReadOpsPerSecond *string - - // The maximum size of write operations per second. - EbsWriteBytesPerSecond *string - - // The maximum number of write operations per second. - EbsWriteOpsPerSecond *string - - noSmithyDocumentSerde -} - -// Details about the Amazon EC2 reservations that Amazon Web Services recommends -// that you purchase. -type EC2InstanceDetails struct { - - // The Availability Zone of the recommended reservation. - AvailabilityZone *string - - // Determines whether the recommendation is for a current-generation instance. - CurrentGeneration bool - - // The instance family of the recommended reservation. - Family *string - - // The type of instance that Amazon Web Services recommends. - InstanceType *string - - // The platform of the recommended reservation. The platform is the specific - // combination of operating system, license model, and software on an instance. - Platform *string - - // The Amazon Web Services Region of the recommended reservation. - Region *string - - // Determines whether the recommended reservation is size flexible. - SizeFlexEligible bool - - // Determines whether the recommended reservation is dedicated or shared. - Tenancy *string - - noSmithyDocumentSerde -} - -// Details on the Amazon EC2 Resource. -type EC2ResourceDetails struct { - - // The hourly public On-Demand rate for the instance type. - HourlyOnDemandRate *string - - // The type of Amazon Web Services instance. - InstanceType *string - - // The memory capacity of the Amazon Web Services instance. - Memory *string - - // The network performance capacity of the Amazon Web Services instance. - NetworkPerformance *string - - // The platform of the Amazon Web Services instance. The platform is the specific - // combination of operating system, license model, and software on an instance. - Platform *string - - // The Amazon Web Services Region of the instance. - Region *string - - // The SKU of the product. - Sku *string - - // The disk storage of the Amazon Web Services instance. This doesn't include EBS - // storage. - Storage *string - - // The number of VCPU cores in the Amazon Web Services instance type. - Vcpu *string - - noSmithyDocumentSerde -} - -// Utilization metrics for the instance. -type EC2ResourceUtilization struct { - - // The field that contains a list of disk (local storage) metrics that are - // associated with the current instance. - DiskResourceUtilization *DiskResourceUtilization - - // The EBS field that contains a list of EBS metrics that are associated with the - // current instance. - EBSResourceUtilization *EBSResourceUtilization - - // The maximum observed or expected CPU utilization of the instance. - MaxCpuUtilizationPercentage *string - - // The maximum observed or expected memory utilization of the instance. - MaxMemoryUtilizationPercentage *string - - // The maximum observed or expected storage utilization of the instance. This - // doesn't include EBS storage. - MaxStorageUtilizationPercentage *string - - // The network field that contains a list of network metrics that are associated - // with the current instance. - NetworkResourceUtilization *NetworkResourceUtilization - - noSmithyDocumentSerde -} - -// The Amazon EC2 hardware specifications that you want Amazon Web Services to -// provide recommendations for. -type EC2Specification struct { - - // Indicates whether you want a recommendation for standard or convertible - // reservations. - OfferingClass OfferingClass - - noSmithyDocumentSerde -} - -// Details about the Amazon ElastiCache reservations that Amazon Web Services -// recommends that you purchase. -type ElastiCacheInstanceDetails struct { - - // Determines whether the recommendation is for a current generation instance. - CurrentGeneration bool - - // The instance family of the recommended reservation. - Family *string - - // The type of node that Amazon Web Services recommends. - NodeType *string - - // The description of the recommended reservation. - ProductDescription *string - - // The Amazon Web Services Region of the recommended reservation. - Region *string - - // Determines whether the recommended reservation is size flexible. - SizeFlexEligible bool - - noSmithyDocumentSerde -} - -// Details about the Amazon OpenSearch Service reservations that Amazon Web -// Services recommends that you purchase. -type ESInstanceDetails struct { - - // Determines whether the recommendation is for a current-generation instance. - CurrentGeneration bool - - // The class of instance that Amazon Web Services recommends. - InstanceClass *string - - // The size of instance that Amazon Web Services recommends. - InstanceSize *string - - // The Amazon Web Services Region of the recommended reservation. - Region *string - - // Determines whether the recommended reservation is size flexible. - SizeFlexEligible bool - - noSmithyDocumentSerde -} - -// Use Expression to filter in various Cost Explorer APIs. -// -// Not all Expression types are supported in each API. Refer to the documentation -// for each specific API to see what is supported. -// -// There are two patterns: -// -// - Simple dimension values. -// -// - There are three types of simple dimension values: CostCategories , Tags , -// and Dimensions . -// -// - Specify the CostCategories field to define a filter that acts on Cost -// Categories. -// -// - Specify the Tags field to define a filter that acts on Cost Allocation Tags. -// -// - Specify the Dimensions field to define a filter that acts on the [DimensionValues] -// DimensionValues . -// -// - For each filter type, you can set the dimension name and values for the -// filters that you plan to use. -// -// - For example, you can filter for REGION==us-east-1 OR REGION==us-west-1 . For -// GetRightsizingRecommendation , the Region is a full name (for example, -// REGION==US East (N. Virginia) . -// -// - The corresponding Expression for this example is as follows: { -// "Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" ] } } -// -// - As shown in the previous example, lists of dimension values are combined -// with OR when applying the filter. -// -// - You can also set different match options to further control how the filter -// behaves. Not all APIs support match options. Refer to the documentation for each -// specific API to see what is supported. -// -// - For example, you can filter for linked account names that start with "a". -// -// - The corresponding Expression for this example is as follows: { -// "Dimensions": { "Key": "LINKED_ACCOUNT_NAME", "MatchOptions": [ "STARTS_WITH" ], -// "Values": [ "a" ] } } -// -// - Compound Expression types with logical operations. -// -// - You can use multiple Expression types and the logical operators AND/OR/NOT -// to create a list of one or more Expression objects. By doing this, you can -// filter by more advanced options. -// -// - For example, you can filter by ((REGION == us-east-1 OR REGION == -// us-west-1) OR (TAG.Type == Type1)) AND (USAGE_TYPE != DataTransfer) . -// -// - The corresponding Expression for this example is as follows: { "And": [ -// {"Or": [ {"Dimensions": { "Key": "REGION", "Values": [ "us-east-1", "us-west-1" -// ] }}, {"Tags": { "Key": "TagName", "Values": ["Value1"] } } ]}, {"Not": -// {"Dimensions": { "Key": "USAGE_TYPE", "Values": ["DataTransfer"] }}} ] } -// -// Because each Expression can have only one operator, the service returns an error -// -// if more than one is specified. The following example shows an Expression -// object that creates an error: { "And": [ ... ], "Dimensions": { "Key": -// "USAGE_TYPE", "Values": [ "DataTransfer" ] } } -// -// The following is an example of the corresponding error message: "Expression has -// -// more than one roots. Only one root operator is allowed for each expression: And, -// Or, Not, Dimensions, Tags, CostCategories" -// -// For the GetRightsizingRecommendation action, a combination of OR and NOT isn't -// supported. OR isn't supported between different dimensions, or dimensions and -// tags. NOT operators aren't supported. Dimensions are also limited to -// LINKED_ACCOUNT , REGION , or RIGHTSIZING_TYPE . -// -// For the GetReservationPurchaseRecommendation action, only NOT is supported. AND -// and OR aren't supported. Dimensions are limited to LINKED_ACCOUNT . -// -// [DimensionValues]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_DimensionValues.html -type Expression struct { - - // Return results that match both Dimension objects. - And []Expression - - // The filter that's based on CostCategory values. - CostCategories *CostCategoryValues - - // The specific Dimension to use for Expression . - Dimensions *DimensionValues - - // Return results that don't match a Dimension object. - Not *Expression - - // Return results that match either Dimension object. - Or []Expression - - // The specific Tag to use for Expression . - Tags *TagValues - - noSmithyDocumentSerde -} - -// The forecast that's created for your query. -type ForecastResult struct { - - // The mean value of the forecast. - MeanValue *string - - // The lower limit for the prediction interval. - PredictionIntervalLowerBound *string - - // The upper limit for the prediction interval. - PredictionIntervalUpperBound *string - - // The period of time that the forecast covers. - TimePeriod *DateInterval - - noSmithyDocumentSerde -} - -// The summary of the Savings Plans recommendation generation. -type GenerationSummary struct { - - // Indicates the estimated time for when the recommendation generation will - // complete. - EstimatedCompletionTime *string - - // Indicates the completion time of the recommendation generation. - GenerationCompletionTime *string - - // Indicates the start time of the recommendation generation. - GenerationStartedTime *string - - // Indicates whether the recommendation generation succeeded, is processing, or - // failed. - GenerationStatus GenerationStatus - - // Indicates the ID for this specific recommendation. - RecommendationId *string - - noSmithyDocumentSerde -} - -// One level of grouped data in the results. -type Group struct { - - // The keys that are included in this group. - Keys []string - - // The metrics that are included in this group. - Metrics map[string]MetricValue - - noSmithyDocumentSerde -} - -// Represents a group when you specify a group by criteria or in the response to a -// query with a specific grouping. -type GroupDefinition struct { - - // The string that represents a key for a specified group. - Key *string - - // The string that represents the type of group. - Type GroupDefinitionType - - noSmithyDocumentSerde -} - -// The dollar value of the anomaly. -type Impact struct { - - // The maximum dollar value that's observed for an anomaly. - // - // This member is required. - MaxImpact float64 - - // The cumulative dollar amount that was actually spent during the anomaly. - TotalActualSpend *float64 - - // The cumulative dollar amount that was expected to be spent during the anomaly. - // It is calculated using advanced machine learning models to determine the typical - // spending pattern based on historical data for a customer. - TotalExpectedSpend *float64 - - // The cumulative dollar difference between the total actual spend and total - // expected spend. It is calculated as TotalActualSpend - TotalExpectedSpend . - TotalImpact float64 - - // The cumulative percentage difference between the total actual spend and total - // expected spend. It is calculated as (TotalImpact / TotalExpectedSpend) * 100 . - // When TotalExpectedSpend is zero, this field is omitted. Expected spend can be - // zero in situations such as when you start to use a service for the first time. - TotalImpactPercentage *float64 - - noSmithyDocumentSerde -} - -// Details about the reservations that Amazon Web Services recommends that you -// purchase. -type InstanceDetails struct { - - // The Amazon EC2 reservations that Amazon Web Services recommends that you - // purchase. - EC2InstanceDetails *EC2InstanceDetails - - // The Amazon OpenSearch Service reservations that Amazon Web Services recommends - // that you purchase. - ESInstanceDetails *ESInstanceDetails - - // The ElastiCache reservations that Amazon Web Services recommends that you - // purchase. - ElastiCacheInstanceDetails *ElastiCacheInstanceDetails - - // The MemoryDB reservations that Amazon Web Services recommends that you purchase. - MemoryDBInstanceDetails *MemoryDBInstanceDetails - - // The Amazon RDS reservations that Amazon Web Services recommends that you - // purchase. - RDSInstanceDetails *RDSInstanceDetails - - // The Amazon Redshift reservations that Amazon Web Services recommends that you - // purchase. - RedshiftInstanceDetails *RedshiftInstanceDetails - - noSmithyDocumentSerde -} - -// Details about the MemoryDB reservations that Amazon Web Services recommends -// that you purchase. -type MemoryDBInstanceDetails struct { - - // Determines whether the recommendation is for a current generation instance. - CurrentGeneration bool - - // The instance family of the recommended reservation. - Family *string - - // The node type of the recommended reservation. - NodeType *string - - // The Amazon Web Services Region of the recommended reservation. - Region *string - - // Determines whether the recommended reservation is size flexible. - SizeFlexEligible bool - - noSmithyDocumentSerde -} - -// The aggregated value for a metric. -type MetricValue struct { - - // The actual number that represents the metric. - Amount *string - - // The unit that the metric is given in. - Unit *string - - noSmithyDocumentSerde -} - -// Details for the modification recommendation. -type ModifyRecommendationDetail struct { - - // Determines whether this instance type is the Amazon Web Services default - // recommendation. - TargetInstances []TargetInstance - - noSmithyDocumentSerde -} - -// The network field that contains a list of network metrics that are associated -// with the current instance. -type NetworkResourceUtilization struct { - - // The network inbound throughput utilization measured in Bytes per second (Bps). - NetworkInBytesPerSecond *string - - // The network outbound throughput utilization measured in Bytes per second (Bps). - NetworkOutBytesPerSecond *string - - // The network inbound packets that are measured in packets per second. - NetworkPacketsInPerSecond *string - - // The network outbound packets that are measured in packets per second. - NetworkPacketsOutPerSecond *string - - noSmithyDocumentSerde -} - -// Details about the Amazon RDS reservations that Amazon Web Services recommends -// that you purchase. -type RDSInstanceDetails struct { - - // Determines whether the recommendation is for a current-generation instance. - CurrentGeneration bool - - // The database edition that the recommended reservation supports. - DatabaseEdition *string - - // The database engine that the recommended reservation supports. - DatabaseEngine *string - - // Determines whether the recommendation is for a reservation for RDS Custom. - DeploymentModel *string - - // Determines whether the recommendation is for a reservation in a single - // Availability Zone or a reservation with a backup in a second Availability Zone. - DeploymentOption *string - - // The instance family of the recommended reservation. - Family *string - - // The type of instance that Amazon Web Services recommends. - InstanceType *string - - // The license model that the recommended reservation supports. - LicenseModel *string - - // The Amazon Web Services Region of the recommended reservation. - Region *string - - // Determines whether the recommended reservation is size flexible. - SizeFlexEligible bool - - noSmithyDocumentSerde -} - -// The details and metrics for the given recommendation. -type RecommendationDetailData struct { - - // The AccountID that the recommendation is generated for. - AccountId *string - - // The account scope that you want your recommendations for. Amazon Web Services - // calculates recommendations including the management account and member accounts - // if the value is set to PAYER. If the value is LINKED, recommendations are - // calculated for individual member accounts only. - AccountScope AccountScope - - // The currency code that Amazon Web Services used to generate the recommendation - // and present potential savings. - CurrencyCode *string - - // The average value of hourly coverage over the lookback period. - CurrentAverageCoverage *string - - // The average value of hourly On-Demand spend over the lookback period of the - // applicable usage type. - CurrentAverageHourlyOnDemandSpend *string - - // The highest value of hourly On-Demand spend over the lookback period of the - // applicable usage type. - CurrentMaximumHourlyOnDemandSpend *string - - // The lowest value of hourly On-Demand spend over the lookback period of the - // applicable usage type. - CurrentMinimumHourlyOnDemandSpend *string - - // The estimated coverage of the recommended Savings Plan. - EstimatedAverageCoverage *string - - // The estimated utilization of the recommended Savings Plan. - EstimatedAverageUtilization *string - - // The estimated monthly savings amount based on the recommended Savings Plan. - EstimatedMonthlySavingsAmount *string - - // The remaining On-Demand cost estimated to not be covered by the recommended - // Savings Plan, over the length of the lookback period. - EstimatedOnDemandCost *string - - // The estimated On-Demand costs you expect with no additional commitment, based - // on your usage of the selected time period and the Savings Plan you own. - EstimatedOnDemandCostWithCurrentCommitment *string - - // The estimated return on investment that's based on the recommended Savings Plan - // that you purchased. This is calculated as - // estimatedSavingsAmount/estimatedSPCost*100. - EstimatedROI *string - - // The cost of the recommended Savings Plan over the length of the lookback period. - EstimatedSPCost *string - - // The estimated savings amount that's based on the recommended Savings Plan over - // the length of the lookback period. - EstimatedSavingsAmount *string - - // The estimated savings percentage relative to the total cost of applicable - // On-Demand usage over the lookback period. - EstimatedSavingsPercentage *string - - // The existing hourly commitment for the Savings Plan type. - ExistingHourlyCommitment *string - - // The period of time that you want the usage and costs for. - GenerationTimestamp *string - - // The recommended hourly commitment level for the Savings Plan type and the - // configuration that's based on the usage during the lookback period. - HourlyCommitmentToPurchase *string - - // The instance family of the recommended Savings Plan. - InstanceFamily *string - - // The period of time that you want the usage and costs for. - LatestUsageTimestamp *string - - // How many days of previous usage that Amazon Web Services considers when making - // this recommendation. - LookbackPeriodInDays LookbackPeriodInDays - - // The related hourly cost, coverage, and utilization metrics over the lookback - // period. - MetricsOverLookbackPeriod []RecommendationDetailHourlyMetrics - - // The unique ID that's used to distinguish Savings Plans from one another. - OfferingId *string - - // The payment option for the commitment (for example, All Upfront or No Upfront). - PaymentOption PaymentOption - - // The region the recommendation is generated for. - Region *string - - // The requested Savings Plan recommendation type. - SavingsPlansType SupportedSavingsPlansType - - // The term of the commitment in years. - TermInYears TermInYears - - // The upfront cost of the recommended Savings Plan, based on the selected payment - // option. - UpfrontCost *string - - noSmithyDocumentSerde -} - -// Contains the hourly metrics for the given recommendation over the lookback -// period. -type RecommendationDetailHourlyMetrics struct { - - // The current amount of Savings Plans eligible usage that the Savings Plan - // covered. - CurrentCoverage *string - - // The estimated coverage amount based on the recommended Savings Plan. - EstimatedCoverage *string - - // The estimated utilization for the recommended Savings Plan. - EstimatedNewCommitmentUtilization *string - - // The remaining On-Demand cost estimated to not be covered by the recommended - // Savings Plan, over the length of the lookback period. - EstimatedOnDemandCost *string - - // The period of time that you want the usage and costs for. - StartTime *string - - noSmithyDocumentSerde -} - -// Details about the Amazon Redshift reservations that Amazon Web Services -// recommends that you purchase. -type RedshiftInstanceDetails struct { - - // Determines whether the recommendation is for a current-generation instance. - CurrentGeneration bool - - // The instance family of the recommended reservation. - Family *string - - // The type of node that Amazon Web Services recommends. - NodeType *string - - // The Amazon Web Services Region of the recommended reservation. - Region *string - - // Determines whether the recommended reservation is size flexible. - SizeFlexEligible bool - - noSmithyDocumentSerde -} - -// The aggregated numbers for your reservation usage. -type ReservationAggregates struct { - - // The monthly cost of your reservation. It's amortized over the reservation - // period. - AmortizedRecurringFee *string - - // The upfront cost of your reservation. It's amortized over the reservation - // period. - AmortizedUpfrontFee *string - - // How much you saved due to purchasing and utilizing reservation. Amazon Web - // Services calculates this by subtracting TotalAmortizedFee from - // OnDemandCostOfRIHoursUsed . - NetRISavings *string - - // How much your reservation costs if charged On-Demand rates. - OnDemandCostOfRIHoursUsed *string - - // How many reservation hours that you purchased. - PurchasedHours *string - - // The number of Amazon EC2 reservation hours that you purchased. It's converted - // to normalized units. Normalized units are available only for Amazon EC2 usage - // after November 11, 2017. - PurchasedUnits *string - - // The cost of unused hours for your reservation. - RICostForUnusedHours *string - - // The realized savings because of purchasing and using a reservation. - RealizedSavings *string - - // The total number of reservation hours that you used. - TotalActualHours *string - - // The total number of Amazon EC2 reservation hours that you used. It's converted - // to normalized units. Normalized units are available only for Amazon EC2 usage - // after November 11, 2017. - TotalActualUnits *string - - // The total cost of your reservation. It's amortized over the reservation period. - TotalAmortizedFee *string - - // How much you might save if you use your entire reservation. - TotalPotentialRISavings *string - - // The unrealized savings because of purchasing and using a reservation. - UnrealizedSavings *string - - // The number of reservation hours that you didn't use. - UnusedHours *string - - // The number of Amazon EC2 reservation hours that you didn't use. It's converted - // to normalized units. Normalized units are available only for Amazon EC2 usage - // after November 11, 2017. - UnusedUnits *string - - // The percentage of reservation time that you used. - UtilizationPercentage *string - - // The percentage of Amazon EC2 reservation time that you used. It's converted to - // normalized units. Normalized units are available only for Amazon EC2 usage after - // November 11, 2017. - UtilizationPercentageInUnits *string - - noSmithyDocumentSerde -} - -// A group of reservations that share a set of attributes. -type ReservationCoverageGroup struct { - - // The attributes for this group of reservations. - Attributes map[string]string - - // How much instance usage this group of reservations covered. - Coverage *Coverage - - noSmithyDocumentSerde -} - -// A specific reservation that Amazon Web Services recommends for purchase. -type ReservationPurchaseRecommendation struct { - - // The account scope that Amazon Web Services recommends that you purchase this - // instance for. For example, you can purchase this reservation for an entire - // organization in Amazon Web Services Organizations. - AccountScope AccountScope - - // How many days of previous usage that Amazon Web Services considers when making - // this recommendation. - LookbackPeriodInDays LookbackPeriodInDays - - // The payment option for the reservation (for example, AllUpfront or NoUpfront ). - PaymentOption PaymentOption - - // Details about the recommended purchases. - RecommendationDetails []ReservationPurchaseRecommendationDetail - - // A summary about the recommended purchase. - RecommendationSummary *ReservationPurchaseRecommendationSummary - - // Hardware specifications for the service that you want recommendations for. - ServiceSpecification *ServiceSpecification - - // The term of the reservation that you want recommendations for, in years. - TermInYears TermInYears - - noSmithyDocumentSerde -} - -// Details about your recommended reservation purchase. -type ReservationPurchaseRecommendationDetail struct { - - // The account that this Reserved Instance (RI) recommendation is for. - AccountId *string - - // The average number of normalized units that you used in an hour during the - // historical period. Amazon Web Services uses this to calculate your recommended - // reservation purchases. - AverageNormalizedUnitsUsedPerHour *string - - // The average number of provisioned capacity units that you used in an hour - // during the - // - // historical period. Amazon Web Services uses this to calculate your recommended - // - // reservation purchases. - AverageNumberOfCapacityUnitsUsedPerHour *string - - // The average number of instances that you used in an hour during the historical - // period. Amazon Web Services uses this to calculate your recommended reservation - // purchases. - AverageNumberOfInstancesUsedPerHour *string - - // The average utilization of your instances. Amazon Web Services uses this to - // calculate your recommended reservation purchases. - AverageUtilization *string - - // The currency code that Amazon Web Services used to calculate the costs for this - // instance. - CurrencyCode *string - - // How long Amazon Web Services estimates that it takes for this instance to start - // saving you money, in months. - EstimatedBreakEvenInMonths *string - - // How much Amazon Web Services estimates that you spend on On-Demand Instances in - // a month. - EstimatedMonthlyOnDemandCost *string - - // How much Amazon Web Services estimates that this specific recommendation might - // save you in a month. - EstimatedMonthlySavingsAmount *string - - // How much Amazon Web Services estimates that this specific recommendation might - // save you in a month, as a percentage of your overall costs. - EstimatedMonthlySavingsPercentage *string - - // How much Amazon Web Services estimates that you might spend for all usage - // during the specified historical period if you had a reservation. - EstimatedReservationCostForLookbackPeriod *string - - // Details about the reservations that Amazon Web Services recommends that you - // purchase. - InstanceDetails *InstanceDetails - - // The maximum number of normalized units that you used in an hour during the - // historical period. Amazon Web Services uses this to calculate your recommended - // reservation purchases. - MaximumNormalizedUnitsUsedPerHour *string - - // The maximum number of provisioned capacity units that you used in an hour - // during the - // - // historical period. Amazon Web Services uses this to calculate your recommended - // - // reservation purchases. - MaximumNumberOfCapacityUnitsUsedPerHour *string - - // The maximum number of instances that you used in an hour during the historical - // period. Amazon Web Services uses this to calculate your recommended reservation - // purchases. - MaximumNumberOfInstancesUsedPerHour *string - - // The minimum number of normalized units that you used in an hour during the - // historical period. Amazon Web Services uses this to calculate your recommended - // reservation purchases. - MinimumNormalizedUnitsUsedPerHour *string - - // The minimum number of provisioned capacity units that you used in an hour - // during the - // - // historical period. Amazon Web Services uses this to calculate your recommended - // - // reservation purchases. - MinimumNumberOfCapacityUnitsUsedPerHour *string - - // The minimum number of instances that you used in an hour during the historical - // period. Amazon Web Services uses this to calculate your recommended reservation - // purchases. - MinimumNumberOfInstancesUsedPerHour *string - - // The number of normalized units that Amazon Web Services recommends that you - // purchase. - RecommendedNormalizedUnitsToPurchase *string - - // The number of reserved capacity units that Amazon Web Services recommends that - // you - // - // purchase. - RecommendedNumberOfCapacityUnitsToPurchase *string - - // The number of instances that Amazon Web Services recommends that you purchase. - RecommendedNumberOfInstancesToPurchase *string - - // How much purchasing this instance costs you on a monthly basis. - RecurringStandardMonthlyCost *string - - // Details about the reservations that Amazon Web Services recommends that you - // - // purchase. - ReservedCapacityDetails *ReservedCapacityDetails - - // How much purchasing this instance costs you upfront. - UpfrontCost *string - - noSmithyDocumentSerde -} - -// Information about a recommendation, such as the timestamp for when Amazon Web -// Services made a specific recommendation. -type ReservationPurchaseRecommendationMetadata struct { - - // Additional metadata that might be applicable to the recommendation. - AdditionalMetadata *string - - // The timestamp for when Amazon Web Services made the recommendation. - GenerationTimestamp *string - - // The ID for the recommendation. - RecommendationId *string - - noSmithyDocumentSerde -} - -// A summary about this recommendation, such as the currency code, the amount that -// Amazon Web Services estimates that you could save, and the total amount of -// reservation to purchase. -type ReservationPurchaseRecommendationSummary struct { - - // The currency code used for this recommendation. - CurrencyCode *string - - // The total amount that Amazon Web Services estimates that this recommendation - // could save you in a month. - TotalEstimatedMonthlySavingsAmount *string - - // The total amount that Amazon Web Services estimates that this recommendation - // could save you in a month, as a percentage of your costs. - TotalEstimatedMonthlySavingsPercentage *string - - noSmithyDocumentSerde -} - -// A group of reservations that share a set of attributes. -type ReservationUtilizationGroup struct { - - // The attributes for this group of reservations. - Attributes map[string]string - - // The key for a specific reservation attribute. - Key *string - - // How much you used this group of reservations. - Utilization *ReservationAggregates - - // The value of a specific reservation attribute. - Value *string - - noSmithyDocumentSerde -} - -// Details about the reservations that Amazon Web Services recommends that you -// -// purchase. -type ReservedCapacityDetails struct { - - // The DynamoDB reservations that Amazon Web Services recommends that you purchase. - DynamoDBCapacityDetails *DynamoDBCapacityDetails - - noSmithyDocumentSerde -} - -// Details for the resource. -type ResourceDetails struct { - - // Details for the Amazon EC2 resource. - EC2ResourceDetails *EC2ResourceDetails - - noSmithyDocumentSerde -} - -// The tag structure that contains a tag key and value. -// -// Tagging is supported only for the following Cost Explorer resource types: [AnomalyMonitor] -// AnomalyMonitor , [AnomalySubscription]AnomalySubscription , [CostCategory]CostCategory . -// -// [AnomalySubscription]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_AnomalySubscription.html -// [AnomalyMonitor]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_AnomalyMonitor.html -// [CostCategory]: https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_CostCategory.html -type ResourceTag struct { - - // The key that's associated with the tag. - // - // This member is required. - Key *string - - // The value that's associated with the tag. - // - // This member is required. - Value *string - - noSmithyDocumentSerde -} - -// Resource utilization of current resource. -type ResourceUtilization struct { - - // The utilization of current Amazon EC2 instance. - EC2ResourceUtilization *EC2ResourceUtilization - - noSmithyDocumentSerde -} - -// The result that's associated with a time period. -type ResultByTime struct { - - // Determines whether the result is estimated. - Estimated bool - - // The groups that this time period includes. - Groups []Group - - // The time period that the result covers. - TimePeriod *DateInterval - - // The total amount of cost or usage accrued during the time period. - Total map[string]MetricValue - - noSmithyDocumentSerde -} - -// Recommendations to rightsize resources. -type RightsizingRecommendation struct { - - // The account that this recommendation is for. - AccountId *string - - // Context regarding the current instance. - CurrentInstance *CurrentInstance - - // The list of possible reasons why the recommendation is generated, such as - // under- or over-utilization of specific metrics (for example, CPU, Memory, - // Network). - FindingReasonCodes []FindingReasonCode - - // The details for the modification recommendations. - ModifyRecommendationDetail *ModifyRecommendationDetail - - // A recommendation to either terminate or modify the resource. - RightsizingType RightsizingType - - // The details for termination recommendations. - TerminateRecommendationDetail *TerminateRecommendationDetail - - noSmithyDocumentSerde -} - -// You can use RightsizingRecommendationConfiguration to customize recommendations -// across two attributes. You can choose to view recommendations for instances -// within the same instance families or across different instance families. You can -// also choose to view your estimated savings that are associated with -// recommendations with consideration of existing Savings Plans or Reserved -// Instance (RI) benefits, or neither. -type RightsizingRecommendationConfiguration struct { - - // The option to consider RI or Savings Plans discount benefits in your savings - // calculation. The default value is TRUE . - // - // This member is required. - BenefitsConsidered bool - - // The option to see recommendations within the same instance family or - // recommendations for instances across other families. The default value is - // SAME_INSTANCE_FAMILY . - // - // This member is required. - RecommendationTarget RecommendationTarget - - noSmithyDocumentSerde -} - -// Metadata for a recommendation set. -type RightsizingRecommendationMetadata struct { - - // Additional metadata that might be applicable to the recommendation. - AdditionalMetadata *string - - // The timestamp for when Amazon Web Services made the recommendation. - GenerationTimestamp *string - - // The number of days of previous usage that Amazon Web Services considers when - // making the recommendation. - LookbackPeriodInDays LookbackPeriodInDays - - // The ID for the recommendation. - RecommendationId *string - - noSmithyDocumentSerde -} - -// The summary of rightsizing recommendations -type RightsizingRecommendationSummary struct { - - // The estimated total savings resulting from modifications, on a monthly basis. - EstimatedTotalMonthlySavingsAmount *string - - // The currency code that Amazon Web Services used to calculate the savings. - SavingsCurrencyCode *string - - // The savings percentage based on the recommended modifications. It's relative - // to the total On-Demand costs that are associated with these instances. - SavingsPercentage *string - - // The total number of instance recommendations. - TotalRecommendationCount *string - - noSmithyDocumentSerde -} - -// The combination of Amazon Web Services service, linked account, linked account -// name, Region, and usage type where a cost anomaly is observed, along with the -// dollar and percentage amount of the anomaly impact. The linked account name will -// only be available when the account name can be identified. -type RootCause struct { - - // The dollar impact for the root cause. - Impact *RootCauseImpact - - // The member account value that's associated with the cost anomaly. - LinkedAccount *string - - // The member account name value that's associated with the cost anomaly. - LinkedAccountName *string - - // The Amazon Web Services Region that's associated with the cost anomaly. - Region *string - - // The Amazon Web Services service name that's associated with the cost anomaly. - Service *string - - // The UsageType value that's associated with the cost anomaly. - UsageType *string - - noSmithyDocumentSerde -} - -// The dollar value of the root cause. -type RootCauseImpact struct { - - // The dollar amount that this root cause contributed to the anomaly's TotalImpact. - // - // This member is required. - Contribution float64 - - noSmithyDocumentSerde -} - -// The Savings Plans commitment details. -type SavingsPlans struct { - - // The instance family of the Savings Plans commitment. - InstanceFamily *string - - // The unique ID that's used to distinguish Savings Plans commitments from one - // another. - OfferingId *string - - // The payment option for the Savings Plans commitment. - PaymentOption PaymentOption - - // The Region associated with the Savings Plans commitment. - Region *string - - // The Savings Plans commitment. - SavingsPlansCommitment *float64 - - // The Savings Plans type. - SavingsPlansType SupportedSavingsPlansType - - // The term that you want the Savings Plans commitment for. - TermInYears TermInYears - - noSmithyDocumentSerde -} - -// The amortized amount of Savings Plans purchased in a specific account during a -// specific time interval. -type SavingsPlansAmortizedCommitment struct { - - // The amortized amount of your Savings Plans commitment that was purchased with - // either a Partial or a NoUpfront . - AmortizedRecurringCommitment *string - - // The amortized amount of your Savings Plans commitment that was purchased with - // an Upfront or PartialUpfront Savings Plans. - AmortizedUpfrontCommitment *string - - // The total amortized amount of your Savings Plans commitment, regardless of your - // Savings Plans purchase method. - TotalAmortizedCommitment *string - - noSmithyDocumentSerde -} - -// The amount of Savings Plans eligible usage that's covered by Savings Plans. All -// calculations consider the On-Demand equivalent of your Savings Plans usage. -type SavingsPlansCoverage struct { - - // The attribute that applies to a specific Dimension . - Attributes map[string]string - - // The amount of Savings Plans eligible usage that the Savings Plans covered. - Coverage *SavingsPlansCoverageData - - // The time period of the request. - TimePeriod *DateInterval - - noSmithyDocumentSerde -} - -// Specific coverage percentage, On-Demand costs, and spend covered by Savings -// Plans, and total Savings Plans costs for an account. -type SavingsPlansCoverageData struct { - - // The percentage of your existing Savings Plans covered usage, divided by all of - // your eligible Savings Plans usage in an account (or set of accounts). - CoveragePercentage *string - - // The cost of your Amazon Web Services usage at the public On-Demand rate. - OnDemandCost *string - - // The amount of your Amazon Web Services usage that's covered by a Savings Plans. - SpendCoveredBySavingsPlans *string - - // The total cost of your Amazon Web Services usage, regardless of your purchase - // option. - TotalCost *string - - noSmithyDocumentSerde -} - -// The attribute details on a specific Savings Plan. -type SavingsPlansDetails struct { - - // A group of instance types that Savings Plans applies to. - InstanceFamily *string - - // The unique ID that's used to distinguish Savings Plans from one another. - OfferingId *string - - // A collection of Amazon Web Services resources in a geographic area. Each Amazon - // Web Services Region is isolated and independent of the other Regions. - Region *string - - noSmithyDocumentSerde -} - -// The configuration for the Savings Plans purchase analysis. -type SavingsPlansPurchaseAnalysisConfiguration struct { - - // The type of analysis. - // - // This member is required. - AnalysisType AnalysisType - - // The time period associated with the analysis. - // - // This member is required. - LookBackTimePeriod *DateInterval - - // Savings Plans to include in the analysis. - // - // This member is required. - SavingsPlansToAdd []SavingsPlans - - // The account that the analysis is for. - AccountId *string - - // The account scope that you want your analysis for. - AccountScope AccountScope - - // Savings Plans to exclude from the analysis. - SavingsPlansToExclude []string - - noSmithyDocumentSerde -} - -// Details about the Savings Plans purchase analysis. -type SavingsPlansPurchaseAnalysisDetails struct { - - // Additional metadata that might be applicable to the commitment. - AdditionalMetadata *string - - // The currency code used for the analysis. - CurrencyCode *string - - // The average value of hourly coverage over the lookback period. - CurrentAverageCoverage *string - - // The average value of hourly On-Demand spend over the lookback period. - CurrentAverageHourlyOnDemandSpend *string - - // The highest value of hourly On-Demand spend over the lookback period. - CurrentMaximumHourlyOnDemandSpend *string - - // The lowest value of hourly On-Demand spend over the lookback period. - CurrentMinimumHourlyOnDemandSpend *string - - // The current total On-Demand spend over the lookback period. - CurrentOnDemandSpend *string - - // The estimated coverage of the Savings Plan. - EstimatedAverageCoverage *string - - // The estimated utilization of the Savings Plan. - EstimatedAverageUtilization *string - - // The estimated cost of the Savings Plan over the length of the lookback period. - EstimatedCommitmentCost *string - - // The estimated monthly savings amount based on the Savings Plan. - EstimatedMonthlySavingsAmount *string - - // The remaining On-Demand cost estimated to not be covered by the Savings Plan - // over the length of the lookback period. - EstimatedOnDemandCost *string - - // The estimated On-Demand cost you expect with no additional commitment based on - // your usage of the selected time period and the Savings Plan you own. - EstimatedOnDemandCostWithCurrentCommitment *string - - // The estimated return on investment that's based on the Savings Plan and - // estimated savings. This is calculated as - // estimatedSavingsAmount/estimatedSPCost*100. - EstimatedROI *string - - // The estimated savings amount that's based on the Savings Plan over the length - // of the lookback period. - EstimatedSavingsAmount *string - - // The estimated savings percentage relative to the total cost over the cost - // calculation lookback period. - EstimatedSavingsPercentage *string - - // The existing hourly commitment for the Savings Plan type. - ExistingHourlyCommitment *string - - // The recommended or custom hourly commitment. - HourlyCommitmentToPurchase *string - - // The date and time of the last hour that went into the analysis. - LatestUsageTimestamp *string - - // The lookback period in hours that's used to generate the analysis. - LookbackPeriodInHours *string - - // The related hourly cost, coverage, and utilization metrics over the lookback - // period. - MetricsOverLookbackPeriod []RecommendationDetailHourlyMetrics - - // The upfront cost of the Savings Plan based on the selected payment option. - UpfrontCost *string - - noSmithyDocumentSerde -} - -// Contains your request parameters, Savings Plan Recommendations Summary, and -// Details. -type SavingsPlansPurchaseRecommendation struct { - - // The account scope that you want your recommendations for. Amazon Web Services - // calculates recommendations that include the management account and member - // accounts if the value is set to PAYER . If the value is LINKED , recommendations - // are calculated for individual member accounts only. - AccountScope AccountScope - - // The lookback period in days that's used to generate the recommendation. - LookbackPeriodInDays LookbackPeriodInDays - - // The payment option that's used to generate the recommendation. - PaymentOption PaymentOption - - // Details for the Savings Plans that we recommend that you purchase to cover - // existing Savings Plans eligible workloads. - SavingsPlansPurchaseRecommendationDetails []SavingsPlansPurchaseRecommendationDetail - - // Summary metrics for your Savings Plans Recommendations. - SavingsPlansPurchaseRecommendationSummary *SavingsPlansPurchaseRecommendationSummary - - // The requested Savings Plans recommendation type. - SavingsPlansType SupportedSavingsPlansType - - // The Savings Plans recommendation term in years. It's used to generate the - // recommendation. - TermInYears TermInYears - - noSmithyDocumentSerde -} - -// Details for your recommended Savings Plans. -type SavingsPlansPurchaseRecommendationDetail struct { - - // The AccountID the recommendation is generated for. - AccountId *string - - // The currency code that Amazon Web Services used to generate the recommendations - // and present potential savings. - CurrencyCode *string - - // The average value of hourly On-Demand spend over the lookback period of the - // applicable usage type. - CurrentAverageHourlyOnDemandSpend *string - - // The highest value of hourly On-Demand spend over the lookback period of the - // applicable usage type. - CurrentMaximumHourlyOnDemandSpend *string - - // The lowest value of hourly On-Demand spend over the lookback period of the - // applicable usage type. - CurrentMinimumHourlyOnDemandSpend *string - - // The estimated utilization of the recommended Savings Plans. - EstimatedAverageUtilization *string - - // The estimated monthly savings amount based on the recommended Savings Plans. - EstimatedMonthlySavingsAmount *string - - // The remaining On-Demand cost estimated to not be covered by the recommended - // Savings Plans, over the length of the lookback period. - EstimatedOnDemandCost *string - - // The estimated On-Demand costs you expect with no additional commitment, based - // on your usage of the selected time period and the Savings Plans you own. - EstimatedOnDemandCostWithCurrentCommitment *string - - // The estimated return on investment that's based on the recommended Savings - // Plans that you purchased. This is calculated as estimatedSavingsAmount / - // estimatedSPCost *100. - EstimatedROI *string - - // The cost of the recommended Savings Plans over the length of the lookback - // period. - EstimatedSPCost *string - - // The estimated savings amount that's based on the recommended Savings Plans over - // the length of the lookback period. - EstimatedSavingsAmount *string - - // The estimated savings percentage relative to the total cost of applicable - // On-Demand usage over the lookback period. - EstimatedSavingsPercentage *string - - // The recommended hourly commitment level for the Savings Plans type and the - // configuration that's based on the usage during the lookback period. - HourlyCommitmentToPurchase *string - - // Contains detailed information about a specific Savings Plan recommendation. - RecommendationDetailId *string - - // Details for your recommended Savings Plans. - SavingsPlansDetails *SavingsPlansDetails - - // The upfront cost of the recommended Savings Plans, based on the selected - // payment option. - UpfrontCost *string - - noSmithyDocumentSerde -} - -// Metadata about your Savings Plans Purchase Recommendations. -type SavingsPlansPurchaseRecommendationMetadata struct { - - // Additional metadata that might be applicable to the recommendation. - AdditionalMetadata *string - - // The timestamp that shows when the recommendations were generated. - GenerationTimestamp *string - - // The unique identifier for the recommendation set. - RecommendationId *string - - noSmithyDocumentSerde -} - -// Summary metrics for your Savings Plans Purchase Recommendations. -type SavingsPlansPurchaseRecommendationSummary struct { - - // The currency code that Amazon Web Services used to generate the recommendations - // and present potential savings. - CurrencyCode *string - - // The current total on demand spend of the applicable usage types over the - // lookback period. - CurrentOnDemandSpend *string - - // The recommended Savings Plans cost on a daily (24 hourly) basis. - DailyCommitmentToPurchase *string - - // The estimated monthly savings amount that's based on the recommended Savings - // Plans purchase. - EstimatedMonthlySavingsAmount *string - - // The estimated On-Demand costs you expect with no additional commitment. It's - // based on your usage of the selected time period and the Savings Plans you own. - EstimatedOnDemandCostWithCurrentCommitment *string - - // The estimated return on investment that's based on the recommended Savings - // Plans and estimated savings. - EstimatedROI *string - - // The estimated total savings over the lookback period, based on the purchase of - // the recommended Savings Plans. - EstimatedSavingsAmount *string - - // The estimated savings relative to the total cost of On-Demand usage, over the - // lookback period. This is calculated as estimatedSavingsAmount / - // CurrentOnDemandSpend *100. - EstimatedSavingsPercentage *string - - // The estimated total cost of the usage after purchasing the recommended Savings - // Plans. This is a sum of the cost of Savings Plans during this term, and the - // remaining On-Demand usage. - EstimatedTotalCost *string - - // The recommended hourly commitment that's based on the recommendation parameters. - HourlyCommitmentToPurchase *string - - // The aggregate number of Savings Plans recommendations that exist for your - // account. - TotalRecommendationCount *string - - noSmithyDocumentSerde -} - -// The amount of savings that you're accumulating, against the public On-Demand -// rate of the usage accrued in an account. -type SavingsPlansSavings struct { - - // The savings amount that you're accumulating for the usage that's covered by a - // Savings Plans, when compared to the On-Demand equivalent of the same usage. - NetSavings *string - - // How much the amount that the usage would have cost if it was accrued at the - // On-Demand rate. - OnDemandCostEquivalent *string - - noSmithyDocumentSerde -} - -// The measurement of how well you're using your existing Savings Plans. -type SavingsPlansUtilization struct { - - // The total amount of Savings Plans commitment that's been purchased in an - // account (or set of accounts). - TotalCommitment *string - - // The amount of your Savings Plans commitment that wasn't consumed from Savings - // Plans eligible usage in a specific period. - UnusedCommitment *string - - // The amount of your Savings Plans commitment that was consumed from Savings - // Plans eligible usage in a specific period. - UsedCommitment *string - - // The amount of UsedCommitment divided by the TotalCommitment for your Savings - // Plans. - UtilizationPercentage *string - - noSmithyDocumentSerde -} - -// The aggregated utilization metrics for your Savings Plans usage. -type SavingsPlansUtilizationAggregates struct { - - // A ratio of your effectiveness of using existing Savings Plans to apply to - // workloads that are Savings Plans eligible. - // - // This member is required. - Utilization *SavingsPlansUtilization - - // The total amortized commitment for a Savings Plans. This includes the sum of - // the upfront and recurring Savings Plans fees. - AmortizedCommitment *SavingsPlansAmortizedCommitment - - // The amount that's saved by using existing Savings Plans. Savings returns both - // net savings from Savings Plans and also the onDemandCostEquivalent of the - // Savings Plans when considering the utilization rate. - Savings *SavingsPlansSavings - - noSmithyDocumentSerde -} - -// The amount of Savings Plans utilization (in hours). -type SavingsPlansUtilizationByTime struct { - - // The time period of the request. - // - // This member is required. - TimePeriod *DateInterval - - // A ratio of your effectiveness of using existing Savings Plans to apply to - // workloads that are Savings Plans eligible. - // - // This member is required. - Utilization *SavingsPlansUtilization - - // The total amortized commitment for a Savings Plans. This includes the sum of - // the upfront and recurring Savings Plans fees. - AmortizedCommitment *SavingsPlansAmortizedCommitment - - // The amount that's saved by using existing Savings Plans. Savings returns both - // net savings from Savings Plans and also the onDemandCostEquivalent of the - // Savings Plans when considering the utilization rate. - Savings *SavingsPlansSavings - - noSmithyDocumentSerde -} - -// A single daily or monthly Savings Plans utilization rate and details for your -// account. A management account in an organization have access to member accounts. -// You can use GetDimensionValues to determine the possible dimension values. -type SavingsPlansUtilizationDetail struct { - - // The total amortized commitment for a Savings Plans. Includes the sum of the - // upfront and recurring Savings Plans fees. - AmortizedCommitment *SavingsPlansAmortizedCommitment - - // The attribute that applies to a specific Dimension . - Attributes map[string]string - - // The amount saved by using existing Savings Plans. Savings returns both net - // savings from savings plans and also the onDemandCostEquivalent of the Savings - // Plans when considering the utilization rate. - Savings *SavingsPlansSavings - - // The unique Amazon Resource Name (ARN) for a particular Savings Plan. - SavingsPlanArn *string - - // A ratio of your effectiveness of using existing Savings Plans to apply to - // workloads that are Savings Plans eligible. - Utilization *SavingsPlansUtilization - - noSmithyDocumentSerde -} - -// Hardware specifications for the service that you want recommendations for. -type ServiceSpecification struct { - - // The Amazon EC2 hardware specifications that you want Amazon Web Services to - // provide recommendations for. - EC2Specification *EC2Specification - - noSmithyDocumentSerde -} - -// The details for how to sort the data. -type SortDefinition struct { - - // The key that's used to sort the data. - // - // This member is required. - Key *string - - // The order that's used to sort the data. - SortOrder SortOrder - - noSmithyDocumentSerde -} - -// The recipient of AnomalySubscription notifications. -type Subscriber struct { - - // The email address or SNS Amazon Resource Name (ARN). This depends on the Type . - Address *string - - // Indicates if the subscriber accepts the notifications. - Status SubscriberStatus - - // The notification delivery channel. - Type SubscriberType - - noSmithyDocumentSerde -} - -// The values that are available for a tag. -// -// If Values and Key aren't specified, the ABSENT MatchOption is applied to all -// tags. That is, it's filtered on resources with no tags. -// -// If Key is provided and Values isn't specified, the ABSENT MatchOption is -// applied to the tag Key only. That is, it's filtered on resources without the -// given tag key. -type TagValues struct { - - // The key for the tag. - Key *string - - // The match options that you can use to filter your results. MatchOptions is only - // applicable for actions related to cost category. The default values for - // MatchOptions are EQUALS and CASE_SENSITIVE . - MatchOptions []MatchOption - - // The specific value of the tag. - Values []string - - noSmithyDocumentSerde -} - -// Details on recommended instance. -type TargetInstance struct { - - // The currency code that Amazon Web Services used to calculate the costs for this - // instance. - CurrencyCode *string - - // Determines whether this recommendation is the defaulted Amazon Web Services - // recommendation. - DefaultTargetInstance bool - - // The expected cost to operate this instance type on a monthly basis. - EstimatedMonthlyCost *string - - // The estimated savings that result from modification, on a monthly basis. - EstimatedMonthlySavings *string - - // The expected utilization metrics for target instance type. - ExpectedResourceUtilization *ResourceUtilization - - // Explains the actions that you might need to take to successfully migrate your - // workloads from the current instance type to the recommended instance type. - PlatformDifferences []PlatformDifference - - // Details on the target instance type. - ResourceDetails *ResourceDetails - - noSmithyDocumentSerde -} - -// Details on termination recommendation. -type TerminateRecommendationDetail struct { - - // The currency code that Amazon Web Services used to calculate the costs for this - // instance. - CurrencyCode *string - - // The estimated savings that result from modification, on a monthly basis. - EstimatedMonthlySavings *string - - noSmithyDocumentSerde -} - -// Filters cost anomalies based on the total impact. -type TotalImpactFilter struct { - - // The comparing value that's used in the filter. - // - // This member is required. - NumericOperator NumericOperator - - // The lower bound dollar value that's used in the filter. - // - // This member is required. - StartValue float64 - - // The upper bound dollar value that's used in the filter. - EndValue float64 - - noSmithyDocumentSerde -} - -// Gives a detailed description of the result of an action. It's on each cost -// allocation tag entry in the request. -type UpdateCostAllocationTagsStatusError struct { - - // An error code representing why the action failed on this entry. - Code *string - - // A message explaining why the action failed on this entry. - Message *string - - // The key for the cost allocation tag. - TagKey *string - - noSmithyDocumentSerde -} - -// The amount of utilization, in hours. -type UtilizationByTime struct { - - // The groups that this utilization result uses. - Groups []ReservationUtilizationGroup - - // The period of time that this utilization was used for. - TimePeriod *DateInterval - - // The total number of reservation hours that were used. - Total *ReservationAggregates - - noSmithyDocumentSerde -} - -type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/validators.go deleted file mode 100644 index 746376738b..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/costexplorer/validators.go +++ /dev/null @@ -1,2055 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package costexplorer - -import ( - "context" - "fmt" - "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" -) - -type validateOpCreateAnomalyMonitor struct { -} - -func (*validateOpCreateAnomalyMonitor) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateAnomalyMonitor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateAnomalyMonitorInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateAnomalyMonitorInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateAnomalySubscription struct { -} - -func (*validateOpCreateAnomalySubscription) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateAnomalySubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateAnomalySubscriptionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateAnomalySubscriptionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateCostCategoryDefinition struct { -} - -func (*validateOpCreateCostCategoryDefinition) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateCostCategoryDefinition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateCostCategoryDefinitionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateCostCategoryDefinitionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteAnomalyMonitor struct { -} - -func (*validateOpDeleteAnomalyMonitor) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteAnomalyMonitor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteAnomalyMonitorInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteAnomalyMonitorInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteAnomalySubscription struct { -} - -func (*validateOpDeleteAnomalySubscription) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteAnomalySubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteAnomalySubscriptionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteAnomalySubscriptionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteCostCategoryDefinition struct { -} - -func (*validateOpDeleteCostCategoryDefinition) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteCostCategoryDefinition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteCostCategoryDefinitionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteCostCategoryDefinitionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeCostCategoryDefinition struct { -} - -func (*validateOpDescribeCostCategoryDefinition) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeCostCategoryDefinition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeCostCategoryDefinitionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeCostCategoryDefinitionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetAnomalies struct { -} - -func (*validateOpGetAnomalies) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetAnomalies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetAnomaliesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetAnomaliesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetApproximateUsageRecords struct { -} - -func (*validateOpGetApproximateUsageRecords) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetApproximateUsageRecords) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetApproximateUsageRecordsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetApproximateUsageRecordsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetCommitmentPurchaseAnalysis struct { -} - -func (*validateOpGetCommitmentPurchaseAnalysis) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetCommitmentPurchaseAnalysis) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetCommitmentPurchaseAnalysisInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetCommitmentPurchaseAnalysisInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetCostAndUsageComparisons struct { -} - -func (*validateOpGetCostAndUsageComparisons) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetCostAndUsageComparisons) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetCostAndUsageComparisonsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetCostAndUsageComparisonsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetCostAndUsage struct { -} - -func (*validateOpGetCostAndUsage) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetCostAndUsage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetCostAndUsageInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetCostAndUsageInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetCostAndUsageWithResources struct { -} - -func (*validateOpGetCostAndUsageWithResources) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetCostAndUsageWithResources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetCostAndUsageWithResourcesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetCostAndUsageWithResourcesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetCostCategories struct { -} - -func (*validateOpGetCostCategories) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetCostCategories) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetCostCategoriesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetCostCategoriesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetCostComparisonDrivers struct { -} - -func (*validateOpGetCostComparisonDrivers) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetCostComparisonDrivers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetCostComparisonDriversInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetCostComparisonDriversInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetCostForecast struct { -} - -func (*validateOpGetCostForecast) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetCostForecast) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetCostForecastInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetCostForecastInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetDimensionValues struct { -} - -func (*validateOpGetDimensionValues) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetDimensionValues) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetDimensionValuesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetDimensionValuesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetReservationCoverage struct { -} - -func (*validateOpGetReservationCoverage) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetReservationCoverage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetReservationCoverageInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetReservationCoverageInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetReservationPurchaseRecommendation struct { -} - -func (*validateOpGetReservationPurchaseRecommendation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetReservationPurchaseRecommendation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetReservationPurchaseRecommendationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetReservationPurchaseRecommendationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetReservationUtilization struct { -} - -func (*validateOpGetReservationUtilization) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetReservationUtilization) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetReservationUtilizationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetReservationUtilizationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetRightsizingRecommendation struct { -} - -func (*validateOpGetRightsizingRecommendation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetRightsizingRecommendation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetRightsizingRecommendationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetRightsizingRecommendationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetSavingsPlanPurchaseRecommendationDetails struct { -} - -func (*validateOpGetSavingsPlanPurchaseRecommendationDetails) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetSavingsPlanPurchaseRecommendationDetails) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetSavingsPlanPurchaseRecommendationDetailsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetSavingsPlanPurchaseRecommendationDetailsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetSavingsPlansCoverage struct { -} - -func (*validateOpGetSavingsPlansCoverage) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetSavingsPlansCoverage) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetSavingsPlansCoverageInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetSavingsPlansCoverageInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetSavingsPlansPurchaseRecommendation struct { -} - -func (*validateOpGetSavingsPlansPurchaseRecommendation) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetSavingsPlansPurchaseRecommendation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetSavingsPlansPurchaseRecommendationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetSavingsPlansPurchaseRecommendationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetSavingsPlansUtilizationDetails struct { -} - -func (*validateOpGetSavingsPlansUtilizationDetails) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetSavingsPlansUtilizationDetails) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetSavingsPlansUtilizationDetailsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetSavingsPlansUtilizationDetailsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetSavingsPlansUtilization struct { -} - -func (*validateOpGetSavingsPlansUtilization) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetSavingsPlansUtilization) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetSavingsPlansUtilizationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetSavingsPlansUtilizationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetTags struct { -} - -func (*validateOpGetTags) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetTags) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetTagsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetTagsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpGetUsageForecast struct { -} - -func (*validateOpGetUsageForecast) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetUsageForecast) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetUsageForecastInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetUsageForecastInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListTagsForResource struct { -} - -func (*validateOpListTagsForResource) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListTagsForResourceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListTagsForResourceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpProvideAnomalyFeedback struct { -} - -func (*validateOpProvideAnomalyFeedback) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpProvideAnomalyFeedback) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ProvideAnomalyFeedbackInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpProvideAnomalyFeedbackInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpStartCommitmentPurchaseAnalysis struct { -} - -func (*validateOpStartCommitmentPurchaseAnalysis) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpStartCommitmentPurchaseAnalysis) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*StartCommitmentPurchaseAnalysisInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpStartCommitmentPurchaseAnalysisInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpStartCostAllocationTagBackfill struct { -} - -func (*validateOpStartCostAllocationTagBackfill) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpStartCostAllocationTagBackfill) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*StartCostAllocationTagBackfillInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpStartCostAllocationTagBackfillInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpTagResource struct { -} - -func (*validateOpTagResource) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*TagResourceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpTagResourceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUntagResource struct { -} - -func (*validateOpUntagResource) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UntagResourceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUntagResourceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateAnomalyMonitor struct { -} - -func (*validateOpUpdateAnomalyMonitor) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateAnomalyMonitor) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateAnomalyMonitorInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateAnomalyMonitorInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateAnomalySubscription struct { -} - -func (*validateOpUpdateAnomalySubscription) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateAnomalySubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateAnomalySubscriptionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateAnomalySubscriptionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateCostAllocationTagsStatus struct { -} - -func (*validateOpUpdateCostAllocationTagsStatus) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateCostAllocationTagsStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateCostAllocationTagsStatusInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateCostAllocationTagsStatusInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateCostCategoryDefinition struct { -} - -func (*validateOpUpdateCostCategoryDefinition) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateCostCategoryDefinition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateCostCategoryDefinitionInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateCostCategoryDefinitionInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -func addOpCreateAnomalyMonitorValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateAnomalyMonitor{}, middleware.After) -} - -func addOpCreateAnomalySubscriptionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateAnomalySubscription{}, middleware.After) -} - -func addOpCreateCostCategoryDefinitionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateCostCategoryDefinition{}, middleware.After) -} - -func addOpDeleteAnomalyMonitorValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteAnomalyMonitor{}, middleware.After) -} - -func addOpDeleteAnomalySubscriptionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteAnomalySubscription{}, middleware.After) -} - -func addOpDeleteCostCategoryDefinitionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteCostCategoryDefinition{}, middleware.After) -} - -func addOpDescribeCostCategoryDefinitionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeCostCategoryDefinition{}, middleware.After) -} - -func addOpGetAnomaliesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetAnomalies{}, middleware.After) -} - -func addOpGetApproximateUsageRecordsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetApproximateUsageRecords{}, middleware.After) -} - -func addOpGetCommitmentPurchaseAnalysisValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetCommitmentPurchaseAnalysis{}, middleware.After) -} - -func addOpGetCostAndUsageComparisonsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetCostAndUsageComparisons{}, middleware.After) -} - -func addOpGetCostAndUsageValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetCostAndUsage{}, middleware.After) -} - -func addOpGetCostAndUsageWithResourcesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetCostAndUsageWithResources{}, middleware.After) -} - -func addOpGetCostCategoriesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetCostCategories{}, middleware.After) -} - -func addOpGetCostComparisonDriversValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetCostComparisonDrivers{}, middleware.After) -} - -func addOpGetCostForecastValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetCostForecast{}, middleware.After) -} - -func addOpGetDimensionValuesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetDimensionValues{}, middleware.After) -} - -func addOpGetReservationCoverageValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetReservationCoverage{}, middleware.After) -} - -func addOpGetReservationPurchaseRecommendationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetReservationPurchaseRecommendation{}, middleware.After) -} - -func addOpGetReservationUtilizationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetReservationUtilization{}, middleware.After) -} - -func addOpGetRightsizingRecommendationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetRightsizingRecommendation{}, middleware.After) -} - -func addOpGetSavingsPlanPurchaseRecommendationDetailsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetSavingsPlanPurchaseRecommendationDetails{}, middleware.After) -} - -func addOpGetSavingsPlansCoverageValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetSavingsPlansCoverage{}, middleware.After) -} - -func addOpGetSavingsPlansPurchaseRecommendationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetSavingsPlansPurchaseRecommendation{}, middleware.After) -} - -func addOpGetSavingsPlansUtilizationDetailsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetSavingsPlansUtilizationDetails{}, middleware.After) -} - -func addOpGetSavingsPlansUtilizationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetSavingsPlansUtilization{}, middleware.After) -} - -func addOpGetTagsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetTags{}, middleware.After) -} - -func addOpGetUsageForecastValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetUsageForecast{}, middleware.After) -} - -func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) -} - -func addOpProvideAnomalyFeedbackValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpProvideAnomalyFeedback{}, middleware.After) -} - -func addOpStartCommitmentPurchaseAnalysisValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpStartCommitmentPurchaseAnalysis{}, middleware.After) -} - -func addOpStartCostAllocationTagBackfillValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpStartCostAllocationTagBackfill{}, middleware.After) -} - -func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) -} - -func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) -} - -func addOpUpdateAnomalyMonitorValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateAnomalyMonitor{}, middleware.After) -} - -func addOpUpdateAnomalySubscriptionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateAnomalySubscription{}, middleware.After) -} - -func addOpUpdateCostAllocationTagsStatusValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateCostAllocationTagsStatus{}, middleware.After) -} - -func addOpUpdateCostCategoryDefinitionValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateCostCategoryDefinition{}, middleware.After) -} - -func validateAnomalyDateInterval(v *types.AnomalyDateInterval) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AnomalyDateInterval"} - if v.StartDate == nil { - invalidParams.Add(smithy.NewErrParamRequired("StartDate")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateAnomalyMonitor(v *types.AnomalyMonitor) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AnomalyMonitor"} - if v.MonitorName == nil { - invalidParams.Add(smithy.NewErrParamRequired("MonitorName")) - } - if len(v.MonitorType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("MonitorType")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateAnomalySubscription(v *types.AnomalySubscription) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AnomalySubscription"} - if v.MonitorArnList == nil { - invalidParams.Add(smithy.NewErrParamRequired("MonitorArnList")) - } - if v.Subscribers == nil { - invalidParams.Add(smithy.NewErrParamRequired("Subscribers")) - } - if len(v.Frequency) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Frequency")) - } - if v.SubscriptionName == nil { - invalidParams.Add(smithy.NewErrParamRequired("SubscriptionName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateCommitmentPurchaseAnalysisConfiguration(v *types.CommitmentPurchaseAnalysisConfiguration) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CommitmentPurchaseAnalysisConfiguration"} - if v.SavingsPlansPurchaseAnalysisConfiguration != nil { - if err := validateSavingsPlansPurchaseAnalysisConfiguration(v.SavingsPlansPurchaseAnalysisConfiguration); err != nil { - invalidParams.AddNested("SavingsPlansPurchaseAnalysisConfiguration", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateCostAllocationTagStatusEntry(v *types.CostAllocationTagStatusEntry) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CostAllocationTagStatusEntry"} - if v.TagKey == nil { - invalidParams.Add(smithy.NewErrParamRequired("TagKey")) - } - if len(v.Status) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Status")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateCostAllocationTagStatusList(v []types.CostAllocationTagStatusEntry) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CostAllocationTagStatusList"} - for i := range v { - if err := validateCostAllocationTagStatusEntry(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateCostCategorySplitChargeRule(v *types.CostCategorySplitChargeRule) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CostCategorySplitChargeRule"} - if v.Source == nil { - invalidParams.Add(smithy.NewErrParamRequired("Source")) - } - if v.Targets == nil { - invalidParams.Add(smithy.NewErrParamRequired("Targets")) - } - if len(v.Method) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Method")) - } - if v.Parameters != nil { - if err := validateCostCategorySplitChargeRuleParametersList(v.Parameters); err != nil { - invalidParams.AddNested("Parameters", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateCostCategorySplitChargeRuleParameter(v *types.CostCategorySplitChargeRuleParameter) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CostCategorySplitChargeRuleParameter"} - if len(v.Type) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Type")) - } - if v.Values == nil { - invalidParams.Add(smithy.NewErrParamRequired("Values")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateCostCategorySplitChargeRuleParametersList(v []types.CostCategorySplitChargeRuleParameter) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CostCategorySplitChargeRuleParametersList"} - for i := range v { - if err := validateCostCategorySplitChargeRuleParameter(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateCostCategorySplitChargeRulesList(v []types.CostCategorySplitChargeRule) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CostCategorySplitChargeRulesList"} - for i := range v { - if err := validateCostCategorySplitChargeRule(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateDateInterval(v *types.DateInterval) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DateInterval"} - if v.Start == nil { - invalidParams.Add(smithy.NewErrParamRequired("Start")) - } - if v.End == nil { - invalidParams.Add(smithy.NewErrParamRequired("End")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateResourceTag(v *types.ResourceTag) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ResourceTag"} - if v.Key == nil { - invalidParams.Add(smithy.NewErrParamRequired("Key")) - } - if v.Value == nil { - invalidParams.Add(smithy.NewErrParamRequired("Value")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateResourceTagList(v []types.ResourceTag) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ResourceTagList"} - for i := range v { - if err := validateResourceTag(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateRightsizingRecommendationConfiguration(v *types.RightsizingRecommendationConfiguration) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RightsizingRecommendationConfiguration"} - if len(v.RecommendationTarget) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("RecommendationTarget")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateSavingsPlansPurchaseAnalysisConfiguration(v *types.SavingsPlansPurchaseAnalysisConfiguration) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "SavingsPlansPurchaseAnalysisConfiguration"} - if len(v.AnalysisType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("AnalysisType")) - } - if v.SavingsPlansToAdd == nil { - invalidParams.Add(smithy.NewErrParamRequired("SavingsPlansToAdd")) - } - if v.LookBackTimePeriod == nil { - invalidParams.Add(smithy.NewErrParamRequired("LookBackTimePeriod")) - } else if v.LookBackTimePeriod != nil { - if err := validateDateInterval(v.LookBackTimePeriod); err != nil { - invalidParams.AddNested("LookBackTimePeriod", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateSortDefinition(v *types.SortDefinition) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "SortDefinition"} - if v.Key == nil { - invalidParams.Add(smithy.NewErrParamRequired("Key")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateSortDefinitions(v []types.SortDefinition) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "SortDefinitions"} - for i := range v { - if err := validateSortDefinition(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateTotalImpactFilter(v *types.TotalImpactFilter) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "TotalImpactFilter"} - if len(v.NumericOperator) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("NumericOperator")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateAnomalyMonitorInput(v *CreateAnomalyMonitorInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateAnomalyMonitorInput"} - if v.AnomalyMonitor == nil { - invalidParams.Add(smithy.NewErrParamRequired("AnomalyMonitor")) - } else if v.AnomalyMonitor != nil { - if err := validateAnomalyMonitor(v.AnomalyMonitor); err != nil { - invalidParams.AddNested("AnomalyMonitor", err.(smithy.InvalidParamsError)) - } - } - if v.ResourceTags != nil { - if err := validateResourceTagList(v.ResourceTags); err != nil { - invalidParams.AddNested("ResourceTags", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateAnomalySubscriptionInput(v *CreateAnomalySubscriptionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateAnomalySubscriptionInput"} - if v.AnomalySubscription == nil { - invalidParams.Add(smithy.NewErrParamRequired("AnomalySubscription")) - } else if v.AnomalySubscription != nil { - if err := validateAnomalySubscription(v.AnomalySubscription); err != nil { - invalidParams.AddNested("AnomalySubscription", err.(smithy.InvalidParamsError)) - } - } - if v.ResourceTags != nil { - if err := validateResourceTagList(v.ResourceTags); err != nil { - invalidParams.AddNested("ResourceTags", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateCostCategoryDefinitionInput(v *CreateCostCategoryDefinitionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateCostCategoryDefinitionInput"} - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if len(v.RuleVersion) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("RuleVersion")) - } - if v.Rules == nil { - invalidParams.Add(smithy.NewErrParamRequired("Rules")) - } - if v.SplitChargeRules != nil { - if err := validateCostCategorySplitChargeRulesList(v.SplitChargeRules); err != nil { - invalidParams.AddNested("SplitChargeRules", err.(smithy.InvalidParamsError)) - } - } - if v.ResourceTags != nil { - if err := validateResourceTagList(v.ResourceTags); err != nil { - invalidParams.AddNested("ResourceTags", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteAnomalyMonitorInput(v *DeleteAnomalyMonitorInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteAnomalyMonitorInput"} - if v.MonitorArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("MonitorArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteAnomalySubscriptionInput(v *DeleteAnomalySubscriptionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteAnomalySubscriptionInput"} - if v.SubscriptionArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("SubscriptionArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteCostCategoryDefinitionInput(v *DeleteCostCategoryDefinitionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteCostCategoryDefinitionInput"} - if v.CostCategoryArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("CostCategoryArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeCostCategoryDefinitionInput(v *DescribeCostCategoryDefinitionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeCostCategoryDefinitionInput"} - if v.CostCategoryArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("CostCategoryArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetAnomaliesInput(v *GetAnomaliesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetAnomaliesInput"} - if v.DateInterval == nil { - invalidParams.Add(smithy.NewErrParamRequired("DateInterval")) - } else if v.DateInterval != nil { - if err := validateAnomalyDateInterval(v.DateInterval); err != nil { - invalidParams.AddNested("DateInterval", err.(smithy.InvalidParamsError)) - } - } - if v.TotalImpact != nil { - if err := validateTotalImpactFilter(v.TotalImpact); err != nil { - invalidParams.AddNested("TotalImpact", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetApproximateUsageRecordsInput(v *GetApproximateUsageRecordsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetApproximateUsageRecordsInput"} - if len(v.Granularity) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Granularity")) - } - if len(v.ApproximationDimension) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("ApproximationDimension")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetCommitmentPurchaseAnalysisInput(v *GetCommitmentPurchaseAnalysisInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetCommitmentPurchaseAnalysisInput"} - if v.AnalysisId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AnalysisId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetCostAndUsageComparisonsInput(v *GetCostAndUsageComparisonsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetCostAndUsageComparisonsInput"} - if v.BaselineTimePeriod == nil { - invalidParams.Add(smithy.NewErrParamRequired("BaselineTimePeriod")) - } else if v.BaselineTimePeriod != nil { - if err := validateDateInterval(v.BaselineTimePeriod); err != nil { - invalidParams.AddNested("BaselineTimePeriod", err.(smithy.InvalidParamsError)) - } - } - if v.ComparisonTimePeriod == nil { - invalidParams.Add(smithy.NewErrParamRequired("ComparisonTimePeriod")) - } else if v.ComparisonTimePeriod != nil { - if err := validateDateInterval(v.ComparisonTimePeriod); err != nil { - invalidParams.AddNested("ComparisonTimePeriod", err.(smithy.InvalidParamsError)) - } - } - if v.MetricForComparison == nil { - invalidParams.Add(smithy.NewErrParamRequired("MetricForComparison")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetCostAndUsageInput(v *GetCostAndUsageInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetCostAndUsageInput"} - if v.TimePeriod == nil { - invalidParams.Add(smithy.NewErrParamRequired("TimePeriod")) - } else if v.TimePeriod != nil { - if err := validateDateInterval(v.TimePeriod); err != nil { - invalidParams.AddNested("TimePeriod", err.(smithy.InvalidParamsError)) - } - } - if len(v.Granularity) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Granularity")) - } - if v.Metrics == nil { - invalidParams.Add(smithy.NewErrParamRequired("Metrics")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetCostAndUsageWithResourcesInput(v *GetCostAndUsageWithResourcesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetCostAndUsageWithResourcesInput"} - if v.TimePeriod == nil { - invalidParams.Add(smithy.NewErrParamRequired("TimePeriod")) - } else if v.TimePeriod != nil { - if err := validateDateInterval(v.TimePeriod); err != nil { - invalidParams.AddNested("TimePeriod", err.(smithy.InvalidParamsError)) - } - } - if len(v.Granularity) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Granularity")) - } - if v.Filter == nil { - invalidParams.Add(smithy.NewErrParamRequired("Filter")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetCostCategoriesInput(v *GetCostCategoriesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetCostCategoriesInput"} - if v.TimePeriod == nil { - invalidParams.Add(smithy.NewErrParamRequired("TimePeriod")) - } else if v.TimePeriod != nil { - if err := validateDateInterval(v.TimePeriod); err != nil { - invalidParams.AddNested("TimePeriod", err.(smithy.InvalidParamsError)) - } - } - if v.SortBy != nil { - if err := validateSortDefinitions(v.SortBy); err != nil { - invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetCostComparisonDriversInput(v *GetCostComparisonDriversInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetCostComparisonDriversInput"} - if v.BaselineTimePeriod == nil { - invalidParams.Add(smithy.NewErrParamRequired("BaselineTimePeriod")) - } else if v.BaselineTimePeriod != nil { - if err := validateDateInterval(v.BaselineTimePeriod); err != nil { - invalidParams.AddNested("BaselineTimePeriod", err.(smithy.InvalidParamsError)) - } - } - if v.ComparisonTimePeriod == nil { - invalidParams.Add(smithy.NewErrParamRequired("ComparisonTimePeriod")) - } else if v.ComparisonTimePeriod != nil { - if err := validateDateInterval(v.ComparisonTimePeriod); err != nil { - invalidParams.AddNested("ComparisonTimePeriod", err.(smithy.InvalidParamsError)) - } - } - if v.MetricForComparison == nil { - invalidParams.Add(smithy.NewErrParamRequired("MetricForComparison")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetCostForecastInput(v *GetCostForecastInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetCostForecastInput"} - if v.TimePeriod == nil { - invalidParams.Add(smithy.NewErrParamRequired("TimePeriod")) - } else if v.TimePeriod != nil { - if err := validateDateInterval(v.TimePeriod); err != nil { - invalidParams.AddNested("TimePeriod", err.(smithy.InvalidParamsError)) - } - } - if len(v.Metric) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Metric")) - } - if len(v.Granularity) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Granularity")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetDimensionValuesInput(v *GetDimensionValuesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetDimensionValuesInput"} - if v.TimePeriod == nil { - invalidParams.Add(smithy.NewErrParamRequired("TimePeriod")) - } else if v.TimePeriod != nil { - if err := validateDateInterval(v.TimePeriod); err != nil { - invalidParams.AddNested("TimePeriod", err.(smithy.InvalidParamsError)) - } - } - if len(v.Dimension) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Dimension")) - } - if v.SortBy != nil { - if err := validateSortDefinitions(v.SortBy); err != nil { - invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetReservationCoverageInput(v *GetReservationCoverageInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetReservationCoverageInput"} - if v.TimePeriod == nil { - invalidParams.Add(smithy.NewErrParamRequired("TimePeriod")) - } else if v.TimePeriod != nil { - if err := validateDateInterval(v.TimePeriod); err != nil { - invalidParams.AddNested("TimePeriod", err.(smithy.InvalidParamsError)) - } - } - if v.SortBy != nil { - if err := validateSortDefinition(v.SortBy); err != nil { - invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetReservationPurchaseRecommendationInput(v *GetReservationPurchaseRecommendationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetReservationPurchaseRecommendationInput"} - if v.Service == nil { - invalidParams.Add(smithy.NewErrParamRequired("Service")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetReservationUtilizationInput(v *GetReservationUtilizationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetReservationUtilizationInput"} - if v.TimePeriod == nil { - invalidParams.Add(smithy.NewErrParamRequired("TimePeriod")) - } else if v.TimePeriod != nil { - if err := validateDateInterval(v.TimePeriod); err != nil { - invalidParams.AddNested("TimePeriod", err.(smithy.InvalidParamsError)) - } - } - if v.SortBy != nil { - if err := validateSortDefinition(v.SortBy); err != nil { - invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetRightsizingRecommendationInput(v *GetRightsizingRecommendationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetRightsizingRecommendationInput"} - if v.Configuration != nil { - if err := validateRightsizingRecommendationConfiguration(v.Configuration); err != nil { - invalidParams.AddNested("Configuration", err.(smithy.InvalidParamsError)) - } - } - if v.Service == nil { - invalidParams.Add(smithy.NewErrParamRequired("Service")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetSavingsPlanPurchaseRecommendationDetailsInput(v *GetSavingsPlanPurchaseRecommendationDetailsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetSavingsPlanPurchaseRecommendationDetailsInput"} - if v.RecommendationDetailId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RecommendationDetailId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetSavingsPlansCoverageInput(v *GetSavingsPlansCoverageInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetSavingsPlansCoverageInput"} - if v.TimePeriod == nil { - invalidParams.Add(smithy.NewErrParamRequired("TimePeriod")) - } else if v.TimePeriod != nil { - if err := validateDateInterval(v.TimePeriod); err != nil { - invalidParams.AddNested("TimePeriod", err.(smithy.InvalidParamsError)) - } - } - if v.SortBy != nil { - if err := validateSortDefinition(v.SortBy); err != nil { - invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetSavingsPlansPurchaseRecommendationInput(v *GetSavingsPlansPurchaseRecommendationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetSavingsPlansPurchaseRecommendationInput"} - if len(v.SavingsPlansType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("SavingsPlansType")) - } - if len(v.TermInYears) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("TermInYears")) - } - if len(v.PaymentOption) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("PaymentOption")) - } - if len(v.LookbackPeriodInDays) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("LookbackPeriodInDays")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetSavingsPlansUtilizationDetailsInput(v *GetSavingsPlansUtilizationDetailsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetSavingsPlansUtilizationDetailsInput"} - if v.TimePeriod == nil { - invalidParams.Add(smithy.NewErrParamRequired("TimePeriod")) - } else if v.TimePeriod != nil { - if err := validateDateInterval(v.TimePeriod); err != nil { - invalidParams.AddNested("TimePeriod", err.(smithy.InvalidParamsError)) - } - } - if v.SortBy != nil { - if err := validateSortDefinition(v.SortBy); err != nil { - invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetSavingsPlansUtilizationInput(v *GetSavingsPlansUtilizationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetSavingsPlansUtilizationInput"} - if v.TimePeriod == nil { - invalidParams.Add(smithy.NewErrParamRequired("TimePeriod")) - } else if v.TimePeriod != nil { - if err := validateDateInterval(v.TimePeriod); err != nil { - invalidParams.AddNested("TimePeriod", err.(smithy.InvalidParamsError)) - } - } - if v.SortBy != nil { - if err := validateSortDefinition(v.SortBy); err != nil { - invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetTagsInput(v *GetTagsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetTagsInput"} - if v.TimePeriod == nil { - invalidParams.Add(smithy.NewErrParamRequired("TimePeriod")) - } else if v.TimePeriod != nil { - if err := validateDateInterval(v.TimePeriod); err != nil { - invalidParams.AddNested("TimePeriod", err.(smithy.InvalidParamsError)) - } - } - if v.SortBy != nil { - if err := validateSortDefinitions(v.SortBy); err != nil { - invalidParams.AddNested("SortBy", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpGetUsageForecastInput(v *GetUsageForecastInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetUsageForecastInput"} - if v.TimePeriod == nil { - invalidParams.Add(smithy.NewErrParamRequired("TimePeriod")) - } else if v.TimePeriod != nil { - if err := validateDateInterval(v.TimePeriod); err != nil { - invalidParams.AddNested("TimePeriod", err.(smithy.InvalidParamsError)) - } - } - if len(v.Metric) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Metric")) - } - if len(v.Granularity) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Granularity")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} - if v.ResourceArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpProvideAnomalyFeedbackInput(v *ProvideAnomalyFeedbackInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ProvideAnomalyFeedbackInput"} - if v.AnomalyId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AnomalyId")) - } - if len(v.Feedback) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Feedback")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpStartCommitmentPurchaseAnalysisInput(v *StartCommitmentPurchaseAnalysisInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "StartCommitmentPurchaseAnalysisInput"} - if v.CommitmentPurchaseAnalysisConfiguration == nil { - invalidParams.Add(smithy.NewErrParamRequired("CommitmentPurchaseAnalysisConfiguration")) - } else if v.CommitmentPurchaseAnalysisConfiguration != nil { - if err := validateCommitmentPurchaseAnalysisConfiguration(v.CommitmentPurchaseAnalysisConfiguration); err != nil { - invalidParams.AddNested("CommitmentPurchaseAnalysisConfiguration", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpStartCostAllocationTagBackfillInput(v *StartCostAllocationTagBackfillInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "StartCostAllocationTagBackfillInput"} - if v.BackfillFrom == nil { - invalidParams.Add(smithy.NewErrParamRequired("BackfillFrom")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpTagResourceInput(v *TagResourceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} - if v.ResourceArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) - } - if v.ResourceTags == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceTags")) - } else if v.ResourceTags != nil { - if err := validateResourceTagList(v.ResourceTags); err != nil { - invalidParams.AddNested("ResourceTags", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUntagResourceInput(v *UntagResourceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} - if v.ResourceArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) - } - if v.ResourceTagKeys == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceTagKeys")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateAnomalyMonitorInput(v *UpdateAnomalyMonitorInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateAnomalyMonitorInput"} - if v.MonitorArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("MonitorArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateAnomalySubscriptionInput(v *UpdateAnomalySubscriptionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateAnomalySubscriptionInput"} - if v.SubscriptionArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("SubscriptionArn")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateCostAllocationTagsStatusInput(v *UpdateCostAllocationTagsStatusInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateCostAllocationTagsStatusInput"} - if v.CostAllocationTagsStatus == nil { - invalidParams.Add(smithy.NewErrParamRequired("CostAllocationTagsStatus")) - } else if v.CostAllocationTagsStatus != nil { - if err := validateCostAllocationTagStatusList(v.CostAllocationTagsStatus); err != nil { - invalidParams.AddNested("CostAllocationTagsStatus", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateCostCategoryDefinitionInput(v *UpdateCostCategoryDefinitionInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateCostCategoryDefinitionInput"} - if v.CostCategoryArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("CostCategoryArn")) - } - if len(v.RuleVersion) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("RuleVersion")) - } - if v.Rules == nil { - invalidParams.Add(smithy.NewErrParamRequired("Rules")) - } - if v.SplitChargeRules != nil { - if err := validateCostCategorySplitChargeRulesList(v.SplitChargeRules); err != nil { - invalidParams.AddNested("SplitChargeRules", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/CHANGELOG.md b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/CHANGELOG.md deleted file mode 100644 index 79ecffc429..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/CHANGELOG.md +++ /dev/null @@ -1,789 +0,0 @@ -# v1.51.0 (2026-03-31) - -* **Feature**: Added Path field to Account and OrganizationalUnit objects in AWS Organizations API responses. - -# v1.50.6 (2026-03-26) - -* **Bug Fix**: Fix a bug where a recorded clock skew could persist on the client even if the client and server clock ended up realigning. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.50.5 (2026-03-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.50.4 (2026-03-03) - -* **Dependency Update**: Bump minimum Go version to 1.24 -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.50.3 (2026-02-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.50.2 (2026-02-03) - -* **Documentation**: Updated the CloseAccount description. - -# v1.50.1 (2026-01-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.50.0 (2025-12-11) - -* **Feature**: Add support for policy operations on the NETWORK SECURITY DIRECTOR POLICY policy type. - -# v1.49.2 (2025-12-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.49.1 (2025-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade to smithy-go v1.24.0. Notably this version of the library reduces the allocation footprint of the middleware system. We observe a ~10% reduction in allocations per SDK call with this change. - -# v1.49.0 (2025-11-25) - -* **Feature**: Add support for policy operations on the S3_POLICY and BEDROCK_POLICY policy type. -* **Bug Fix**: Add error check for endpoint param binding during auth scheme resolution to fix panic reported in #3234 - -# v1.48.0 (2025-11-21) - -* **Feature**: Add support for policy operations on the UPGRADE_ROLLOUT_POLICY policy type. - -# v1.47.0 (2025-11-20) - -* **Feature**: Added new APIs for Billing Transfer, new policy type INSPECTOR_POLICY, and allow an account to transfer between organizations - -# v1.46.5 (2025-11-19.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.46.4 (2025-11-12) - -* **Bug Fix**: Further reduce allocation overhead when the metrics system isn't in-use. -* **Bug Fix**: Reduce allocation overhead when the client doesn't have any HTTP interceptors configured. -* **Bug Fix**: Remove blank trace spans towards the beginning of the request that added no additional information. This conveys a slight reduction in overall allocations. - -# v1.46.3 (2025-11-11) - -* **Bug Fix**: Return validation error if input region is not a valid host label. - -# v1.46.2 (2025-11-04) - -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade to smithy-go v1.23.2 which should convey some passive reduction of overall allocations, especially when not using the metrics system. - -# v1.46.1 (2025-10-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.46.0 (2025-10-28) - -* **Feature**: Added Account State field to the ListDelegatedAdministrators API response. - -# v1.45.5 (2025-10-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.45.4 (2025-10-16) - -* **Dependency Update**: Bump minimum Go version to 1.23. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.45.3 (2025-09-26) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.45.2 (2025-09-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.45.1 (2025-09-10) - -* No change notes available for this release. - -# v1.45.0 (2025-09-09) - -* **Feature**: Documentation updates for AWS Organizations APIs. - -# v1.44.3 (2025-09-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.44.2 (2025-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.44.1 (2025-08-27) - -* **Dependency Update**: Update to smithy-go v1.23.0. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.44.0 (2025-08-22) - -* **Feature**: Remove incorrect endpoint tests - -# v1.43.2 (2025-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.43.1 (2025-08-20) - -* **Bug Fix**: Remove unused deserialization code. - -# v1.43.0 (2025-08-12) - -* **Feature**: This release introduces 2 new APIs in Organizations: 1. ListAccountsWithInvalidEffectivePolicy 2. ListEffectivePolicyValidationErrors - -# v1.42.0 (2025-08-11) - -* **Feature**: Add support for configuring per-service Options via callback on global config. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.41.0 (2025-08-04) - -* **Feature**: Support configurable auth scheme preferences in service clients via AWS_AUTH_SCHEME_PREFERENCE in the environment, auth_scheme_preference in the config file, and through in-code settings on LoadDefaultConfig and client constructor methods. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.40.1 (2025-07-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.40.0 (2025-07-28) - -* **Feature**: Add support for HTTP interceptors. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.39.1 (2025-07-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.39.0 (2025-06-17) - -* **Feature**: Add support for policy operations on the SECURITYHUB_POLICY policy type. -* **Dependency Update**: Update to smithy-go v1.22.4. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.38.4 (2025-06-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.38.3 (2025-04-10) - -* No change notes available for this release. - -# v1.38.2 (2025-04-03) - -* No change notes available for this release. - -# v1.38.1 (2025-03-04.2) - -* **Bug Fix**: Add assurance test for operation order. - -# v1.38.0 (2025-02-27) - -* **Feature**: Track credential providers via User-Agent Feature ids -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.37.9 (2025-02-18) - -* **Bug Fix**: Bump go version to 1.22 -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.37.8 (2025-02-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.37.7 (2025-02-04) - -* No change notes available for this release. - -# v1.37.6 (2025-01-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.37.5 (2025-01-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.37.4 (2025-01-24) - -* **Dependency Update**: Updated to the latest SDK module versions -* **Dependency Update**: Upgrade to smithy-go v1.22.2. - -# v1.37.3 (2025-01-17) - -* **Bug Fix**: Fix bug where credentials weren't refreshed during retry loop. - -# v1.37.2 (2025-01-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.37.1 (2025-01-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.37.0 (2025-01-02) - -* **Feature**: Added ALL_FEATURES_MIGRATION_ORGANIZATION_SIZE_LIMIT_EXCEEDED to ConstraintViolationException for the EnableAllFeatures operation. - -# v1.36.2 (2024-12-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.36.1 (2024-12-12) - -* No change notes available for this release. - -# v1.36.0 (2024-12-02) - -* **Feature**: Add support for policy operations on the DECLARATIVE_POLICY_EC2 policy type. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.35.1 (2024-11-18) - -* **Dependency Update**: Update to smithy-go v1.22.1. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.35.0 (2024-11-13) - -* **Feature**: Add support for policy operations on the Resource Control Polices. - -# v1.34.5 (2024-11-07) - -* **Bug Fix**: Adds case-insensitive handling of error message fields in service responses - -# v1.34.4 (2024-11-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.34.3 (2024-10-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.34.2 (2024-10-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.34.1 (2024-10-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.34.0 (2024-10-04) - -* **Feature**: Add support for HTTP client metrics. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.33.2 (2024-10-03) - -* No change notes available for this release. - -# v1.33.1 (2024-09-27) - -* No change notes available for this release. - -# v1.33.0 (2024-09-26) - -* **Feature**: Add support for policy operations on the CHATBOT_POLICY policy type. - -# v1.32.2 (2024-09-25) - -* No change notes available for this release. - -# v1.32.1 (2024-09-23) - -* No change notes available for this release. - -# v1.32.0 (2024-09-20) - -* **Feature**: Add tracing and metrics support to service clients. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.31.4 (2024-09-17) - -* **Bug Fix**: **BREAKFIX**: Only generate AccountIDEndpointMode config for services that use it. This is a compiler break, but removes no actual functionality, as no services currently use the account ID in endpoint resolution. - -# v1.31.3 (2024-09-16) - -* **Documentation**: Doc only update for AWS Organizations that fixes several customer-reported issues - -# v1.31.2 (2024-09-04) - -* No change notes available for this release. - -# v1.31.1 (2024-09-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.31.0 (2024-08-23) - -* **Feature**: Releasing minor partitional endpoint updates. - -# v1.30.3 (2024-08-15) - -* **Dependency Update**: Bump minimum Go version to 1.21. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.30.2 (2024-07-10.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.30.1 (2024-07-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.30.0 (2024-07-03) - -* **Feature**: Added a new reason under ConstraintViolationException in RegisterDelegatedAdministrator API to prevent registering suspended accounts as delegated administrator of a service. - -# v1.29.1 (2024-06-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.29.0 (2024-06-26) - -* **Feature**: Support list-of-string endpoint parameter. - -# v1.28.1 (2024-06-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.28.0 (2024-06-18) - -* **Feature**: Track usage of various AWS SDK features in user-agent string. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.10 (2024-06-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.9 (2024-06-07) - -* **Bug Fix**: Add clock skew correction on all service clients -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.8 (2024-06-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.7 (2024-05-23) - -* No change notes available for this release. - -# v1.27.6 (2024-05-16) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.5 (2024-05-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.4 (2024-05-08) - -* **Bug Fix**: GoDoc improvement - -# v1.27.3 (2024-03-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.2 (2024-03-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.1 (2024-03-07) - -* **Bug Fix**: Remove dependency on go-cmp. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.27.0 (2024-03-05) - -* **Feature**: This release contains an endpoint addition - -# v1.26.0 (2024-03-04) - -* **Feature**: Documentation update for AWS Organizations - -# v1.25.1 (2024-02-23) - -* **Bug Fix**: Move all common, SDK-side middleware stack ops into the service client module to prevent cross-module compatibility issues in the future. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.25.0 (2024-02-22) - -* **Feature**: Add middleware stack snapshot tests. - -# v1.24.3 (2024-02-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.24.2 (2024-02-20) - -* **Bug Fix**: When sourcing values for a service's `EndpointParameters`, the lack of a configured region (i.e. `options.Region == ""`) will now translate to a `nil` value for `EndpointParameters.Region` instead of a pointer to the empty string `""`. This will result in a much more explicit error when calling an operation instead of an obscure hostname lookup failure. - -# v1.24.1 (2024-02-15) - -* **Bug Fix**: Correct failure to determine the error type in awsJson services that could occur when errors were modeled with a non-string `code` field. - -# v1.24.0 (2024-02-13) - -* **Feature**: Bump minimum Go version to 1.20 per our language support policy. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.7 (2024-01-22) - -* **Documentation**: Doc only update for quota increase change - -# v1.23.6 (2024-01-04) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.5 (2023-12-08) - -* **Bug Fix**: Reinstate presence of default Retryer in functional options, but still respect max attempts set therein. - -# v1.23.4 (2023-12-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.3 (2023-12-06) - -* **Bug Fix**: Restore pre-refactor auth behavior where all operations could technically be performed anonymously. - -# v1.23.2 (2023-12-01) - -* **Bug Fix**: Correct wrapping of errors in authentication workflow. -* **Bug Fix**: Correctly recognize cache-wrapped instances of AnonymousCredentials at client construction. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.1 (2023-11-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.23.0 (2023-11-29) - -* **Feature**: Expose Options() accessor on service clients. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.5 (2023-11-28.2) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.4 (2023-11-28) - -* **Bug Fix**: Respect setting RetryMaxAttempts in functional options at client construction. - -# v1.22.3 (2023-11-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.2 (2023-11-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.1 (2023-11-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.22.0 (2023-11-01) - -* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.21.0 (2023-10-31) - -* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.8 (2023-10-12) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.7 (2023-10-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.6 (2023-08-28) - -* **Documentation**: Documentation updates for permissions and links. - -# v1.20.5 (2023-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.4 (2023-08-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.3 (2023-08-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.2 (2023-08-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.20.1 (2023-08-01) - -* No change notes available for this release. - -# v1.20.0 (2023-07-31) - -* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.10 (2023-07-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.9 (2023-07-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.8 (2023-06-15) - -* No change notes available for this release. - -# v1.19.7 (2023-06-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.6 (2023-05-04) - -* No change notes available for this release. - -# v1.19.5 (2023-04-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.4 (2023-04-10) - -* No change notes available for this release. - -# v1.19.3 (2023-04-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.2 (2023-03-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.1 (2023-03-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.0 (2023-03-02) - -* **Feature**: This release introduces a new reason code, ACCOUNT_CREATION_NOT_COMPLETE, to ConstraintViolationException in CreateOrganization API. - -# v1.18.4 (2023-02-22) - -* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. - -# v1.18.3 (2023-02-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.2 (2023-02-15) - -* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910. -* **Bug Fix**: Correct error type parsing for restJson services. - -# v1.18.1 (2023-02-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.0 (2023-01-05) - -* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). - -# v1.17.2 (2022-12-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.1 (2022-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.0 (2022-11-28) - -* **Feature**: This release introduces delegated administrator for AWS Organizations, a new feature to help you delegate the management of your Organizations policies, enabling you to govern your AWS organization in a decentralized way. You can now allow member accounts to manage Organizations policies. - -# v1.16.15 (2022-10-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.14 (2022-10-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.13 (2022-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.12 (2022-09-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.11 (2022-09-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.10 (2022-08-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.9 (2022-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.8 (2022-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.7 (2022-08-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.6 (2022-08-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.5 (2022-08-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.4 (2022-07-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.3 (2022-06-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.2 (2022-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.1 (2022-05-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.0 (2022-05-02) - -* **Feature**: This release adds the INVALID_PAYMENT_INSTRUMENT as a fail reason and an error message. - -# v1.15.2 (2022-04-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.1 (2022-03-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.0 (2022-03-29) - -* **Feature**: This release provides the new CloseAccount API that enables principals in the management account to close any member account within an organization. - -# v1.14.2 (2022-03-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.1 (2022-03-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.0 (2022-03-08) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.0 (2022-02-24) - -* **Feature**: API client updated -* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.0 (2022-01-14) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.0 (2022-01-07) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.0 (2021-12-21) - -* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens. - -# v1.9.2 (2021-12-02) - -* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.1 (2021-11-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.0 (2021-11-12) - -* **Feature**: Service clients now support custom endpoints that have an initial URI path defined. - -# v1.8.0 (2021-11-06) - -* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.7.0 (2021-10-21) - -* **Feature**: Updated to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.2 (2021-10-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.1 (2021-09-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.0 (2021-08-27) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.3 (2021-08-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.2 (2021-08-04) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.1 (2021-07-15) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.0 (2021-06-25) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.2 (2021-06-04) - -* No change notes available for this release. - -# v1.4.1 (2021-05-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.0 (2021-05-14) - -* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. -* **Dependency Update**: Updated to the latest SDK module versions - diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/LICENSE.txt b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/LICENSE.txt deleted file mode 100644 index d645695673..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_client.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_client.go deleted file mode 100644 index 1bf6d85ee5..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_client.go +++ /dev/null @@ -1,929 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "errors" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/aws/defaults" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/aws/retry" - "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - smithy "github.com/aws/smithy-go" - smithydocument "github.com/aws/smithy-go/document" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net" - "net/http" - "sync/atomic" - "time" -) - -const ServiceID = "Organizations" -const ServiceAPIVersion = "2016-11-28" - -type operationMetrics struct { - Duration metrics.Float64Histogram - SerializeDuration metrics.Float64Histogram - ResolveIdentityDuration metrics.Float64Histogram - ResolveEndpointDuration metrics.Float64Histogram - SignRequestDuration metrics.Float64Histogram - DeserializeDuration metrics.Float64Histogram -} - -func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { - switch name { - case "client.call.duration": - return m.Duration - case "client.call.serialization_duration": - return m.SerializeDuration - case "client.call.resolve_identity_duration": - return m.ResolveIdentityDuration - case "client.call.resolve_endpoint_duration": - return m.ResolveEndpointDuration - case "client.call.signing_duration": - return m.SignRequestDuration - case "client.call.deserialization_duration": - return m.DeserializeDuration - default: - panic("unrecognized operation metric") - } -} - -func timeOperationMetric[T any]( - ctx context.Context, metric string, fn func() (T, error), - opts ...metrics.RecordMetricOption, -) (T, error) { - mm := getOperationMetrics(ctx) - if mm == nil { // not using the metrics system - return fn() - } - - instr := mm.histogramFor(metric) - opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) - - start := time.Now() - v, err := fn() - end := time.Now() - - elapsed := end.Sub(start) - instr.Record(ctx, float64(elapsed)/1e9, opts...) - return v, err -} - -func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { - mm := getOperationMetrics(ctx) - if mm == nil { // not using the metrics system - return func() {} - } - - instr := mm.histogramFor(metric) - opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) - - var ended bool - start := time.Now() - return func() { - if ended { - return - } - ended = true - - end := time.Now() - - elapsed := end.Sub(start) - instr.Record(ctx, float64(elapsed)/1e9, opts...) - } -} - -func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { - return func(o *metrics.RecordMetricOptions) { - o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) - o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) - } -} - -type operationMetricsKey struct{} - -func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { - if _, ok := mp.(metrics.NopMeterProvider); ok { - // not using the metrics system - setting up the metrics context is a memory-intensive operation - // so we should skip it in this case - return parent, nil - } - - meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/organizations") - om := &operationMetrics{} - - var err error - - om.Duration, err = operationMetricTimer(meter, "client.call.duration", - "Overall call duration (including retries and time to send or receive request and response body)") - if err != nil { - return nil, err - } - om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", - "The time it takes to serialize a message body") - if err != nil { - return nil, err - } - om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", - "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") - if err != nil { - return nil, err - } - om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", - "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") - if err != nil { - return nil, err - } - om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", - "The time it takes to sign a request") - if err != nil { - return nil, err - } - om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", - "The time it takes to deserialize a message body") - if err != nil { - return nil, err - } - - return context.WithValue(parent, operationMetricsKey{}, om), nil -} - -func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { - return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { - o.UnitLabel = "s" - o.Description = desc - }) -} - -func getOperationMetrics(ctx context.Context) *operationMetrics { - if v := ctx.Value(operationMetricsKey{}); v != nil { - return v.(*operationMetrics) - } - return nil -} - -func operationTracer(p tracing.TracerProvider) tracing.Tracer { - return p.Tracer("github.com/aws/aws-sdk-go-v2/service/organizations") -} - -// Client provides the API client to make operations call for AWS Organizations. -type Client struct { - options Options - - // Difference between the time reported by the server and the client - timeOffset *atomic.Int64 -} - -// New returns an initialized Client based on the functional options. Provide -// additional functional options to further configure the behavior of the client, -// such as changing the client's endpoint or adding custom middleware behavior. -func New(options Options, optFns ...func(*Options)) *Client { - options = options.Copy() - - resolveDefaultLogger(&options) - - setResolvedDefaultsMode(&options) - - resolveRetryer(&options) - - resolveHTTPClient(&options) - - resolveHTTPSignerV4(&options) - - resolveEndpointResolverV2(&options) - - resolveTracerProvider(&options) - - resolveMeterProvider(&options) - - resolveAuthSchemeResolver(&options) - - for _, fn := range optFns { - fn(&options) - } - - finalizeRetryMaxAttempts(&options) - - ignoreAnonymousAuth(&options) - - wrapWithAnonymousAuth(&options) - - resolveAuthSchemes(&options) - - client := &Client{ - options: options, - } - - initializeTimeOffsetResolver(client) - - return client -} - -// Options returns a copy of the client configuration. -// -// Callers SHOULD NOT perform mutations on any inner structures within client -// config. Config overrides should instead be made on a per-operation basis through -// functional options. -func (c *Client) Options() Options { - return c.options.Copy() -} - -func (c *Client) invokeOperation( - ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, -) ( - result interface{}, metadata middleware.Metadata, err error, -) { - ctx = middleware.ClearStackValues(ctx) - ctx = middleware.WithServiceID(ctx, ServiceID) - ctx = middleware.WithOperationName(ctx, opID) - - stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) - options := c.options.Copy() - - for _, fn := range optFns { - fn(&options) - } - - finalizeOperationRetryMaxAttempts(&options, *c) - - finalizeClientEndpointResolverOptions(&options) - - for _, fn := range stackFns { - if err := fn(stack, options); err != nil { - return nil, metadata, err - } - } - - for _, fn := range options.APIOptions { - if err := fn(stack); err != nil { - return nil, metadata, err - } - } - - ctx, err = withOperationMetrics(ctx, options.MeterProvider) - if err != nil { - return nil, metadata, err - } - - tracer := operationTracer(options.TracerProvider) - spanName := fmt.Sprintf("%s.%s", ServiceID, opID) - - ctx = tracing.WithOperationTracer(ctx, tracer) - - ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { - o.Kind = tracing.SpanKindClient - o.Properties.Set("rpc.system", "aws-api") - o.Properties.Set("rpc.method", opID) - o.Properties.Set("rpc.service", ServiceID) - }) - endTimer := startMetricTimer(ctx, "client.call.duration") - defer endTimer() - defer span.End() - - handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { - o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/organizations") - }) - decorated := middleware.DecorateHandler(handler, stack) - result, metadata, err = decorated.Handle(ctx, params) - if err != nil { - span.SetProperty("exception.type", fmt.Sprintf("%T", err)) - span.SetProperty("exception.message", err.Error()) - - var aerr smithy.APIError - if errors.As(err, &aerr) { - span.SetProperty("api.error_code", aerr.ErrorCode()) - span.SetProperty("api.error_message", aerr.ErrorMessage()) - span.SetProperty("api.error_fault", aerr.ErrorFault().String()) - } - - err = &smithy.OperationError{ - ServiceID: ServiceID, - OperationName: opID, - Err: err, - } - } - - span.SetProperty("error", err != nil) - if err == nil { - span.SetStatus(tracing.SpanStatusOK) - } else { - span.SetStatus(tracing.SpanStatusError) - } - - return result, metadata, err -} - -type operationInputKey struct{} - -func setOperationInput(ctx context.Context, input interface{}) context.Context { - return middleware.WithStackValue(ctx, operationInputKey{}, input) -} - -func getOperationInput(ctx context.Context) interface{} { - return middleware.GetStackValue(ctx, operationInputKey{}) -} - -type setOperationInputMiddleware struct { -} - -func (*setOperationInputMiddleware) ID() string { - return "setOperationInput" -} - -func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - ctx = setOperationInput(ctx, in.Parameters) - return next.HandleSerialize(ctx, in) -} - -func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { - if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { - return fmt.Errorf("add ResolveAuthScheme: %w", err) - } - if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { - return fmt.Errorf("add GetIdentity: %v", err) - } - if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { - return fmt.Errorf("add ResolveEndpointV2: %v", err) - } - if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { - return fmt.Errorf("add Signing: %w", err) - } - return nil -} -func resolveAuthSchemeResolver(options *Options) { - if options.AuthSchemeResolver == nil { - options.AuthSchemeResolver = &defaultAuthSchemeResolver{} - } -} - -func resolveAuthSchemes(options *Options) { - if options.AuthSchemes == nil { - options.AuthSchemes = []smithyhttp.AuthScheme{ - internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ - Signer: options.HTTPSignerV4, - Logger: options.Logger, - LogSigning: options.ClientLogMode.IsSigning(), - }), - } - } -} - -type noSmithyDocumentSerde = smithydocument.NoSerde - -type legacyEndpointContextSetter struct { - LegacyResolver EndpointResolver -} - -func (*legacyEndpointContextSetter) ID() string { - return "legacyEndpointContextSetter" -} - -func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.LegacyResolver != nil { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) - } - - return next.HandleInitialize(ctx, in) - -} -func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { - return stack.Initialize.Add(&legacyEndpointContextSetter{ - LegacyResolver: o.EndpointResolver, - }, middleware.Before) -} - -func resolveDefaultLogger(o *Options) { - if o.Logger != nil { - return - } - o.Logger = logging.Nop{} -} - -func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { - return middleware.AddSetLoggerMiddleware(stack, o.Logger) -} - -func setResolvedDefaultsMode(o *Options) { - if len(o.resolvedDefaultsMode) > 0 { - return - } - - var mode aws.DefaultsMode - mode.SetFromString(string(o.DefaultsMode)) - - if mode == aws.DefaultsModeAuto { - mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) - } - - o.resolvedDefaultsMode = mode -} - -// NewFromConfig returns a new client from the provided config. -func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { - opts := Options{ - Region: cfg.Region, - DefaultsMode: cfg.DefaultsMode, - RuntimeEnvironment: cfg.RuntimeEnvironment, - HTTPClient: cfg.HTTPClient, - Credentials: cfg.Credentials, - APIOptions: cfg.APIOptions, - Logger: cfg.Logger, - ClientLogMode: cfg.ClientLogMode, - AppID: cfg.AppID, - AuthSchemePreference: cfg.AuthSchemePreference, - } - resolveAWSRetryerProvider(cfg, &opts) - resolveAWSRetryMaxAttempts(cfg, &opts) - resolveAWSRetryMode(cfg, &opts) - resolveAWSEndpointResolver(cfg, &opts) - resolveInterceptors(cfg, &opts) - resolveUseDualStackEndpoint(cfg, &opts) - resolveUseFIPSEndpoint(cfg, &opts) - resolveBaseEndpoint(cfg, &opts) - return New(opts, func(o *Options) { - for _, opt := range cfg.ServiceOptions { - opt(ServiceID, o) - } - for _, opt := range optFns { - opt(o) - } - }) -} - -func resolveHTTPClient(o *Options) { - var buildable *awshttp.BuildableClient - - if o.HTTPClient != nil { - var ok bool - buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) - if !ok { - return - } - } else { - buildable = awshttp.NewBuildableClient() - } - - modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) - if err == nil { - buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { - if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { - dialer.Timeout = dialerTimeout - } - }) - - buildable = buildable.WithTransportOptions(func(transport *http.Transport) { - if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { - transport.TLSHandshakeTimeout = tlsHandshakeTimeout - } - }) - } - - o.HTTPClient = buildable -} - -func resolveRetryer(o *Options) { - if o.Retryer != nil { - return - } - - if len(o.RetryMode) == 0 { - modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) - if err == nil { - o.RetryMode = modeConfig.RetryMode - } - } - if len(o.RetryMode) == 0 { - o.RetryMode = aws.RetryModeStandard - } - - var standardOptions []func(*retry.StandardOptions) - if v := o.RetryMaxAttempts; v != 0 { - standardOptions = append(standardOptions, func(so *retry.StandardOptions) { - so.MaxAttempts = v - }) - } - - switch o.RetryMode { - case aws.RetryModeAdaptive: - var adaptiveOptions []func(*retry.AdaptiveModeOptions) - if len(standardOptions) != 0 { - adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { - ao.StandardOptions = append(ao.StandardOptions, standardOptions...) - }) - } - o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) - - default: - o.Retryer = retry.NewStandard(standardOptions...) - } -} - -func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { - if cfg.Retryer == nil { - return - } - o.Retryer = cfg.Retryer() -} - -func resolveAWSRetryMode(cfg aws.Config, o *Options) { - if len(cfg.RetryMode) == 0 { - return - } - o.RetryMode = cfg.RetryMode -} -func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { - if cfg.RetryMaxAttempts == 0 { - return - } - o.RetryMaxAttempts = cfg.RetryMaxAttempts -} - -func finalizeRetryMaxAttempts(o *Options) { - if o.RetryMaxAttempts == 0 { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func finalizeOperationRetryMaxAttempts(o *Options, client Client) { - if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { - if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { - return - } - o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) -} - -func resolveInterceptors(cfg aws.Config, o *Options) { - o.Interceptors = cfg.Interceptors.Copy() -} - -func addClientUserAgent(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "organizations", goModuleVersion) - if len(options.AppID) > 0 { - ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) - } - - return nil -} - -func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { - id := (*awsmiddleware.RequestUserAgent)(nil).ID() - mw, ok := stack.Build.Get(id) - if !ok { - mw = awsmiddleware.NewRequestUserAgent() - if err := stack.Build.Add(mw, middleware.After); err != nil { - return nil, err - } - } - - ua, ok := mw.(*awsmiddleware.RequestUserAgent) - if !ok { - return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) - } - - return ua, nil -} - -type HTTPSignerV4 interface { - SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error -} - -func resolveHTTPSignerV4(o *Options) { - if o.HTTPSignerV4 != nil { - return - } - o.HTTPSignerV4 = newDefaultV4Signer(*o) -} - -func newDefaultV4Signer(o Options) *v4.Signer { - return v4.NewSigner(func(so *v4.SignerOptions) { - so.Logger = o.Logger - so.LogSigning = o.ClientLogMode.IsSigning() - }) -} - -func addClientRequestID(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) -} - -func addComputeContentLength(stack *middleware.Stack) error { - return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) -} - -func addRawResponseToMetadata(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) -} - -func addRecordResponseTiming(stack *middleware.Stack) error { - return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) -} - -func addSpanRetryLoop(stack *middleware.Stack, options Options) error { - return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) -} - -type spanRetryLoop struct { - options Options -} - -func (*spanRetryLoop) ID() string { - return "spanRetryLoop" -} - -func (m *spanRetryLoop) HandleFinalize( - ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, -) ( - middleware.FinalizeOutput, middleware.Metadata, error, -) { - tracer := operationTracer(m.options.TracerProvider) - ctx, span := tracer.StartSpan(ctx, "RetryLoop") - defer span.End() - - return next.HandleFinalize(ctx, in) -} -func addStreamingEventsPayload(stack *middleware.Stack) error { - return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) -} - -func addUnsignedPayload(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) -} - -func addComputePayloadSHA256(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) -} - -func addContentSHA256Header(stack *middleware.Stack) error { - return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) -} - -func addIsWaiterUserAgent(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) - return nil - }) -} - -func addIsPaginatorUserAgent(o *Options) { - o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) - return nil - }) -} - -func addRetry(stack *middleware.Stack, o Options, c *Client) error { - attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { - m.LogAttempts = o.ClientLogMode.IsRetries() - m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/organizations") - m.ClientSkew = c.timeOffset - }) - if err := stack.Finalize.Insert(attempt, "ResolveAuthScheme", middleware.Before); err != nil { - return err - } - if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { - return err - } - return nil -} - -// resolves dual-stack endpoint configuration -func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { - if len(cfg.ConfigSources) == 0 { - return nil - } - value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) - if err != nil { - return err - } - if found { - o.EndpointOptions.UseDualStackEndpoint = value - } - return nil -} - -// resolves FIPS endpoint configuration -func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { - if len(cfg.ConfigSources) == 0 { - return nil - } - value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) - if err != nil { - return err - } - if found { - o.EndpointOptions.UseFIPSEndpoint = value - } - return nil -} - -func initializeTimeOffsetResolver(c *Client) { - c.timeOffset = new(atomic.Int64) -} - -func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - switch options.Retryer.(type) { - case *retry.Standard: - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) - case *retry.AdaptiveMode: - ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) - } - return nil -} - -type setCredentialSourceMiddleware struct { - ua *awsmiddleware.RequestUserAgent - options Options -} - -func (m setCredentialSourceMiddleware) ID() string { return "SetCredentialSourceMiddleware" } - -func (m setCredentialSourceMiddleware) HandleBuild(ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler) ( - out middleware.BuildOutput, metadata middleware.Metadata, err error, -) { - asProviderSource, ok := m.options.Credentials.(aws.CredentialProviderSource) - if !ok { - return next.HandleBuild(ctx, in) - } - providerSources := asProviderSource.ProviderSources() - for _, source := range providerSources { - m.ua.AddCredentialsSource(source) - } - return next.HandleBuild(ctx, in) -} - -func addCredentialSource(stack *middleware.Stack, options Options) error { - ua, err := getOrAddRequestUserAgent(stack) - if err != nil { - return err - } - - mw := setCredentialSourceMiddleware{ua: ua, options: options} - return stack.Build.Insert(&mw, "UserAgent", middleware.Before) -} - -func resolveTracerProvider(options *Options) { - if options.TracerProvider == nil { - options.TracerProvider = &tracing.NopTracerProvider{} - } -} - -func resolveMeterProvider(options *Options) { - if options.MeterProvider == nil { - options.MeterProvider = metrics.NopMeterProvider{} - } -} - -func addRecursionDetection(stack *middleware.Stack) error { - return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) -} - -func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) - -} - -func addResponseErrorMiddleware(stack *middleware.Stack) error { - return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) - -} - -func addRequestResponseLogging(stack *middleware.Stack, o Options) error { - return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ - LogRequest: o.ClientLogMode.IsRequest(), - LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), - LogResponse: o.ClientLogMode.IsResponse(), - LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), - }, middleware.After) -} - -type disableHTTPSMiddleware struct { - DisableHTTPS bool -} - -func (*disableHTTPSMiddleware) ID() string { - return "disableHTTPS" -} - -func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { - req.URL.Scheme = "http" - } - - return next.HandleFinalize(ctx, in) -} - -func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { - return stack.Finalize.Insert(&disableHTTPSMiddleware{ - DisableHTTPS: o.EndpointOptions.DisableHTTPS, - }, "ResolveEndpointV2", middleware.After) -} - -func addInterceptBeforeRetryLoop(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptBeforeRetryLoop{ - Interceptors: opts.Interceptors.BeforeRetryLoop, - }, "Retry", middleware.Before) -} - -func addInterceptAttempt(stack *middleware.Stack, opts Options) error { - return stack.Finalize.Insert(&smithyhttp.InterceptAttempt{ - BeforeAttempt: opts.Interceptors.BeforeAttempt, - AfterAttempt: opts.Interceptors.AfterAttempt, - }, "Retry", middleware.After) -} - -func addInterceptors(stack *middleware.Stack, opts Options) error { - // middlewares are expensive, don't add all of these interceptor ones unless the caller - // actually has at least one interceptor configured - // - // at the moment it's all-or-nothing because some of the middlewares here are responsible for - // setting fields in the interceptor context for future ones - if len(opts.Interceptors.BeforeExecution) == 0 && - len(opts.Interceptors.BeforeSerialization) == 0 && len(opts.Interceptors.AfterSerialization) == 0 && - len(opts.Interceptors.BeforeRetryLoop) == 0 && - len(opts.Interceptors.BeforeAttempt) == 0 && - len(opts.Interceptors.BeforeSigning) == 0 && len(opts.Interceptors.AfterSigning) == 0 && - len(opts.Interceptors.BeforeTransmit) == 0 && len(opts.Interceptors.AfterTransmit) == 0 && - len(opts.Interceptors.BeforeDeserialization) == 0 && len(opts.Interceptors.AfterDeserialization) == 0 && - len(opts.Interceptors.AfterAttempt) == 0 && len(opts.Interceptors.AfterExecution) == 0 { - return nil - } - - return errors.Join( - stack.Initialize.Add(&smithyhttp.InterceptExecution{ - BeforeExecution: opts.Interceptors.BeforeExecution, - AfterExecution: opts.Interceptors.AfterExecution, - }, middleware.Before), - stack.Serialize.Insert(&smithyhttp.InterceptBeforeSerialization{ - Interceptors: opts.Interceptors.BeforeSerialization, - }, "OperationSerializer", middleware.Before), - stack.Serialize.Insert(&smithyhttp.InterceptAfterSerialization{ - Interceptors: opts.Interceptors.AfterSerialization, - }, "OperationSerializer", middleware.After), - stack.Finalize.Insert(&smithyhttp.InterceptBeforeSigning{ - Interceptors: opts.Interceptors.BeforeSigning, - }, "Signing", middleware.Before), - stack.Finalize.Insert(&smithyhttp.InterceptAfterSigning{ - Interceptors: opts.Interceptors.AfterSigning, - }, "Signing", middleware.After), - stack.Deserialize.Add(&smithyhttp.InterceptTransmit{ - BeforeTransmit: opts.Interceptors.BeforeTransmit, - AfterTransmit: opts.Interceptors.AfterTransmit, - }, middleware.After), - stack.Deserialize.Insert(&smithyhttp.InterceptBeforeDeserialization{ - Interceptors: opts.Interceptors.BeforeDeserialization, - }, "OperationDeserializer", middleware.After), // (deserialize stack is called in reverse) - stack.Deserialize.Insert(&smithyhttp.InterceptAfterDeserialization{ - Interceptors: opts.Interceptors.AfterDeserialization, - }, "OperationDeserializer", middleware.Before), - ) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_AcceptHandshake.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_AcceptHandshake.go deleted file mode 100644 index a6dbe4671c..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_AcceptHandshake.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Accepts a handshake by sending an ACCEPTED response to the sender. You can view -// accepted handshakes in API responses for 30 days before they are deleted. -// -// Only the management account can accept the following handshakes: -// -// - Enable all features final confirmation ( APPROVE_ALL_FEATURES ) -// -// - Billing transfer ( TRANSFER_RESPONSIBILITY ) -// -// For more information, see [Enabling all features] and [Responding to a billing transfer invitation] in the Organizations User Guide. -// -// Only a member account can accept the following handshakes: -// -// - Invitation to join ( INVITE ) -// -// - Approve all features request ( ENABLE_ALL_FEATURES ) -// -// For more information, see [Responding to invitations] and [Enabling all features] in the Organizations User Guide. -// -// [Enabling all features]: https://docs.aws.amazon.com/organizations/latest/userguide/manage-begin-all-features-standard-migration.html#manage-approve-all-features-invite -// [Responding to invitations]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_accept-decline-invite.html -// [Responding to a billing transfer invitation]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_transfer_billing-respond-invitation.html -func (c *Client) AcceptHandshake(ctx context.Context, params *AcceptHandshakeInput, optFns ...func(*Options)) (*AcceptHandshakeOutput, error) { - if params == nil { - params = &AcceptHandshakeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AcceptHandshake", params, optFns, c.addOperationAcceptHandshakeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AcceptHandshakeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AcceptHandshakeInput struct { - - // ID for the handshake that you want to accept. - // - // The [regex pattern] for handshake ID string requires "h-" followed by from 8 to 32 lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - HandshakeId *string - - noSmithyDocumentSerde -} - -type AcceptHandshakeOutput struct { - - // A Handshake object. Contains details for the handshake. - Handshake *types.Handshake - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAcceptHandshakeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpAcceptHandshake{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAcceptHandshake{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AcceptHandshake"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAcceptHandshakeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAcceptHandshake(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAcceptHandshake(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AcceptHandshake", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_AttachPolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_AttachPolicy.go deleted file mode 100644 index 3cae16f6af..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_AttachPolicy.go +++ /dev/null @@ -1,220 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Attaches a policy to a root, an organizational unit (OU), or an individual -// account. How the policy affects accounts depends on the type of policy. Refer to -// the Organizations User Guide for information about each policy type: -// -// [SERVICE_CONTROL_POLICY] -// -// [RESOURCE_CONTROL_POLICY] -// -// [DECLARATIVE_POLICY_EC2] -// -// [BACKUP_POLICY] -// -// [TAG_POLICY] -// -// [CHATBOT_POLICY] -// -// [AISERVICES_OPT_OUT_POLICY] -// -// [SECURITYHUB_POLICY] -// -// [UPGRADE_ROLLOUT_POLICY] -// -// [INSPECTOR_POLICY] -// -// [BEDROCK_POLICY] -// -// [S3_POLICY] -// -// [NETWORK_SECURITY_DIRECTOR_POLICY] -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -// -// [BEDROCK_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_bedrock.html -// [NETWORK_SECURITY_DIRECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_network_security_director.html -// [UPGRADE_ROLLOUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_upgrade_rollout.html -// [BACKUP_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html -// [CHATBOT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_chatbot.html -// [TAG_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html -// [INSPECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_inspector.html -// [S3_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_s3.html -// [RESOURCE_CONTROL_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_rcps.html -// [AISERVICES_OPT_OUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html -// [SECURITYHUB_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_security_hub.html -// [SERVICE_CONTROL_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html -// [DECLARATIVE_POLICY_EC2]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_declarative.html -func (c *Client) AttachPolicy(ctx context.Context, params *AttachPolicyInput, optFns ...func(*Options)) (*AttachPolicyOutput, error) { - if params == nil { - params = &AttachPolicyInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AttachPolicy", params, optFns, c.addOperationAttachPolicyMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AttachPolicyOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AttachPolicyInput struct { - - // ID for the policy that you want to attach to the target. You can get the ID for - // the policy by calling the ListPoliciesoperation. - // - // The [regex pattern] for a policy ID string requires "p-" followed by from 8 to 128 lowercase - // or uppercase letters, digits, or the underscore character (_). - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - PolicyId *string - - // ID for the root, OU, or account that you want to attach the policy to. You can - // get the ID by calling the ListRoots, ListOrganizationalUnitsForParent, or ListAccounts operations. - // - // The [regex pattern] for a target ID string requires one of the following: - // - // - Root - A string that begins with "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // - Account - A string that consists of exactly 12 digits. - // - // - Organizational unit (OU) - A string that begins with "ou-" followed by from - // 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This - // string is followed by a second "-" dash and from 8 to 32 additional lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - TargetId *string - - noSmithyDocumentSerde -} - -type AttachPolicyOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAttachPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpAttachPolicy{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAttachPolicy{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AttachPolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpAttachPolicyValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAttachPolicy(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAttachPolicy(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AttachPolicy", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CancelHandshake.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CancelHandshake.go deleted file mode 100644 index 980a1c0338..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CancelHandshake.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Cancels a Handshake. -// -// Only the account that sent a handshake can call this operation. The recipient -// of the handshake can't cancel it, but can use DeclineHandshaketo decline. After a handshake is -// canceled, the recipient can no longer respond to the handshake. -// -// You can view canceled handshakes in API responses for 30 days before they are -// deleted. -func (c *Client) CancelHandshake(ctx context.Context, params *CancelHandshakeInput, optFns ...func(*Options)) (*CancelHandshakeOutput, error) { - if params == nil { - params = &CancelHandshakeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CancelHandshake", params, optFns, c.addOperationCancelHandshakeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CancelHandshakeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CancelHandshakeInput struct { - - // ID for the handshake that you want to cancel. You can get the ID from the ListHandshakesForOrganization - // operation. - // - // The [regex pattern] for handshake ID string requires "h-" followed by from 8 to 32 lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - HandshakeId *string - - noSmithyDocumentSerde -} - -type CancelHandshakeOutput struct { - - // A Handshake object. Contains for the handshake that you canceled. - Handshake *types.Handshake - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCancelHandshakeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpCancelHandshake{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCancelHandshake{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CancelHandshake"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCancelHandshakeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelHandshake(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCancelHandshake(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CancelHandshake", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CloseAccount.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CloseAccount.go deleted file mode 100644 index d77dade8dd..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CloseAccount.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Closes an Amazon Web Services member account within an organization. You can -// close an account when [all features are enabled]. You can't close the management account with this API. -// This is an asynchronous request that Amazon Web Services performs in the -// background. Because CloseAccount operates asynchronously, it can return a -// successful completion message even though account closure might still be in -// progress. You need to wait a few minutes before the account is fully closed. To -// check the status of the request, do one of the following: -// -// - Use the AccountId that you sent in the CloseAccount request to provide as a -// parameter to the DescribeAccountoperation. -// -// While the close account request is in progress, Account status will indicate -// -// PENDING_CLOSURE. When the close account request completes, the status will -// change to SUSPENDED. -// -// - Check the CloudTrail log for the CloseAccountResult event that gets -// published after the account closes successfully. For information on using -// CloudTrail with Organizations, see [Logging and monitoring in Organizations]in the Organizations User Guide. -// -// - Resources remaining within the account after closing will be automatically -// deleted after 90 days. During this 90-day period, the resources won't be -// available unless you contact Amazon Web Services Support to reopen the account. -// After 90 days, you can't reopen an account. You might still receive a [bill after account closure]. -// -// - You can close only 10% of member accounts, between 10 and 1000, within a -// rolling 30 day period. This quota is not bound by a calendar month, but starts -// when you close an account. After you reach this limit, you can't close -// additional accounts. For more information, see [Closing a member account in your organization]and [Quotas for Organizations]in the Organizations User -// Guide. -// -// - To reinstate a closed account, contact Amazon Web Services Support within -// the 90-day grace period while the account is in SUSPENDED status. -// -// - If the Amazon Web Services account you attempt to close is linked to an -// Amazon Web Services GovCloud (US) account, the CloseAccount request will close -// both accounts. To learn important pre-closure details, see [Closing an Amazon Web Services GovCloud (US) account]in the Amazon Web -// Services GovCloud User Guide. -// -// [all features are enabled]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html -// -// [Quotas for Organizations]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html -// [Logging and monitoring in Organizations]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_security_incident-response.html#orgs_cloudtrail-integration -// [bill after account closure]: https://repost.aws/knowledge-center/closed-account-bill -// [Closing an Amazon Web Services GovCloud (US) account]: https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/Closing-govcloud-account.html -// [Closing a member account in your organization]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_close.html -func (c *Client) CloseAccount(ctx context.Context, params *CloseAccountInput, optFns ...func(*Options)) (*CloseAccountOutput, error) { - if params == nil { - params = &CloseAccountInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CloseAccount", params, optFns, c.addOperationCloseAccountMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CloseAccountOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CloseAccountInput struct { - - // Retrieves the Amazon Web Services account Id for the current CloseAccount API - // request. - // - // This member is required. - AccountId *string - - noSmithyDocumentSerde -} - -type CloseAccountOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCloseAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpCloseAccount{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCloseAccount{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CloseAccount"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCloseAccountValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCloseAccount(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCloseAccount(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CloseAccount", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CreateAccount.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CreateAccount.go deleted file mode 100644 index fa232edbc6..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CreateAccount.go +++ /dev/null @@ -1,312 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates an Amazon Web Services account that is automatically a member of the -// organization whose credentials made the request. This is an asynchronous request -// that Amazon Web Services performs in the background. Because CreateAccount -// operates asynchronously, it can return a successful completion message even -// though account initialization might still be in progress. You might need to wait -// a few minutes before you can successfully access the account. To check the -// status of the request, do one of the following: -// -// - Use the Id value of the CreateAccountStatus response element from this -// operation to provide as a parameter to the DescribeCreateAccountStatusoperation. -// -// - Check the CloudTrail log for the CreateAccountResult event. For information -// on using CloudTrail with Organizations, see [Logging and monitoring in Organizations]in the Organizations User Guide. -// -// The user who calls the API to create an account must have the -// organizations:CreateAccount permission. If you enabled all features in the -// organization, Organizations creates the required service-linked role named -// AWSServiceRoleForOrganizations . For more information, see [Organizations and service-linked roles] in the -// Organizations User Guide. -// -// If the request includes tags, then the requester must have the -// organizations:TagResource permission. -// -// Organizations preconfigures the new member account with a role (named -// OrganizationAccountAccessRole by default) that grants users in the management -// account administrator permissions in the new member account. Principals in the -// management account can assume the role. Organizations clones the company name -// and address information for the new account from the organization's management -// account. -// -// You can only call this operation from the management account. -// -// For more information about creating accounts, see [Creating a member account in your organization] in the Organizations User -// Guide. -// -// - When you create an account in an organization using the Organizations -// console, API, or CLI commands, the information required for the account to -// operate as a standalone account, such as a payment method is not automatically -// collected. If you must remove an account from your organization later, you can -// do so only after you provide the missing information. For more information, see [Considerations before removing an account from an organization] -// in the Organizations User Guide. -// -// - If you get an exception that indicates that you exceeded your account -// limits for the organization, contact [Amazon Web Services Support]. -// -// - If you get an exception that indicates that the operation failed because -// your organization is still initializing, wait one hour and then try again. If -// the error persists, contact [Amazon Web Services Support]. -// -// - It isn't recommended to use CreateAccount to create multiple temporary -// accounts, and using the CreateAccount API to close accounts is subject to a -// 30-day usage quota. For information on the requirements and process for closing -// an account, see [Closing a member account in your organization]in the Organizations User Guide. -// -// When you create a member account with this operation, you can choose whether to -// create the account with the IAM User and Role Access to Billing Information -// switch enabled. If you enable it, IAM users and roles that have appropriate -// permissions can view billing information for the account. If you disable it, -// only the account root user can access billing information. For information about -// how to disable this switch for an account, see [Granting access to your billing information and tools]. -// -// [Granting access to your billing information and tools]: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/control-access-billing.html#grantaccess -// [Amazon Web Services Support]: https://console.aws.amazon.com/support/home#/ -// [Logging and monitoring in Organizations]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_security_incident-response.html#orgs_cloudtrail-integration -// [Organizations and service-linked roles]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_integrate_services-using_slrs -// [Creating a member account in your organization]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_create.html -// [Considerations before removing an account from an organization]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_account-before-remove.html -// [Closing a member account in your organization]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_close.html -func (c *Client) CreateAccount(ctx context.Context, params *CreateAccountInput, optFns ...func(*Options)) (*CreateAccountOutput, error) { - if params == nil { - params = &CreateAccountInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateAccount", params, optFns, c.addOperationCreateAccountMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateAccountOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateAccountInput struct { - - // The friendly name of the member account. - // - // This member is required. - AccountName *string - - // The email address of the owner to assign to the new member account. This email - // address must not already be associated with another Amazon Web Services account. - // You must use a valid email address to complete account creation. - // - // The rules for a valid email address: - // - // - The address must be a minimum of 6 and a maximum of 64 characters long. - // - // - All characters must be 7-bit ASCII characters. - // - // - There must be one and only one @ symbol, which separates the local name - // from the domain name. - // - // - The local name can't contain any of the following characters: - // - // whitespace, " ' ( ) < > [ ] : ; , \ | % & - // - // - The local name can't begin with a dot (.) - // - // - The domain name can consist of only the characters [a-z],[A-Z],[0-9], - // hyphen (-), or dot (.) - // - // - The domain name can't begin or end with a hyphen (-) or dot (.) - // - // - The domain name must contain at least one dot - // - // You can't access the root user of the account or remove an account that was - // created with an invalid email address. - // - // This member is required. - Email *string - - // If set to ALLOW , the new account enables IAM users to access account billing - // information if they have the required permissions. If set to DENY , only the - // root user of the new account can access account billing information. For more - // information, see [About IAM access to the Billing and Cost Management console]in the Amazon Web Services Billing and Cost Management User - // Guide. - // - // If you don't specify this parameter, the value defaults to ALLOW , and IAM users - // and roles with the required permissions can access billing information for the - // new account. - // - // [About IAM access to the Billing and Cost Management console]: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate - IamUserAccessToBilling types.IAMUserAccessToBilling - - // The name of an IAM role that Organizations automatically preconfigures in the - // new member account. This role trusts the management account, allowing users in - // the management account to assume the role, as permitted by the management - // account administrator. The role has administrator permissions in the new member - // account. - // - // If you don't specify this parameter, the role name defaults to - // OrganizationAccountAccessRole . - // - // For more information about how to use this role to access the member account, - // see the following links: - // - // [Creating the OrganizationAccountAccessRole in an invited member account] - // - in the Organizations User Guide - // - // - Steps 2 and 3 in [IAM Tutorial: Delegate access across Amazon Web Services accounts using IAM roles]in the IAM User Guide - // - // The [regex pattern] that is used to validate this parameter. The pattern can include uppercase - // letters, lowercase letters, digits with no spaces, and any of the following - // characters: =,.@- - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // [Creating the OrganizationAccountAccessRole in an invited member account]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html#orgs_manage_accounts_create-cross-account-role - // [IAM Tutorial: Delegate access across Amazon Web Services accounts using IAM roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html - RoleName *string - - // A list of tags that you want to attach to the newly created account. For each - // tag in the list, you must specify both a tag key and a value. You can set the - // value to an empty string, but you can't set it to null . For more information - // about tagging, see [Tagging Organizations resources]in the Organizations User Guide. - // - // If any one of the tags is not valid or if you exceed the maximum allowed number - // of tags for an account, then the entire request fails and the account is not - // created. - // - // [Tagging Organizations resources]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html - Tags []types.Tag - - noSmithyDocumentSerde -} - -type CreateAccountOutput struct { - - // A structure that contains details about the request to create an account. This - // response structure might not be fully populated when you first receive it - // because account creation is an asynchronous process. You can pass the returned - // CreateAccountStatus ID as a parameter to DescribeCreateAccountStatus to get status about the progress of - // the request at later times. You can also check the CloudTrail log for the - // CreateAccountResult event. For more information, see [Logging and monitoring in Organizations] in the Organizations User - // Guide. - // - // [Logging and monitoring in Organizations]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_security_incident-response.html - CreateAccountStatus *types.CreateAccountStatus - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateAccount{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateAccount{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateAccount"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateAccountValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateAccount(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateAccount(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateAccount", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CreateGovCloudAccount.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CreateGovCloudAccount.go deleted file mode 100644 index 25ba5324c9..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CreateGovCloudAccount.go +++ /dev/null @@ -1,364 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// This action is available if all of the following are true: -// -// - You're authorized to create accounts in the Amazon Web Services GovCloud -// (US) Region. For more information on the Amazon Web Services GovCloud (US) -// Region, see the [Amazon Web Services GovCloud User Guide.] -// -// - You already have an account in the Amazon Web Services GovCloud (US) Region -// that is paired with a management account of an organization in the commercial -// Region. -// -// - You call this action from the management account of your organization in -// the commercial Region. -// -// - You have the organizations:CreateGovCloudAccount permission. -// -// Organizations automatically creates the required service-linked role named -// AWSServiceRoleForOrganizations . For more information, see [Organizations and service-linked roles] in the -// Organizations User Guide. -// -// Amazon Web Services automatically enables CloudTrail for Amazon Web Services -// GovCloud (US) accounts, but you should also do the following: -// -// - Verify that CloudTrail is enabled to store logs. -// -// - Create an Amazon S3 bucket for CloudTrail log storage. -// -// For more information, see [Verifying CloudTrail Is Enabled]in the Amazon Web Services GovCloud User Guide. -// -// If the request includes tags, then the requester must have the -// organizations:TagResource permission. The tags are attached to the commercial -// account associated with the GovCloud account, rather than the GovCloud account -// itself. To add tags to the GovCloud account, call the TagResourceoperation in the GovCloud -// Region after the new GovCloud account exists. -// -// You call this action from the management account of your organization in the -// commercial Region to create a standalone Amazon Web Services account in the -// Amazon Web Services GovCloud (US) Region. After the account is created, the -// management account of an organization in the Amazon Web Services GovCloud (US) -// Region can invite it to that organization. For more information on inviting -// standalone accounts in the Amazon Web Services GovCloud (US) to join an -// organization, see [Organizations]in the Amazon Web Services GovCloud User Guide. -// -// Calling CreateGovCloudAccount is an asynchronous request that Amazon Web -// Services performs in the background. Because CreateGovCloudAccount operates -// asynchronously, it can return a successful completion message even though -// account initialization might still be in progress. You might need to wait a few -// minutes before you can successfully access the account. To check the status of -// the request, do one of the following: -// -// - Use the OperationId response element from this operation to provide as a -// parameter to the DescribeCreateAccountStatusoperation. -// -// - Check the CloudTrail log for the CreateAccountResult event. For information -// on using CloudTrail with Organizations, see [Logging and monitoring in Organizations]in the Organizations User Guide. -// -// When you call the CreateGovCloudAccount action, you create two accounts: a -// standalone account in the Amazon Web Services GovCloud (US) Region and an -// associated account in the commercial Region for billing and support purposes. -// The account in the commercial Region is automatically a member of the -// organization whose credentials made the request. Both accounts are associated -// with the same email address. -// -// A role is created in the new account in the commercial Region that allows the -// management account in the organization in the commercial Region to assume it. An -// Amazon Web Services GovCloud (US) account is then created and associated with -// the commercial account that you just created. A role is also created in the new -// Amazon Web Services GovCloud (US) account that can be assumed by the Amazon Web -// Services GovCloud (US) account that is associated with the management account of -// the commercial organization. For more information and to view a diagram that -// explains how account access works, see [Organizations]in the Amazon Web Services GovCloud User -// Guide. -// -// For more information about creating accounts, see [Creating a member account in your organization] in the Organizations User -// Guide. -// -// - When you create an account in an organization using the Organizations -// console, API, or CLI commands, the information required for the account to -// operate as a standalone account is not automatically collected. This includes a -// payment method and signing the end user license agreement (EULA). If you must -// remove an account from your organization later, you can do so only after you -// provide the missing information. For more information, see [Considerations before removing an account from an organization]in the -// Organizations User Guide. -// -// - If you get an exception that indicates that you exceeded your account -// limits for the organization, contact [Amazon Web Services Support]. -// -// - If you get an exception that indicates that the operation failed because -// your organization is still initializing, wait one hour and then try again. If -// the error persists, contact [Amazon Web Services Support]. -// -// - Using CreateGovCloudAccount to create multiple temporary accounts isn't -// recommended. You can only close an account from the Amazon Web Services Billing -// and Cost Management console, and you must be signed in as the root user. For -// information on the requirements and process for closing an account, see [Closing a member account in your organization]in -// the Organizations User Guide. -// -// When you create a member account with this operation, you can choose whether to -// create the account with the IAM User and Role Access to Billing Information -// switch enabled. If you enable it, IAM users and roles that have appropriate -// permissions can view billing information for the account. If you disable it, -// only the account root user can access billing information. For information about -// how to disable this switch for an account, see [Granting access to your billing information and tools]. -// -// [Granting access to your billing information and tools]: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html -// [Verifying CloudTrail Is Enabled]: https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/verifying-cloudtrail.html -// [Amazon Web Services Support]: https://console.aws.amazon.com/support/home#/ -// [Logging and monitoring in Organizations]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_security_incident-response.html -// [Organizations]: https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html -// [Organizations and service-linked roles]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_integrate_services-using_slrs -// [Creating a member account in your organization]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_create.html -// [Considerations before removing an account from an organization]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_account-before-remove.html -// [Amazon Web Services GovCloud User Guide.]: https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/welcome.html -// [Closing a member account in your organization]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_close.html -func (c *Client) CreateGovCloudAccount(ctx context.Context, params *CreateGovCloudAccountInput, optFns ...func(*Options)) (*CreateGovCloudAccountOutput, error) { - if params == nil { - params = &CreateGovCloudAccountInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateGovCloudAccount", params, optFns, c.addOperationCreateGovCloudAccountMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateGovCloudAccountOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateGovCloudAccountInput struct { - - // The friendly name of the member account. - // - // The account name can consist of only the characters [a-z],[A-Z],[0-9], hyphen - // (-), or dot (.) You can't separate characters with a dash (–). - // - // This member is required. - AccountName *string - - // Specifies the email address of the owner to assign to the new member account in - // the commercial Region. This email address must not already be associated with - // another Amazon Web Services account. You must use a valid email address to - // complete account creation. - // - // The rules for a valid email address: - // - // - The address must be a minimum of 6 and a maximum of 64 characters long. - // - // - All characters must be 7-bit ASCII characters. - // - // - There must be one and only one @ symbol, which separates the local name - // from the domain name. - // - // - The local name can't contain any of the following characters: - // - // whitespace, " ' ( ) < > [ ] : ; , \ | % & - // - // - The local name can't begin with a dot (.) - // - // - The domain name can consist of only the characters [a-z],[A-Z],[0-9], - // hyphen (-), or dot (.) - // - // - The domain name can't begin or end with a hyphen (-) or dot (.) - // - // - The domain name must contain at least one dot - // - // You can't access the root user of the account or remove an account that was - // created with an invalid email address. Like all request parameters for - // CreateGovCloudAccount , the request for the email address for the Amazon Web - // Services GovCloud (US) account originates from the commercial Region, not from - // the Amazon Web Services GovCloud (US) Region. - // - // This member is required. - Email *string - - // If set to ALLOW , the new linked account in the commercial Region enables IAM - // users to access account billing information if they have the required - // permissions. If set to DENY , only the root user of the new account can access - // account billing information. For more information, see [About IAM access to the Billing and Cost Management console]in the Amazon Web - // Services Billing and Cost Management User Guide. - // - // If you don't specify this parameter, the value defaults to ALLOW , and IAM users - // and roles with the required permissions can access billing information for the - // new account. - // - // [About IAM access to the Billing and Cost Management console]: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate - IamUserAccessToBilling types.IAMUserAccessToBilling - - // (Optional) - // - // The name of an IAM role that Organizations automatically preconfigures in the - // new member accounts in both the Amazon Web Services GovCloud (US) Region and in - // the commercial Region. This role trusts the management account, allowing users - // in the management account to assume the role, as permitted by the management - // account administrator. The role has administrator permissions in the new member - // account. - // - // If you don't specify this parameter, the role name defaults to - // OrganizationAccountAccessRole . - // - // For more information about how to use this role to access the member account, - // see the following links: - // - // [Creating the OrganizationAccountAccessRole in an invited member account] - // - in the Organizations User Guide - // - // - Steps 2 and 3 in [IAM Tutorial: Delegate access across Amazon Web Services accounts using IAM roles]in the IAM User Guide - // - // The [regex pattern] that is used to validate this parameter. The pattern can include uppercase - // letters, lowercase letters, digits with no spaces, and any of the following - // characters: =,.@- - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // [Creating the OrganizationAccountAccessRole in an invited member account]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html#orgs_manage_accounts_create-cross-account-role - // [IAM Tutorial: Delegate access across Amazon Web Services accounts using IAM roles]: https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html - RoleName *string - - // A list of tags that you want to attach to the newly created account. These tags - // are attached to the commercial account associated with the GovCloud account, and - // not to the GovCloud account itself. To add tags to the actual GovCloud account, - // call the TagResourceoperation in the GovCloud region after the new GovCloud account exists. - // - // For each tag in the list, you must specify both a tag key and a value. You can - // set the value to an empty string, but you can't set it to null . For more - // information about tagging, see [Tagging Organizations resources]in the Organizations User Guide. - // - // If any one of the tags is not valid or if you exceed the maximum allowed number - // of tags for an account, then the entire request fails and the account is not - // created. - // - // [Tagging Organizations resources]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html - Tags []types.Tag - - noSmithyDocumentSerde -} - -type CreateGovCloudAccountOutput struct { - - // Contains the status about a CreateAccount or CreateGovCloudAccount request to create an Amazon Web Services - // account or an Amazon Web Services GovCloud (US) account in an organization. - CreateAccountStatus *types.CreateAccountStatus - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateGovCloudAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateGovCloudAccount{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateGovCloudAccount{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateGovCloudAccount"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateGovCloudAccountValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateGovCloudAccount(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateGovCloudAccount(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateGovCloudAccount", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CreateOrganization.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CreateOrganization.go deleted file mode 100644 index 9056077679..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CreateOrganization.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates an Amazon Web Services organization. The account whose user is calling -// the CreateOrganization operation automatically becomes the [management account] of the new -// organization. -// -// This operation must be called using credentials from the account that is to -// become the new organization's management account. The principal must also have -// the relevant IAM permissions. -// -// By default (or if you set the FeatureSet parameter to ALL ), the new -// organization is created with all features enabled and service control policies -// automatically enabled in the root. If you instead choose to create the -// organization supporting only the consolidated billing features by setting the -// FeatureSet parameter to CONSOLIDATED_BILLING , no policy types are enabled by -// default and you can't use organization policies. -// -// [management account]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#account -func (c *Client) CreateOrganization(ctx context.Context, params *CreateOrganizationInput, optFns ...func(*Options)) (*CreateOrganizationOutput, error) { - if params == nil { - params = &CreateOrganizationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateOrganization", params, optFns, c.addOperationCreateOrganizationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateOrganizationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateOrganizationInput struct { - - // Specifies the feature set supported by the new organization. Each feature set - // supports different levels of functionality. - // - // - CONSOLIDATED_BILLING : All member accounts have their bills consolidated to - // and paid by the management account. For more information, see [Consolidated billing]in the - // Organizations User Guide. - // - // The consolidated billing feature subset isn't available for organizations in - // the Amazon Web Services GovCloud (US) Region. - // - // - ALL : In addition to all the features supported by the consolidated billing - // feature set, the management account can also apply any policy type to any member - // account in the organization. For more information, see [All features]in the Organizations - // User Guide. - // - // [All features]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#feature-set-all - // [Consolidated billing]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#feature-set-cb-only - FeatureSet types.OrganizationFeatureSet - - noSmithyDocumentSerde -} - -type CreateOrganizationOutput struct { - - // A structure that contains details about the newly created organization. - Organization *types.Organization - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateOrganization{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateOrganization{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateOrganization"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateOrganization(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateOrganization(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateOrganization", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CreateOrganizationalUnit.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CreateOrganizationalUnit.go deleted file mode 100644 index e6ef3e80a7..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CreateOrganizationalUnit.go +++ /dev/null @@ -1,195 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates an organizational unit (OU) within a root or parent OU. An OU is a -// container for accounts that enables you to organize your accounts to apply -// policies according to your business requirements. The number of levels deep that -// you can nest OUs is dependent upon the policy types enabled for that root. For -// service control policies, the limit is five. -// -// For more information about OUs, see [Managing organizational units (OUs)] in the Organizations User Guide. -// -// If the request includes tags, then the requester must have the -// organizations:TagResource permission. -// -// You can only call this operation from the management account. -// -// [Managing organizational units (OUs)]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_ous.html -func (c *Client) CreateOrganizationalUnit(ctx context.Context, params *CreateOrganizationalUnitInput, optFns ...func(*Options)) (*CreateOrganizationalUnitOutput, error) { - if params == nil { - params = &CreateOrganizationalUnitInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreateOrganizationalUnit", params, optFns, c.addOperationCreateOrganizationalUnitMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreateOrganizationalUnitOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreateOrganizationalUnitInput struct { - - // The friendly name to assign to the new OU. - // - // This member is required. - Name *string - - // ID for the parent root or OU that you want to create the new OU in. - // - // The [regex pattern] for a parent ID string requires one of the following: - // - // - Root - A string that begins with "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // - Organizational unit (OU) - A string that begins with "ou-" followed by from - // 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This - // string is followed by a second "-" dash and from 8 to 32 additional lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - ParentId *string - - // A list of tags that you want to attach to the newly created OU. For each tag in - // the list, you must specify both a tag key and a value. You can set the value to - // an empty string, but you can't set it to null . For more information about - // tagging, see [Tagging Organizations resources]in the Organizations User Guide. - // - // If any one of the tags is not valid or if you exceed the allowed number of tags - // for an OU, then the entire request fails and the OU is not created. - // - // [Tagging Organizations resources]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html - Tags []types.Tag - - noSmithyDocumentSerde -} - -type CreateOrganizationalUnitOutput struct { - - // A structure that contains details about the newly created OU. - OrganizationalUnit *types.OrganizationalUnit - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreateOrganizationalUnitMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateOrganizationalUnit{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateOrganizationalUnit{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreateOrganizationalUnit"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreateOrganizationalUnitValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateOrganizationalUnit(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreateOrganizationalUnit(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreateOrganizationalUnit", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CreatePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CreatePolicy.go deleted file mode 100644 index 35613c8093..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_CreatePolicy.go +++ /dev/null @@ -1,242 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates a policy of a specified type that you can attach to a root, an -// organizational unit (OU), or an individual Amazon Web Services account. -// -// For more information about policies and their use, see [Managing Organizations policies]. -// -// If the request includes tags, then the requester must have the -// organizations:TagResource permission. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -// -// [Managing Organizations policies]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html -func (c *Client) CreatePolicy(ctx context.Context, params *CreatePolicyInput, optFns ...func(*Options)) (*CreatePolicyOutput, error) { - if params == nil { - params = &CreatePolicyInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "CreatePolicy", params, optFns, c.addOperationCreatePolicyMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*CreatePolicyOutput) - out.ResultMetadata = metadata - return out, nil -} - -type CreatePolicyInput struct { - - // The policy text content to add to the new policy. The text that you supply must - // adhere to the rules of the policy type you specify in the Type parameter. - // - // The maximum size of a policy document depends on the policy's type. For more - // information, see [Maximum and minimum values]in the Organizations User Guide. - // - // [Maximum and minimum values]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html#min-max-values - // - // This member is required. - Content *string - - // An optional description to assign to the policy. - // - // This member is required. - Description *string - - // The friendly name to assign to the policy. - // - // The [regex pattern] that is used to validate this parameter is a string of any of the - // characters in the ASCII character range. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - Name *string - - // The type of policy to create. You can specify one of the following values: - // - // [SERVICE_CONTROL_POLICY] - // - // [RESOURCE_CONTROL_POLICY] - // - // [DECLARATIVE_POLICY_EC2] - // - // [BACKUP_POLICY] - // - // [TAG_POLICY] - // - // [CHATBOT_POLICY] - // - // [AISERVICES_OPT_OUT_POLICY] - // - // [SECURITYHUB_POLICY] - // - // [UPGRADE_ROLLOUT_POLICY] - // - // [INSPECTOR_POLICY] - // - // [BEDROCK_POLICY] - // - // [S3_POLICY] - // - // [NETWORK_SECURITY_DIRECTOR_POLICY] - // - // [BEDROCK_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_bedrock.html - // [NETWORK_SECURITY_DIRECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_network_security_director.html - // [UPGRADE_ROLLOUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_upgrade_rollout.html - // [BACKUP_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html - // [CHATBOT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_chatbot.html - // [TAG_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html - // [INSPECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_inspector.html - // [S3_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_s3.html - // [RESOURCE_CONTROL_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_rcps.html - // [AISERVICES_OPT_OUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html - // [SECURITYHUB_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_security_hub.html - // [SERVICE_CONTROL_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html - // [DECLARATIVE_POLICY_EC2]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_declarative.html - // - // This member is required. - Type types.PolicyType - - // A list of tags that you want to attach to the newly created policy. For each - // tag in the list, you must specify both a tag key and a value. You can set the - // value to an empty string, but you can't set it to null . For more information - // about tagging, see [Tagging Organizations resources]in the Organizations User Guide. - // - // If any one of the tags is not valid or if you exceed the allowed number of tags - // for a policy, then the entire request fails and the policy is not created. - // - // [Tagging Organizations resources]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html - Tags []types.Tag - - noSmithyDocumentSerde -} - -type CreatePolicyOutput struct { - - // A structure that contains details about the newly created policy. - Policy *types.Policy - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationCreatePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreatePolicy{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreatePolicy{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "CreatePolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpCreatePolicyValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePolicy(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opCreatePolicy(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "CreatePolicy", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DeclineHandshake.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DeclineHandshake.go deleted file mode 100644 index 0aa5264fa2..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DeclineHandshake.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Declines a Handshake. -// -// Only the account that receives a handshake can call this operation. The sender -// of the handshake can use CancelHandshaketo cancel if the handshake hasn't yet been responded -// to. -// -// You can view canceled handshakes in API responses for 30 days before they are -// deleted. -func (c *Client) DeclineHandshake(ctx context.Context, params *DeclineHandshakeInput, optFns ...func(*Options)) (*DeclineHandshakeOutput, error) { - if params == nil { - params = &DeclineHandshakeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeclineHandshake", params, optFns, c.addOperationDeclineHandshakeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeclineHandshakeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeclineHandshakeInput struct { - - // ID for the handshake that you want to decline. You can get the ID from the ListHandshakesForAccount - // operation. - // - // The [regex pattern] for handshake ID string requires "h-" followed by from 8 to 32 lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - HandshakeId *string - - noSmithyDocumentSerde -} - -type DeclineHandshakeOutput struct { - - // A Handshake object. Contains details for the declined handshake. - Handshake *types.Handshake - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeclineHandshakeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeclineHandshake{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeclineHandshake{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeclineHandshake"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeclineHandshakeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeclineHandshake(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeclineHandshake(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeclineHandshake", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DeleteOrganization.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DeleteOrganization.go deleted file mode 100644 index 64492ca484..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DeleteOrganization.go +++ /dev/null @@ -1,142 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the organization. You can delete an organization only by using -// credentials from the management account. The organization must be empty of -// member accounts. -func (c *Client) DeleteOrganization(ctx context.Context, params *DeleteOrganizationInput, optFns ...func(*Options)) (*DeleteOrganizationOutput, error) { - if params == nil { - params = &DeleteOrganizationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteOrganization", params, optFns, c.addOperationDeleteOrganizationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteOrganizationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteOrganizationInput struct { - noSmithyDocumentSerde -} - -type DeleteOrganizationOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteOrganization{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteOrganization{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteOrganization"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteOrganization(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteOrganization(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteOrganization", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DeleteOrganizationalUnit.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DeleteOrganizationalUnit.go deleted file mode 100644 index 681818bd33..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DeleteOrganizationalUnit.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes an organizational unit (OU) from a root or another OU. You must first -// remove all accounts and child OUs from the OU that you want to delete. -// -// You can only call this operation from the management account. -func (c *Client) DeleteOrganizationalUnit(ctx context.Context, params *DeleteOrganizationalUnitInput, optFns ...func(*Options)) (*DeleteOrganizationalUnitOutput, error) { - if params == nil { - params = &DeleteOrganizationalUnitInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteOrganizationalUnit", params, optFns, c.addOperationDeleteOrganizationalUnitMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteOrganizationalUnitOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteOrganizationalUnitInput struct { - - // ID for the organizational unit that you want to delete. You can get the ID from - // the ListOrganizationalUnitsForParentoperation. - // - // The [regex pattern] for an organizational unit ID string requires "ou-" followed by from 4 to - // 32 lowercase letters or digits (the ID of the root that contains the OU). This - // string is followed by a second "-" dash and from 8 to 32 additional lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - OrganizationalUnitId *string - - noSmithyDocumentSerde -} - -type DeleteOrganizationalUnitOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteOrganizationalUnitMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteOrganizationalUnit{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteOrganizationalUnit{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteOrganizationalUnit"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeleteOrganizationalUnitValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteOrganizationalUnit(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteOrganizationalUnit(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteOrganizationalUnit", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DeletePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DeletePolicy.go deleted file mode 100644 index 74c0ce5c02..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DeletePolicy.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the specified policy from your organization. Before you perform this -// operation, you must first detach the policy from all organizational units (OUs), -// roots, and accounts. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -func (c *Client) DeletePolicy(ctx context.Context, params *DeletePolicyInput, optFns ...func(*Options)) (*DeletePolicyOutput, error) { - if params == nil { - params = &DeletePolicyInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeletePolicy", params, optFns, c.addOperationDeletePolicyMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeletePolicyOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeletePolicyInput struct { - - // ID for the policy that you want to delete. You can get the ID from the ListPolicies or ListPoliciesForTarget - // operations. - // - // The [regex pattern] for a policy ID string requires "p-" followed by from 8 to 128 lowercase - // or uppercase letters, digits, or the underscore character (_). - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - PolicyId *string - - noSmithyDocumentSerde -} - -type DeletePolicyOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeletePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeletePolicy{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeletePolicy{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeletePolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeletePolicyValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePolicy(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeletePolicy(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeletePolicy", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DeleteResourcePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DeleteResourcePolicy.go deleted file mode 100644 index 7cc4553e68..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DeleteResourcePolicy.go +++ /dev/null @@ -1,142 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Deletes the resource policy from your organization. -// -// You can only call this operation from the management account. -func (c *Client) DeleteResourcePolicy(ctx context.Context, params *DeleteResourcePolicyInput, optFns ...func(*Options)) (*DeleteResourcePolicyOutput, error) { - if params == nil { - params = &DeleteResourcePolicyInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeleteResourcePolicy", params, optFns, c.addOperationDeleteResourcePolicyMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeleteResourcePolicyOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeleteResourcePolicyInput struct { - noSmithyDocumentSerde -} - -type DeleteResourcePolicyOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeleteResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteResourcePolicy{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteResourcePolicy{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteResourcePolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResourcePolicy(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeleteResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeleteResourcePolicy", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DeregisterDelegatedAdministrator.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DeregisterDelegatedAdministrator.go deleted file mode 100644 index af2464e99f..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DeregisterDelegatedAdministrator.go +++ /dev/null @@ -1,175 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Removes the specified member Amazon Web Services account as a delegated -// administrator for the specified Amazon Web Services service. -// -// Deregistering a delegated administrator can have unintended impacts on the -// functionality of the enabled Amazon Web Services service. See the documentation -// for the enabled service before you deregister a delegated administrator so that -// you understand any potential impacts. -// -// You can run this action only for Amazon Web Services services that support this -// feature. For a current list of services that support it, see the column Supports -// Delegated Administrator in the table at [Amazon Web Services Services that you can use with Organizations]in the Organizations User Guide. -// -// You can only call this operation from the management account. -// -// [Amazon Web Services Services that you can use with Organizations]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services_list.html -func (c *Client) DeregisterDelegatedAdministrator(ctx context.Context, params *DeregisterDelegatedAdministratorInput, optFns ...func(*Options)) (*DeregisterDelegatedAdministratorOutput, error) { - if params == nil { - params = &DeregisterDelegatedAdministratorInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DeregisterDelegatedAdministrator", params, optFns, c.addOperationDeregisterDelegatedAdministratorMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DeregisterDelegatedAdministratorOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DeregisterDelegatedAdministratorInput struct { - - // The account ID number of the member account in the organization that you want - // to deregister as a delegated administrator. - // - // This member is required. - AccountId *string - - // The service principal name of an Amazon Web Services service for which the - // account is a delegated administrator. - // - // Delegated administrator privileges are revoked for only the specified Amazon - // Web Services service from the member account. If the specified service is the - // only service for which the member account is a delegated administrator, the - // operation also revokes Organizations read action permissions. - // - // This member is required. - ServicePrincipal *string - - noSmithyDocumentSerde -} - -type DeregisterDelegatedAdministratorOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDeregisterDelegatedAdministratorMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeregisterDelegatedAdministrator{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeregisterDelegatedAdministrator{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DeregisterDelegatedAdministrator"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDeregisterDelegatedAdministratorValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterDelegatedAdministrator(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDeregisterDelegatedAdministrator(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DeregisterDelegatedAdministrator", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeAccount.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeAccount.go deleted file mode 100644 index 0410411fef..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeAccount.go +++ /dev/null @@ -1,168 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves Organizations-related information about the specified account. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -func (c *Client) DescribeAccount(ctx context.Context, params *DescribeAccountInput, optFns ...func(*Options)) (*DescribeAccountOutput, error) { - if params == nil { - params = &DescribeAccountInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeAccount", params, optFns, c.addOperationDescribeAccountMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeAccountOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeAccountInput struct { - - // The unique identifier (ID) of the Amazon Web Services account that you want - // information about. You can get the ID from the ListAccountsor ListAccountsForParent operations. - // - // The [regex pattern] for an account ID string requires exactly 12 digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - AccountId *string - - noSmithyDocumentSerde -} - -type DescribeAccountOutput struct { - - // A structure that contains information about the requested account. - // - // The Status parameter in the API response will be retired on September 9, 2026. - // Although both the account State and account Status parameters are currently - // available in the Organizations APIs ( DescribeAccount , ListAccounts , - // ListAccountsForParent ), we recommend that you update your scripts or other code - // to use the State parameter instead of Status before September 9, 2026. - Account *types.Account - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeAccount{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeAccount{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeAccount"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeAccountValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeAccount(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeAccount(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeAccount", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeCreateAccountStatus.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeCreateAccountStatus.go deleted file mode 100644 index 585ea58068..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeCreateAccountStatus.go +++ /dev/null @@ -1,164 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves the current status of an asynchronous request to create an account. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -func (c *Client) DescribeCreateAccountStatus(ctx context.Context, params *DescribeCreateAccountStatusInput, optFns ...func(*Options)) (*DescribeCreateAccountStatusOutput, error) { - if params == nil { - params = &DescribeCreateAccountStatusInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeCreateAccountStatus", params, optFns, c.addOperationDescribeCreateAccountStatusMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeCreateAccountStatusOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeCreateAccountStatusInput struct { - - // Specifies the Id value that uniquely identifies the CreateAccount request. You - // can get the value from the CreateAccountStatus.Id response in an earlier CreateAccount - // request, or from the ListCreateAccountStatusoperation. - // - // The [regex pattern] for a create account request ID string requires "car-" followed by from 8 - // to 32 lowercase letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - CreateAccountRequestId *string - - noSmithyDocumentSerde -} - -type DescribeCreateAccountStatusOutput struct { - - // A structure that contains the current status of an account creation request. - CreateAccountStatus *types.CreateAccountStatus - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeCreateAccountStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeCreateAccountStatus{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeCreateAccountStatus{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeCreateAccountStatus"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeCreateAccountStatusValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCreateAccountStatus(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeCreateAccountStatus(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeCreateAccountStatus", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeEffectivePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeEffectivePolicy.go deleted file mode 100644 index 465b55fbb3..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeEffectivePolicy.go +++ /dev/null @@ -1,208 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns the contents of the effective policy for specified policy type and -// account. The effective policy is the aggregation of any policies of the -// specified type that the account inherits, plus any policy of that type that is -// directly attached to the account. -// -// This operation applies only to management policies. It does not apply to -// authorization policies: service control policies (SCPs) and resource control -// policies (RCPs). -// -// For more information about policy inheritance, see [Understanding management policy inheritance] in the Organizations User -// Guide. -// -// You can call this operation from any account in a organization. -// -// [Understanding management policy inheritance]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_inheritance_mgmt.html -func (c *Client) DescribeEffectivePolicy(ctx context.Context, params *DescribeEffectivePolicyInput, optFns ...func(*Options)) (*DescribeEffectivePolicyOutput, error) { - if params == nil { - params = &DescribeEffectivePolicyInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeEffectivePolicy", params, optFns, c.addOperationDescribeEffectivePolicyMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeEffectivePolicyOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeEffectivePolicyInput struct { - - // The type of policy that you want information about. You can specify one of the - // following values: - // - // [DECLARATIVE_POLICY_EC2] - // - // [BACKUP_POLICY] - // - // [TAG_POLICY] - // - // [CHATBOT_POLICY] - // - // [AISERVICES_OPT_OUT_POLICY] - // - // [SECURITYHUB_POLICY] - // - // [UPGRADE_ROLLOUT_POLICY] - // - // [INSPECTOR_POLICY] - // - // [BEDROCK_POLICY] - // - // [S3_POLICY] - // - // [NETWORK_SECURITY_DIRECTOR_POLICY] - // - // [AISERVICES_OPT_OUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html - // [BEDROCK_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_bedrock.html - // [NETWORK_SECURITY_DIRECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_network_security_director.html - // [UPGRADE_ROLLOUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_upgrade_rollout.html - // [SECURITYHUB_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_security_hub.html - // [BACKUP_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html - // [CHATBOT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_chatbot.html - // [TAG_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html - // [DECLARATIVE_POLICY_EC2]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_declarative.html - // [INSPECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_inspector.html - // [S3_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_s3.html - // - // This member is required. - PolicyType types.EffectivePolicyType - - // When you're signed in as the management account, specify the ID of the account - // that you want details about. Specifying an organization root or organizational - // unit (OU) as the target is not supported. - TargetId *string - - noSmithyDocumentSerde -} - -type DescribeEffectivePolicyOutput struct { - - // The contents of the effective policy. - EffectivePolicy *types.EffectivePolicy - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeEffectivePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeEffectivePolicy{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeEffectivePolicy{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeEffectivePolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeEffectivePolicyValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEffectivePolicy(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeEffectivePolicy(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeEffectivePolicy", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeHandshake.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeHandshake.go deleted file mode 100644 index a91267e70f..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeHandshake.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns details for a handshake. A handshake is the secure exchange of -// information between two Amazon Web Services accounts: a sender and a recipient. -// -// You can view ACCEPTED , DECLINED , or CANCELED handshakes in API Responses for -// 30 days before they are deleted. -// -// You can call this operation from any account in a organization. -func (c *Client) DescribeHandshake(ctx context.Context, params *DescribeHandshakeInput, optFns ...func(*Options)) (*DescribeHandshakeOutput, error) { - if params == nil { - params = &DescribeHandshakeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeHandshake", params, optFns, c.addOperationDescribeHandshakeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeHandshakeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeHandshakeInput struct { - - // ID for the handshake that you want information about. - // - // The [regex pattern] for handshake ID string requires "h-" followed by from 8 to 32 lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - HandshakeId *string - - noSmithyDocumentSerde -} - -type DescribeHandshakeOutput struct { - - // A Handshake object. Contains details for the handshake. - Handshake *types.Handshake - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeHandshakeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeHandshake{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeHandshake{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeHandshake"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeHandshakeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeHandshake(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeHandshake(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeHandshake", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeOrganization.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeOrganization.go deleted file mode 100644 index 4b03f78691..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeOrganization.go +++ /dev/null @@ -1,157 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves information about the organization that the user's account belongs to. -// -// You can call this operation from any account in a organization. -// -// Even if a policy type is shown as available in the organization, you can -// disable it separately at the root level with DisablePolicyType. Use ListRoots to see the status of policy -// types for a specified root. -func (c *Client) DescribeOrganization(ctx context.Context, params *DescribeOrganizationInput, optFns ...func(*Options)) (*DescribeOrganizationOutput, error) { - if params == nil { - params = &DescribeOrganizationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeOrganization", params, optFns, c.addOperationDescribeOrganizationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeOrganizationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeOrganizationInput struct { - noSmithyDocumentSerde -} - -type DescribeOrganizationOutput struct { - - // A structure that contains information about the organization. - // - // The AvailablePolicyTypes part of the response is deprecated, and you shouldn't - // use it in your apps. It doesn't include any policy type supported by - // Organizations other than SCPs. In the China (Ningxia) Region, no policy type is - // included. To determine which policy types are enabled in your organization, use - // the ListRootsoperation. - Organization *types.Organization - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeOrganization{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeOrganization{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeOrganization"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeOrganization(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeOrganization(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeOrganization", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeOrganizationalUnit.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeOrganizationalUnit.go deleted file mode 100644 index 282803e6f3..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeOrganizationalUnit.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves information about an organizational unit (OU). -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -func (c *Client) DescribeOrganizationalUnit(ctx context.Context, params *DescribeOrganizationalUnitInput, optFns ...func(*Options)) (*DescribeOrganizationalUnitOutput, error) { - if params == nil { - params = &DescribeOrganizationalUnitInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeOrganizationalUnit", params, optFns, c.addOperationDescribeOrganizationalUnitMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeOrganizationalUnitOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeOrganizationalUnitInput struct { - - // ID for the organizational unit that you want details about. You can get the ID - // from the ListOrganizationalUnitsForParentoperation. - // - // The [regex pattern] for an organizational unit ID string requires "ou-" followed by from 4 to - // 32 lowercase letters or digits (the ID of the root that contains the OU). This - // string is followed by a second "-" dash and from 8 to 32 additional lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - OrganizationalUnitId *string - - noSmithyDocumentSerde -} - -type DescribeOrganizationalUnitOutput struct { - - // A structure that contains details about the specified OU. - OrganizationalUnit *types.OrganizationalUnit - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeOrganizationalUnitMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeOrganizationalUnit{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeOrganizationalUnit{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeOrganizationalUnit"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeOrganizationalUnitValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeOrganizationalUnit(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeOrganizationalUnit(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeOrganizationalUnit", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribePolicy.go deleted file mode 100644 index f54d968787..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribePolicy.go +++ /dev/null @@ -1,163 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves information about a policy. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -func (c *Client) DescribePolicy(ctx context.Context, params *DescribePolicyInput, optFns ...func(*Options)) (*DescribePolicyOutput, error) { - if params == nil { - params = &DescribePolicyInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribePolicy", params, optFns, c.addOperationDescribePolicyMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribePolicyOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribePolicyInput struct { - - // ID for the policy that you want details about. You can get the ID from the ListPolicies or ListPoliciesForTarget - // operations. - // - // The [regex pattern] for a policy ID string requires "p-" followed by from 8 to 128 lowercase - // or uppercase letters, digits, or the underscore character (_). - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - PolicyId *string - - noSmithyDocumentSerde -} - -type DescribePolicyOutput struct { - - // A structure that contains details about the specified policy. - Policy *types.Policy - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribePolicy{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribePolicy{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribePolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribePolicyValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePolicy(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribePolicy(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribePolicy", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeResourcePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeResourcePolicy.go deleted file mode 100644 index 6f40ce3be6..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeResourcePolicy.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves information about a resource policy. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -func (c *Client) DescribeResourcePolicy(ctx context.Context, params *DescribeResourcePolicyInput, optFns ...func(*Options)) (*DescribeResourcePolicyOutput, error) { - if params == nil { - params = &DescribeResourcePolicyInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeResourcePolicy", params, optFns, c.addOperationDescribeResourcePolicyMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeResourcePolicyOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeResourcePolicyInput struct { - noSmithyDocumentSerde -} - -type DescribeResourcePolicyOutput struct { - - // A structure that contains details about the resource policy. - ResourcePolicy *types.ResourcePolicy - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeResourcePolicy{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeResourcePolicy{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeResourcePolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeResourcePolicy(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeResourcePolicy", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeResponsibilityTransfer.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeResponsibilityTransfer.go deleted file mode 100644 index 0bdc9dd325..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DescribeResponsibilityTransfer.go +++ /dev/null @@ -1,156 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns details for a transfer. A transfer is an arrangement between two -// management accounts where one account designates the other with specified -// responsibilities for their organization. -func (c *Client) DescribeResponsibilityTransfer(ctx context.Context, params *DescribeResponsibilityTransferInput, optFns ...func(*Options)) (*DescribeResponsibilityTransferOutput, error) { - if params == nil { - params = &DescribeResponsibilityTransferInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DescribeResponsibilityTransfer", params, optFns, c.addOperationDescribeResponsibilityTransferMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DescribeResponsibilityTransferOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DescribeResponsibilityTransferInput struct { - - // ID for the transfer. - // - // This member is required. - Id *string - - noSmithyDocumentSerde -} - -type DescribeResponsibilityTransferOutput struct { - - // A ResponsibilityTransfer object. Contains details for a transfer. - ResponsibilityTransfer *types.ResponsibilityTransfer - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDescribeResponsibilityTransferMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeResponsibilityTransfer{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeResponsibilityTransfer{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeResponsibilityTransfer"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDescribeResponsibilityTransferValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeResponsibilityTransfer(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDescribeResponsibilityTransfer(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DescribeResponsibilityTransfer", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DetachPolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DetachPolicy.go deleted file mode 100644 index e8685228cc..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DetachPolicy.go +++ /dev/null @@ -1,194 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Detaches a policy from a target root, organizational unit (OU), or account. -// -// If the policy being detached is a service control policy (SCP), the changes to -// permissions for Identity and Access Management (IAM) users and roles in affected -// accounts are immediate. -// -// Every root, OU, and account must have at least one SCP attached. If you want to -// replace the default FullAWSAccess policy with an SCP that limits the -// permissions that can be delegated, you must attach the replacement SCP before -// you can remove the default SCP. This is the authorization strategy of an "[allow list] ". If -// you instead attach a second SCP and leave the FullAWSAccess SCP still attached, -// and specify "Effect": "Deny" in the second SCP to override the "Effect": "Allow" -// in the FullAWSAccess policy (or any other attached SCP), you're using the -// authorization strategy of a "[deny list] ". -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -// -// [deny list]: https://docs.aws.amazon.com/organizations/latest/userguide/SCP_strategies.html#orgs_policies_denylist -// [allow list]: https://docs.aws.amazon.com/organizations/latest/userguide/SCP_strategies.html#orgs_policies_allowlist -func (c *Client) DetachPolicy(ctx context.Context, params *DetachPolicyInput, optFns ...func(*Options)) (*DetachPolicyOutput, error) { - if params == nil { - params = &DetachPolicyInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DetachPolicy", params, optFns, c.addOperationDetachPolicyMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DetachPolicyOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DetachPolicyInput struct { - - // ID for the policy you want to detach. You can get the ID from the ListPolicies or ListPoliciesForTarget - // operations. - // - // The [regex pattern] for a policy ID string requires "p-" followed by from 8 to 128 lowercase - // or uppercase letters, digits, or the underscore character (_). - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - PolicyId *string - - // ID for the root, OU, or account that you want to detach the policy from. You - // can get the ID from the ListRoots, ListOrganizationalUnitsForParent, or ListAccounts operations. - // - // The [regex pattern] for a target ID string requires one of the following: - // - // - Root - A string that begins with "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // - Account - A string that consists of exactly 12 digits. - // - // - Organizational unit (OU) - A string that begins with "ou-" followed by from - // 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This - // string is followed by a second "-" dash and from 8 to 32 additional lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - TargetId *string - - noSmithyDocumentSerde -} - -type DetachPolicyOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDetachPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDetachPolicy{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDetachPolicy{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DetachPolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDetachPolicyValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDetachPolicy(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDetachPolicy(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DetachPolicy", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DisableAWSServiceAccess.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DisableAWSServiceAccess.go deleted file mode 100644 index 111fa18a51..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DisableAWSServiceAccess.go +++ /dev/null @@ -1,207 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disables the integration of an Amazon Web Services service (the service that is -// specified by ServicePrincipal ) with Organizations. When you disable -// integration, the specified service no longer can create a [service-linked role]in new accounts in -// your organization. This means the service can't perform operations on your -// behalf on any new accounts in your organization. The service can still perform -// operations in older accounts until the service completes its clean-up from -// Organizations. -// -// We strongly recommend that you don't use this command to disable integration -// between Organizations and the specified Amazon Web Services service. Instead, -// use the console or commands that are provided by the specified service. This -// lets the trusted service perform any required initialization when enabling -// trusted access, such as creating any required resources and any required clean -// up of resources when disabling trusted access. -// -// For information about how to disable trusted service access to your -// organization using the trusted service, see the Learn more link under the -// Supports Trusted Access column at [Amazon Web Services services that you can use with Organizations]. on this page. -// -// If you disable access by using this command, it causes the following actions to -// occur: -// -// - The service can no longer create a service-linked role in the accounts in -// your organization. This means that the service can't perform operations on your -// behalf on any new accounts in your organization. The service can still perform -// operations in older accounts until the service completes its clean-up from -// Organizations. -// -// - The service can no longer perform tasks in the member accounts in the -// organization, unless those operations are explicitly permitted by the IAM -// policies that are attached to your roles. This includes any data aggregation -// from the member accounts to the management account, or to a delegated -// administrator account, where relevant. -// -// - Some services detect this and clean up any remaining data or resources -// related to the integration, while other services stop accessing the organization -// but leave any historical data and configuration in place to support a possible -// re-enabling of the integration. -// -// Using the other service's console or commands to disable the integration -// ensures that the other service is aware that it can clean up any resources that -// are required only for the integration. How the service cleans up its resources -// in the organization's accounts depends on that service. For more information, -// see the documentation for the other Amazon Web Services service. -// -// After you perform the DisableAWSServiceAccess operation, the specified service -// can no longer perform operations in your organization's accounts -// -// For more information about integrating other services with Organizations, -// including the list of services that work with Organizations, see [Using Organizations with other Amazon Web Services services]in the -// Organizations User Guide. -// -// You can only call this operation from the management account. -// -// [Amazon Web Services services that you can use with Organizations]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services_list.html -// [Using Organizations with other Amazon Web Services services]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html -// [service-linked role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html -func (c *Client) DisableAWSServiceAccess(ctx context.Context, params *DisableAWSServiceAccessInput, optFns ...func(*Options)) (*DisableAWSServiceAccessOutput, error) { - if params == nil { - params = &DisableAWSServiceAccessInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisableAWSServiceAccess", params, optFns, c.addOperationDisableAWSServiceAccessMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisableAWSServiceAccessOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisableAWSServiceAccessInput struct { - - // The service principal name of the Amazon Web Services service for which you - // want to disable integration with your organization. This is typically in the - // form of a URL, such as service-abbreviation.amazonaws.com . - // - // This member is required. - ServicePrincipal *string - - noSmithyDocumentSerde -} - -type DisableAWSServiceAccessOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisableAWSServiceAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisableAWSServiceAccess{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisableAWSServiceAccess{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisableAWSServiceAccess"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisableAWSServiceAccessValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableAWSServiceAccess(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisableAWSServiceAccess(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisableAWSServiceAccess", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DisablePolicyType.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DisablePolicyType.go deleted file mode 100644 index 14dd0397f9..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_DisablePolicyType.go +++ /dev/null @@ -1,223 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Disables an organizational policy type in a root. A policy of a certain type -// can be attached to entities in a root only if that type is enabled in the root. -// After you perform this operation, you no longer can attach policies of the -// specified type to that root or to any organizational unit (OU) or account in -// that root. You can undo this by using the EnablePolicyTypeoperation. -// -// This is an asynchronous request that Amazon Web Services performs in the -// background. If you disable a policy type for a root, it still appears enabled -// for the organization if [all features]are enabled for the organization. Amazon Web Services -// recommends that you first use ListRootsto see the status of policy types for a specified -// root, and then use this operation. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -// -// To view the status of available policy types in the organization, use ListRoots. -// -// [all features]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html -func (c *Client) DisablePolicyType(ctx context.Context, params *DisablePolicyTypeInput, optFns ...func(*Options)) (*DisablePolicyTypeOutput, error) { - if params == nil { - params = &DisablePolicyTypeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisablePolicyType", params, optFns, c.addOperationDisablePolicyTypeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisablePolicyTypeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisablePolicyTypeInput struct { - - // The policy type that you want to disable in this root. You can specify one of - // the following values: - // - // [SERVICE_CONTROL_POLICY] - // - // [RESOURCE_CONTROL_POLICY] - // - // [DECLARATIVE_POLICY_EC2] - // - // [BACKUP_POLICY] - // - // [TAG_POLICY] - // - // [CHATBOT_POLICY] - // - // [AISERVICES_OPT_OUT_POLICY] - // - // [SECURITYHUB_POLICY] - // - // [UPGRADE_ROLLOUT_POLICY] - // - // [INSPECTOR_POLICY] - // - // [BEDROCK_POLICY] - // - // [S3_POLICY] - // - // [NETWORK_SECURITY_DIRECTOR_POLICY] - // - // [BEDROCK_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_bedrock.html - // [NETWORK_SECURITY_DIRECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_network_security_director.html - // [UPGRADE_ROLLOUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_upgrade_rollout.html - // [BACKUP_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html - // [CHATBOT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_chatbot.html - // [TAG_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html - // [INSPECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_inspector.html - // [S3_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_s3.html - // [RESOURCE_CONTROL_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_rcps.html - // [AISERVICES_OPT_OUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html - // [SECURITYHUB_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_security_hub.html - // [SERVICE_CONTROL_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html - // [DECLARATIVE_POLICY_EC2]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_declarative.html - // - // This member is required. - PolicyType types.PolicyType - - // ID for the root in which you want to disable a policy type. You can get the ID - // from the ListRootsoperation. - // - // The [regex pattern] for a root ID string requires "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - RootId *string - - noSmithyDocumentSerde -} - -type DisablePolicyTypeOutput struct { - - // A structure that shows the root with the updated list of enabled policy types. - Root *types.Root - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisablePolicyTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisablePolicyType{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisablePolicyType{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisablePolicyType"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpDisablePolicyTypeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisablePolicyType(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisablePolicyType(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisablePolicyType", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_EnableAWSServiceAccess.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_EnableAWSServiceAccess.go deleted file mode 100644 index 64d693170b..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_EnableAWSServiceAccess.go +++ /dev/null @@ -1,172 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Provides an Amazon Web Services service (the service that is specified by -// ServicePrincipal ) with permissions to view the structure of an organization, -// create a [service-linked role]in all the accounts in the organization, and allow the service to -// perform operations on behalf of the organization and its accounts. Establishing -// these permissions can be a first step in enabling the integration of an Amazon -// Web Services service with Organizations. -// -// We recommend that you enable integration between Organizations and the -// specified Amazon Web Services service by using the console or commands that are -// provided by the specified service. Doing so ensures that the service is aware -// that it can create the resources that are required for the integration. How the -// service creates those resources in the organization's accounts depends on that -// service. For more information, see the documentation for the other Amazon Web -// Services service. -// -// For more information about enabling services to integrate with Organizations, -// see [Using Organizations with other Amazon Web Services services]in the Organizations User Guide. -// -// You can only call this operation from the management account. -// -// [Using Organizations with other Amazon Web Services services]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html -// [service-linked role]: https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html -func (c *Client) EnableAWSServiceAccess(ctx context.Context, params *EnableAWSServiceAccessInput, optFns ...func(*Options)) (*EnableAWSServiceAccessOutput, error) { - if params == nil { - params = &EnableAWSServiceAccessInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableAWSServiceAccess", params, optFns, c.addOperationEnableAWSServiceAccessMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableAWSServiceAccessOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableAWSServiceAccessInput struct { - - // The service principal name of the Amazon Web Services service for which you - // want to enable integration with your organization. This is typically in the form - // of a URL, such as service-abbreviation.amazonaws.com . - // - // This member is required. - ServicePrincipal *string - - noSmithyDocumentSerde -} - -type EnableAWSServiceAccessOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableAWSServiceAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpEnableAWSServiceAccess{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpEnableAWSServiceAccess{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableAWSServiceAccess"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpEnableAWSServiceAccessValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableAWSServiceAccess(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableAWSServiceAccess(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableAWSServiceAccess", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_EnableAllFeatures.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_EnableAllFeatures.go deleted file mode 100644 index ab3b564ab2..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_EnableAllFeatures.go +++ /dev/null @@ -1,176 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Enables all features in an organization. This enables the use of organization -// policies that can restrict the services and actions that can be called in each -// account. Until you enable all features, you have access only to consolidated -// billing, and you can't use any of the advanced account administration features -// that Organizations supports. For more information, see [Enabling all features in your organization]in the Organizations -// User Guide. -// -// This operation is required only for organizations that were created explicitly -// with only the consolidated billing features enabled. Calling this operation -// sends a handshake to every invited account in the organization. The feature set -// change can be finalized and the additional features enabled only after all -// administrators in the invited accounts approve the change by accepting the -// handshake. -// -// After you enable all features, you can separately enable or disable individual -// policy types in a root using EnablePolicyTypeand DisablePolicyType. To see the status of policy types in a root, -// use ListRoots. -// -// After all invited member accounts accept the handshake, you finalize the -// feature set change by accepting the handshake that contains "Action": -// "ENABLE_ALL_FEATURES" . This completes the change. -// -// After you enable all features in your organization, the management account in -// the organization can apply policies on all member accounts. These policies can -// restrict what users and even administrators in those accounts can do. The -// management account can apply policies that prevent accounts from leaving the -// organization. Ensure that your account administrators are aware of this. -// -// You can only call this operation from the management account. -// -// [Enabling all features in your organization]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html -func (c *Client) EnableAllFeatures(ctx context.Context, params *EnableAllFeaturesInput, optFns ...func(*Options)) (*EnableAllFeaturesOutput, error) { - if params == nil { - params = &EnableAllFeaturesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnableAllFeatures", params, optFns, c.addOperationEnableAllFeaturesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnableAllFeaturesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnableAllFeaturesInput struct { - noSmithyDocumentSerde -} - -type EnableAllFeaturesOutput struct { - - // A structure that contains details about the handshake created to support this - // request to enable all features in the organization. - Handshake *types.Handshake - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnableAllFeaturesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpEnableAllFeatures{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpEnableAllFeatures{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnableAllFeatures"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableAllFeatures(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnableAllFeatures(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnableAllFeatures", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_EnablePolicyType.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_EnablePolicyType.go deleted file mode 100644 index 35316bfeb0..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_EnablePolicyType.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Enables a policy type in a root. After you enable a policy type in a root, you -// can attach policies of that type to the root, any organizational unit (OU), or -// account in that root. You can undo this by using the DisablePolicyTypeoperation. -// -// This is an asynchronous request that Amazon Web Services performs in the -// background. Amazon Web Services recommends that you first use ListRootsto see the status -// of policy types for a specified root, and then use this operation. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -// -// You can enable a policy type in a root only if that policy type is available in -// the organization. To view the status of available policy types in the -// organization, use ListRoots. -func (c *Client) EnablePolicyType(ctx context.Context, params *EnablePolicyTypeInput, optFns ...func(*Options)) (*EnablePolicyTypeOutput, error) { - if params == nil { - params = &EnablePolicyTypeInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "EnablePolicyType", params, optFns, c.addOperationEnablePolicyTypeMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*EnablePolicyTypeOutput) - out.ResultMetadata = metadata - return out, nil -} - -type EnablePolicyTypeInput struct { - - // The policy type that you want to enable. You can specify one of the following - // values: - // - // [SERVICE_CONTROL_POLICY] - // - // [RESOURCE_CONTROL_POLICY] - // - // [DECLARATIVE_POLICY_EC2] - // - // [BACKUP_POLICY] - // - // [TAG_POLICY] - // - // [CHATBOT_POLICY] - // - // [AISERVICES_OPT_OUT_POLICY] - // - // [SECURITYHUB_POLICY] - // - // [UPGRADE_ROLLOUT_POLICY] - // - // [INSPECTOR_POLICY] - // - // [BEDROCK_POLICY] - // - // [S3_POLICY] - // - // [NETWORK_SECURITY_DIRECTOR_POLICY] - // - // [BEDROCK_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_bedrock.html - // [NETWORK_SECURITY_DIRECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_network_security_director.html - // [UPGRADE_ROLLOUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_upgrade_rollout.html - // [BACKUP_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html - // [CHATBOT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_chatbot.html - // [TAG_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html - // [INSPECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_inspector.html - // [S3_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_s3.html - // [RESOURCE_CONTROL_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_rcps.html - // [AISERVICES_OPT_OUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html - // [SECURITYHUB_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_security_hub.html - // [SERVICE_CONTROL_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html - // [DECLARATIVE_POLICY_EC2]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_declarative.html - // - // This member is required. - PolicyType types.PolicyType - - // ID for the root in which you want to enable a policy type. You can get the ID - // from the ListRootsoperation. - // - // The [regex pattern] for a root ID string requires "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - RootId *string - - noSmithyDocumentSerde -} - -type EnablePolicyTypeOutput struct { - - // A structure that shows the root with the updated list of enabled policy types. - Root *types.Root - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationEnablePolicyTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpEnablePolicyType{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpEnablePolicyType{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "EnablePolicyType"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpEnablePolicyTypeValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnablePolicyType(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opEnablePolicyType(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "EnablePolicyType", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_InviteAccountToOrganization.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_InviteAccountToOrganization.go deleted file mode 100644 index b4cd9136f2..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_InviteAccountToOrganization.go +++ /dev/null @@ -1,208 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Sends an invitation to another account to join your organization as a member -// account. Organizations sends email on your behalf to the email address that is -// associated with the other account's owner. The invitation is implemented as a Handshake -// whose details are in the response. -// -// If you receive an exception that indicates that you exceeded your account -// limits for the organization or that the operation failed because your -// organization is still initializing, wait one hour and then try again. If the -// error persists after an hour, contact [Amazon Web Services Support]. -// -// If the request includes tags, then the requester must have the -// organizations:TagResource permission. -// -// You can only call this operation from the management account. -// -// [Amazon Web Services Support]: https://console.aws.amazon.com/support/home#/ -func (c *Client) InviteAccountToOrganization(ctx context.Context, params *InviteAccountToOrganizationInput, optFns ...func(*Options)) (*InviteAccountToOrganizationOutput, error) { - if params == nil { - params = &InviteAccountToOrganizationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "InviteAccountToOrganization", params, optFns, c.addOperationInviteAccountToOrganizationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*InviteAccountToOrganizationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type InviteAccountToOrganizationInput struct { - - // The identifier (ID) of the Amazon Web Services account that you want to invite - // to join your organization. This is a JSON object that contains the following - // elements: - // - // { "Type": "ACCOUNT", "Id": "< account id number >" } - // - // If you use the CLI, you can submit this as a single string, similar to the - // following example: - // - // --target Id=123456789012,Type=ACCOUNT - // - // If you specify "Type": "ACCOUNT" , you must provide the Amazon Web Services - // account ID number as the Id . If you specify "Type": "EMAIL" , you must specify - // the email address that is associated with the account. - // - // --target Id=diego@example.com,Type=EMAIL - // - // This member is required. - Target *types.HandshakeParty - - // Additional information that you want to include in the generated email to the - // recipient account owner. - Notes *string - - // A list of tags that you want to attach to the account when it becomes a member - // of the organization. For each tag in the list, you must specify both a tag key - // and a value. You can set the value to an empty string, but you can't set it to - // null . For more information about tagging, see [Tagging Organizations resources] in the Organizations User Guide. - // - // Any tags in the request are checked for compliance with any applicable tag - // policies when the request is made. The request is rejected if the tags in the - // request don't match the requirements of the policy at that time. Tag policy - // compliance is not checked again when the invitation is accepted and the tags are - // actually attached to the account. That means that if the tag policy changes - // between the invitation and the acceptance, then that tags could potentially be - // non-compliant. - // - // If any one of the tags is not valid or if you exceed the allowed number of tags - // for an account, then the entire request fails and invitations are not sent. - // - // [Tagging Organizations resources]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html - Tags []types.Tag - - noSmithyDocumentSerde -} - -type InviteAccountToOrganizationOutput struct { - - // A structure that contains details about the handshake that is created to - // support this invitation request. - Handshake *types.Handshake - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationInviteAccountToOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpInviteAccountToOrganization{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpInviteAccountToOrganization{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "InviteAccountToOrganization"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpInviteAccountToOrganizationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opInviteAccountToOrganization(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opInviteAccountToOrganization(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "InviteAccountToOrganization", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_InviteOrganizationToTransferResponsibility.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_InviteOrganizationToTransferResponsibility.go deleted file mode 100644 index 6a665cc61c..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_InviteOrganizationToTransferResponsibility.go +++ /dev/null @@ -1,202 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Sends an invitation to another organization's management account to designate -// your account with the specified responsibilities for their organization. The -// invitation is implemented as a Handshakewhose details are in the response. -// -// You can only call this operation from the management account. -func (c *Client) InviteOrganizationToTransferResponsibility(ctx context.Context, params *InviteOrganizationToTransferResponsibilityInput, optFns ...func(*Options)) (*InviteOrganizationToTransferResponsibilityOutput, error) { - if params == nil { - params = &InviteOrganizationToTransferResponsibilityInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "InviteOrganizationToTransferResponsibility", params, optFns, c.addOperationInviteOrganizationToTransferResponsibilityMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*InviteOrganizationToTransferResponsibilityOutput) - out.ResultMetadata = metadata - return out, nil -} - -type InviteOrganizationToTransferResponsibilityInput struct { - - // Name you want to assign to the transfer. - // - // This member is required. - SourceName *string - - // Timestamp when the recipient will begin managing the specified responsibilities. - // - // This member is required. - StartTimestamp *time.Time - - // A HandshakeParty object. Contains details for the account you want to invite. - // Currently, only ACCOUNT and EMAIL are supported. - // - // This member is required. - Target *types.HandshakeParty - - // The type of responsibility you want to designate to your organization. - // Currently, only BILLING is supported. - // - // This member is required. - Type types.ResponsibilityTransferType - - // Additional information that you want to include in the invitation. - Notes *string - - // A list of tags that you want to attach to the transfer. For each tag in the - // list, you must specify both a tag key and a value. You can set the value to an - // empty string, but you can't set it to null . For more information about tagging, - // see [Tagging Organizations resources]in the Organizations User Guide. - // - // Any tags in the request are checked for compliance with any applicable tag - // policies when the request is made. The request is rejected if the tags in the - // request don't match the requirements of the policy at that time. Tag policy - // compliance is not checked again when the invitation is accepted and the tags are - // actually attached to the transfer. That means that if the tag policy changes - // between the invitation and the acceptance, then that tags could potentially be - // non-compliant. - // - // If any one of the tags is not valid or if you exceed the allowed number of tags - // for a transfer, then the entire request fails and invitations are not sent. - // - // [Tagging Organizations resources]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html - Tags []types.Tag - - noSmithyDocumentSerde -} - -type InviteOrganizationToTransferResponsibilityOutput struct { - - // Contains details for a handshake. A handshake is the secure exchange of - // information between two Amazon Web Services accounts: a sender and a recipient. - // - // Note: Handshakes that are CANCELED , ACCEPTED , DECLINED , or EXPIRED show up - // in lists for only 30 days after entering that state After that they are deleted. - Handshake *types.Handshake - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationInviteOrganizationToTransferResponsibilityMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpInviteOrganizationToTransferResponsibility{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpInviteOrganizationToTransferResponsibility{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "InviteOrganizationToTransferResponsibility"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpInviteOrganizationToTransferResponsibilityValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opInviteOrganizationToTransferResponsibility(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opInviteOrganizationToTransferResponsibility(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "InviteOrganizationToTransferResponsibility", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_LeaveOrganization.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_LeaveOrganization.go deleted file mode 100644 index 7bb389a39b..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_LeaveOrganization.go +++ /dev/null @@ -1,188 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Removes a member account from its parent organization. This version of the -// operation is performed by the account that wants to leave. To remove a member -// account as a user in the management account, use RemoveAccountFromOrganizationinstead. -// -// You can only call from operation from a member account. -// -// - The management account in an organization with all features enabled can set -// service control policies (SCPs) that can restrict what administrators of member -// accounts can do. This includes preventing them from successfully calling -// LeaveOrganization and leaving the organization. -// -// - You can leave an organization as a member account only if the account is -// configured with the information required to operate as a standalone account. -// When you create an account in an organization using the Organizations console, -// API, or CLI commands, the information required of standalone accounts is not -// automatically collected. For each account that you want to make standalone, you -// must perform the following steps. If any of the steps are already completed for -// this account, that step doesn't appear. -// -// - Choose a support plan -// -// - Provide and verify the required contact information -// -// - Provide a current payment method -// -// Amazon Web Services uses the payment method to charge for any billable (not -// -// free tier) Amazon Web Services activity that occurs while the account isn't -// attached to an organization. For more information, see [Considerations before removing an account from an organization]in the Organizations -// User Guide. -// -// - The account that you want to leave must not be a delegated administrator -// account for any Amazon Web Services service enabled for your organization. If -// the account is a delegated administrator, you must first change the delegated -// administrator account to another account that is remaining in the organization. -// -// - After the account leaves the organization, all tags that were attached to -// the account object in the organization are deleted. Amazon Web Services accounts -// outside of an organization do not support tags. -// -// - A newly created account has a waiting period before it can be removed from -// its organization. You must wait until at least four days after the account was -// created. Invited accounts aren't subject to this waiting period. -// -// - If you are using an organization principal to call LeaveOrganization across -// multiple accounts, you can only do this up to 5 accounts per second in a single -// organization. -// -// [Considerations before removing an account from an organization]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_account-before-remove.html -func (c *Client) LeaveOrganization(ctx context.Context, params *LeaveOrganizationInput, optFns ...func(*Options)) (*LeaveOrganizationOutput, error) { - if params == nil { - params = &LeaveOrganizationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "LeaveOrganization", params, optFns, c.addOperationLeaveOrganizationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*LeaveOrganizationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type LeaveOrganizationInput struct { - noSmithyDocumentSerde -} - -type LeaveOrganizationOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationLeaveOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpLeaveOrganization{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpLeaveOrganization{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "LeaveOrganization"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opLeaveOrganization(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opLeaveOrganization(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "LeaveOrganization", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListAWSServiceAccessForOrganization.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListAWSServiceAccessForOrganization.go deleted file mode 100644 index ac33275e3f..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListAWSServiceAccessForOrganization.go +++ /dev/null @@ -1,275 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Returns a list of the Amazon Web Services services that you enabled to -// integrate with your organization. After a service on this list creates the -// resources that it requires for the integration, it can perform operations on -// your organization and its accounts. -// -// For more information about integrating other services with Organizations, -// including the list of services that currently work with Organizations, see [Using Organizations with other Amazon Web Services services]in -// the Organizations User Guide. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -// -// [Using Organizations with other Amazon Web Services services]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html -func (c *Client) ListAWSServiceAccessForOrganization(ctx context.Context, params *ListAWSServiceAccessForOrganizationInput, optFns ...func(*Options)) (*ListAWSServiceAccessForOrganizationOutput, error) { - if params == nil { - params = &ListAWSServiceAccessForOrganizationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListAWSServiceAccessForOrganization", params, optFns, c.addOperationListAWSServiceAccessForOrganizationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListAWSServiceAccessForOrganizationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListAWSServiceAccessForOrganizationInput struct { - - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - MaxResults *int32 - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more output - // is available. Set this parameter to the value of the previous call's NextToken - // response to indicate where the output should continue from. - NextToken *string - - noSmithyDocumentSerde -} - -type ListAWSServiceAccessForOrganizationOutput struct { - - // A list of the service principals for the services that are enabled to integrate - // with your organization. Each principal is a structure that includes the name and - // the date that it was enabled for integration with Organizations. - EnabledServicePrincipals []types.EnabledServicePrincipal - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You should - // repeat this until the NextToken response element comes back as null . - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListAWSServiceAccessForOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAWSServiceAccessForOrganization{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAWSServiceAccessForOrganization{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListAWSServiceAccessForOrganization"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAWSServiceAccessForOrganization(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListAWSServiceAccessForOrganizationPaginatorOptions is the paginator options -// for ListAWSServiceAccessForOrganization -type ListAWSServiceAccessForOrganizationPaginatorOptions struct { - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListAWSServiceAccessForOrganizationPaginator is a paginator for -// ListAWSServiceAccessForOrganization -type ListAWSServiceAccessForOrganizationPaginator struct { - options ListAWSServiceAccessForOrganizationPaginatorOptions - client ListAWSServiceAccessForOrganizationAPIClient - params *ListAWSServiceAccessForOrganizationInput - nextToken *string - firstPage bool -} - -// NewListAWSServiceAccessForOrganizationPaginator returns a new -// ListAWSServiceAccessForOrganizationPaginator -func NewListAWSServiceAccessForOrganizationPaginator(client ListAWSServiceAccessForOrganizationAPIClient, params *ListAWSServiceAccessForOrganizationInput, optFns ...func(*ListAWSServiceAccessForOrganizationPaginatorOptions)) *ListAWSServiceAccessForOrganizationPaginator { - if params == nil { - params = &ListAWSServiceAccessForOrganizationInput{} - } - - options := ListAWSServiceAccessForOrganizationPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListAWSServiceAccessForOrganizationPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListAWSServiceAccessForOrganizationPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListAWSServiceAccessForOrganization page. -func (p *ListAWSServiceAccessForOrganizationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAWSServiceAccessForOrganizationOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListAWSServiceAccessForOrganization(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListAWSServiceAccessForOrganizationAPIClient is a client that implements the -// ListAWSServiceAccessForOrganization operation. -type ListAWSServiceAccessForOrganizationAPIClient interface { - ListAWSServiceAccessForOrganization(context.Context, *ListAWSServiceAccessForOrganizationInput, ...func(*Options)) (*ListAWSServiceAccessForOrganizationOutput, error) -} - -var _ ListAWSServiceAccessForOrganizationAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListAWSServiceAccessForOrganization(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListAWSServiceAccessForOrganization", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListAccounts.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListAccounts.go deleted file mode 100644 index bda180a5aa..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListAccounts.go +++ /dev/null @@ -1,273 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists all the accounts in the organization. To request only the accounts in a -// specified root or organizational unit (OU), use the ListAccountsForParentoperation instead. -// -// When calling List* operations, always check the NextToken response parameter -// value, even if you receive an empty result set. These operations can -// occasionally return an empty set of results even when more results are -// available. Continue making requests until NextToken returns null. A null -// NextToken value indicates that you have retrieved all available results. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -func (c *Client) ListAccounts(ctx context.Context, params *ListAccountsInput, optFns ...func(*Options)) (*ListAccountsOutput, error) { - if params == nil { - params = &ListAccountsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListAccounts", params, optFns, c.addOperationListAccountsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListAccountsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListAccountsInput struct { - - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - MaxResults *int32 - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more output - // is available. Set this parameter to the value of the previous call's NextToken - // response to indicate where the output should continue from. - NextToken *string - - noSmithyDocumentSerde -} - -type ListAccountsOutput struct { - - // A list of objects in the organization. - // - // The Status parameter in the API response will be retired on September 9, 2026. - // Although both the account State and account Status parameters are currently - // available in the Organizations APIs ( DescribeAccount , ListAccounts , - // ListAccountsForParent ), we recommend that you update your scripts or other code - // to use the State parameter instead of Status before September 9, 2026. - Accounts []types.Account - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You should - // repeat this until the NextToken response element comes back as null . - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListAccountsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAccounts{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAccounts{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListAccounts"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccounts(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListAccountsPaginatorOptions is the paginator options for ListAccounts -type ListAccountsPaginatorOptions struct { - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListAccountsPaginator is a paginator for ListAccounts -type ListAccountsPaginator struct { - options ListAccountsPaginatorOptions - client ListAccountsAPIClient - params *ListAccountsInput - nextToken *string - firstPage bool -} - -// NewListAccountsPaginator returns a new ListAccountsPaginator -func NewListAccountsPaginator(client ListAccountsAPIClient, params *ListAccountsInput, optFns ...func(*ListAccountsPaginatorOptions)) *ListAccountsPaginator { - if params == nil { - params = &ListAccountsInput{} - } - - options := ListAccountsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListAccountsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListAccountsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListAccounts page. -func (p *ListAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListAccounts(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListAccountsAPIClient is a client that implements the ListAccounts operation. -type ListAccountsAPIClient interface { - ListAccounts(context.Context, *ListAccountsInput, ...func(*Options)) (*ListAccountsOutput, error) -} - -var _ ListAccountsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListAccounts(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListAccounts", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListAccountsForParent.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListAccountsForParent.go deleted file mode 100644 index ec43362bf4..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListAccountsForParent.go +++ /dev/null @@ -1,287 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the accounts in an organization that are contained by the specified -// target root or organizational unit (OU). If you specify the root, you get a list -// of all the accounts that aren't in any OU. If you specify an OU, you get a list -// of all the accounts in only that OU and not in any child OUs. To get a list of -// all accounts in the organization, use the ListAccountsoperation. -// -// When calling List* operations, always check the NextToken response parameter -// value, even if you receive an empty result set. These operations can -// occasionally return an empty set of results even when more results are -// available. Continue making requests until NextToken returns null. A null -// NextToken value indicates that you have retrieved all available results. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -func (c *Client) ListAccountsForParent(ctx context.Context, params *ListAccountsForParentInput, optFns ...func(*Options)) (*ListAccountsForParentOutput, error) { - if params == nil { - params = &ListAccountsForParentInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListAccountsForParent", params, optFns, c.addOperationListAccountsForParentMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListAccountsForParentOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListAccountsForParentInput struct { - - // The unique identifier (ID) for the parent root or organization unit (OU) whose - // accounts you want to list. - // - // This member is required. - ParentId *string - - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - MaxResults *int32 - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more output - // is available. Set this parameter to the value of the previous call's NextToken - // response to indicate where the output should continue from. - NextToken *string - - noSmithyDocumentSerde -} - -type ListAccountsForParentOutput struct { - - // A list of the accounts in the specified root or OU. - // - // The Status parameter in the API response will be retired on September 9, 2026. - // Although both the account State and account Status parameters are currently - // available in the Organizations APIs ( DescribeAccount , ListAccounts , - // ListAccountsForParent ), we recommend that you update your scripts or other code - // to use the State parameter instead of Status before September 9, 2026. - Accounts []types.Account - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You should - // repeat this until the NextToken response element comes back as null . - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListAccountsForParentMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAccountsForParent{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAccountsForParent{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListAccountsForParent"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListAccountsForParentValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccountsForParent(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListAccountsForParentPaginatorOptions is the paginator options for -// ListAccountsForParent -type ListAccountsForParentPaginatorOptions struct { - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListAccountsForParentPaginator is a paginator for ListAccountsForParent -type ListAccountsForParentPaginator struct { - options ListAccountsForParentPaginatorOptions - client ListAccountsForParentAPIClient - params *ListAccountsForParentInput - nextToken *string - firstPage bool -} - -// NewListAccountsForParentPaginator returns a new ListAccountsForParentPaginator -func NewListAccountsForParentPaginator(client ListAccountsForParentAPIClient, params *ListAccountsForParentInput, optFns ...func(*ListAccountsForParentPaginatorOptions)) *ListAccountsForParentPaginator { - if params == nil { - params = &ListAccountsForParentInput{} - } - - options := ListAccountsForParentPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListAccountsForParentPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListAccountsForParentPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListAccountsForParent page. -func (p *ListAccountsForParentPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountsForParentOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListAccountsForParent(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListAccountsForParentAPIClient is a client that implements the -// ListAccountsForParent operation. -type ListAccountsForParentAPIClient interface { - ListAccountsForParent(context.Context, *ListAccountsForParentInput, ...func(*Options)) (*ListAccountsForParentOutput, error) -} - -var _ ListAccountsForParentAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListAccountsForParent(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListAccountsForParent", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListAccountsWithInvalidEffectivePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListAccountsWithInvalidEffectivePolicy.go deleted file mode 100644 index 04060a0e5d..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListAccountsWithInvalidEffectivePolicy.go +++ /dev/null @@ -1,350 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists all the accounts in an organization that have invalid effective policies. -// An invalid effective policy is an [effective policy]that fails validation checks, resulting in -// the effective policy not being fully enforced on all the intended accounts -// within an organization. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -// -// [effective policy]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_effective.html -func (c *Client) ListAccountsWithInvalidEffectivePolicy(ctx context.Context, params *ListAccountsWithInvalidEffectivePolicyInput, optFns ...func(*Options)) (*ListAccountsWithInvalidEffectivePolicyOutput, error) { - if params == nil { - params = &ListAccountsWithInvalidEffectivePolicyInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListAccountsWithInvalidEffectivePolicy", params, optFns, c.addOperationListAccountsWithInvalidEffectivePolicyMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListAccountsWithInvalidEffectivePolicyOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListAccountsWithInvalidEffectivePolicyInput struct { - - // The type of policy that you want information about. You can specify one of the - // following values: - // - // [DECLARATIVE_POLICY_EC2] - // - // [BACKUP_POLICY] - // - // [TAG_POLICY] - // - // [CHATBOT_POLICY] - // - // [AISERVICES_OPT_OUT_POLICY] - // - // [SECURITYHUB_POLICY] - // - // [UPGRADE_ROLLOUT_POLICY] - // - // [INSPECTOR_POLICY] - // - // [BEDROCK_POLICY] - // - // [S3_POLICY] - // - // [NETWORK_SECURITY_DIRECTOR_POLICY] - // - // [AISERVICES_OPT_OUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html - // [BEDROCK_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_bedrock.html - // [NETWORK_SECURITY_DIRECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_network_security_director.html - // [UPGRADE_ROLLOUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_upgrade_rollout.html - // [SECURITYHUB_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_security_hub.html - // [BACKUP_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html - // [CHATBOT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_chatbot.html - // [TAG_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html - // [DECLARATIVE_POLICY_EC2]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_declarative.html - // [INSPECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_inspector.html - // [S3_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_s3.html - // - // This member is required. - PolicyType types.EffectivePolicyType - - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - MaxResults *int32 - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more output - // is available. Set this parameter to the value of the previous call's NextToken - // response to indicate where the output should continue from. - NextToken *string - - noSmithyDocumentSerde -} - -type ListAccountsWithInvalidEffectivePolicyOutput struct { - - // The accounts in the organization which have an invalid effective policy for the - // specified policy type. - Accounts []types.Account - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You should - // repeat this until the NextToken response element comes back as null . - NextToken *string - - // The specified policy type. One of the following values: - // - // [DECLARATIVE_POLICY_EC2] - // - // [BACKUP_POLICY] - // - // [TAG_POLICY] - // - // [CHATBOT_POLICY] - // - // [AISERVICES_OPT_OUT_POLICY] - // - // [SECURITYHUB_POLICY] - // - // [UPGRADE_ROLLOUT_POLICY] - // - // [INSPECTOR_POLICY] - // - // [BEDROCK_POLICY] - // - // [S3_POLICY] - // - // [NETWORK_SECURITY_DIRECTOR_POLICY] - // - // [AISERVICES_OPT_OUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html - // [BEDROCK_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_bedrock.html - // [NETWORK_SECURITY_DIRECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_network_security_director.html - // [UPGRADE_ROLLOUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_upgrade_rollout.html - // [SECURITYHUB_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_security_hub.html - // [BACKUP_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html - // [CHATBOT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_chatbot.html - // [TAG_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html - // [DECLARATIVE_POLICY_EC2]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_declarative.html - // [INSPECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_inspector.html - // [S3_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_s3.html - PolicyType types.EffectivePolicyType - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListAccountsWithInvalidEffectivePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAccountsWithInvalidEffectivePolicy{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAccountsWithInvalidEffectivePolicy{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListAccountsWithInvalidEffectivePolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListAccountsWithInvalidEffectivePolicyValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccountsWithInvalidEffectivePolicy(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListAccountsWithInvalidEffectivePolicyPaginatorOptions is the paginator options -// for ListAccountsWithInvalidEffectivePolicy -type ListAccountsWithInvalidEffectivePolicyPaginatorOptions struct { - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListAccountsWithInvalidEffectivePolicyPaginator is a paginator for -// ListAccountsWithInvalidEffectivePolicy -type ListAccountsWithInvalidEffectivePolicyPaginator struct { - options ListAccountsWithInvalidEffectivePolicyPaginatorOptions - client ListAccountsWithInvalidEffectivePolicyAPIClient - params *ListAccountsWithInvalidEffectivePolicyInput - nextToken *string - firstPage bool -} - -// NewListAccountsWithInvalidEffectivePolicyPaginator returns a new -// ListAccountsWithInvalidEffectivePolicyPaginator -func NewListAccountsWithInvalidEffectivePolicyPaginator(client ListAccountsWithInvalidEffectivePolicyAPIClient, params *ListAccountsWithInvalidEffectivePolicyInput, optFns ...func(*ListAccountsWithInvalidEffectivePolicyPaginatorOptions)) *ListAccountsWithInvalidEffectivePolicyPaginator { - if params == nil { - params = &ListAccountsWithInvalidEffectivePolicyInput{} - } - - options := ListAccountsWithInvalidEffectivePolicyPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListAccountsWithInvalidEffectivePolicyPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListAccountsWithInvalidEffectivePolicyPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListAccountsWithInvalidEffectivePolicy page. -func (p *ListAccountsWithInvalidEffectivePolicyPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAccountsWithInvalidEffectivePolicyOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListAccountsWithInvalidEffectivePolicy(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListAccountsWithInvalidEffectivePolicyAPIClient is a client that implements the -// ListAccountsWithInvalidEffectivePolicy operation. -type ListAccountsWithInvalidEffectivePolicyAPIClient interface { - ListAccountsWithInvalidEffectivePolicy(context.Context, *ListAccountsWithInvalidEffectivePolicyInput, ...func(*Options)) (*ListAccountsWithInvalidEffectivePolicyOutput, error) -} - -var _ ListAccountsWithInvalidEffectivePolicyAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListAccountsWithInvalidEffectivePolicy(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListAccountsWithInvalidEffectivePolicy", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListChildren.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListChildren.go deleted file mode 100644 index 0418ff2ffc..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListChildren.go +++ /dev/null @@ -1,294 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists all of the organizational units (OUs) or accounts that are contained in -// the specified parent OU or root. This operation, along with ListParentsenables you to -// traverse the tree structure that makes up this root. -// -// When calling List* operations, always check the NextToken response parameter -// value, even if you receive an empty result set. These operations can -// occasionally return an empty set of results even when more results are -// available. Continue making requests until NextToken returns null. A null -// NextToken value indicates that you have retrieved all available results. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -func (c *Client) ListChildren(ctx context.Context, params *ListChildrenInput, optFns ...func(*Options)) (*ListChildrenOutput, error) { - if params == nil { - params = &ListChildrenInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListChildren", params, optFns, c.addOperationListChildrenMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListChildrenOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListChildrenInput struct { - - // Filters the output to include only the specified child type. - // - // This member is required. - ChildType types.ChildType - - // The unique identifier (ID) for the parent root or OU whose children you want to - // list. - // - // The [regex pattern] for a parent ID string requires one of the following: - // - // - Root - A string that begins with "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // - Organizational unit (OU) - A string that begins with "ou-" followed by from - // 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This - // string is followed by a second "-" dash and from 8 to 32 additional lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - ParentId *string - - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - MaxResults *int32 - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more output - // is available. Set this parameter to the value of the previous call's NextToken - // response to indicate where the output should continue from. - NextToken *string - - noSmithyDocumentSerde -} - -type ListChildrenOutput struct { - - // The list of children of the specified parent container. - Children []types.Child - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You should - // repeat this until the NextToken response element comes back as null . - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListChildrenMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListChildren{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListChildren{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListChildren"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListChildrenValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListChildren(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListChildrenPaginatorOptions is the paginator options for ListChildren -type ListChildrenPaginatorOptions struct { - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListChildrenPaginator is a paginator for ListChildren -type ListChildrenPaginator struct { - options ListChildrenPaginatorOptions - client ListChildrenAPIClient - params *ListChildrenInput - nextToken *string - firstPage bool -} - -// NewListChildrenPaginator returns a new ListChildrenPaginator -func NewListChildrenPaginator(client ListChildrenAPIClient, params *ListChildrenInput, optFns ...func(*ListChildrenPaginatorOptions)) *ListChildrenPaginator { - if params == nil { - params = &ListChildrenInput{} - } - - options := ListChildrenPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListChildrenPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListChildrenPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListChildren page. -func (p *ListChildrenPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChildrenOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListChildren(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListChildrenAPIClient is a client that implements the ListChildren operation. -type ListChildrenAPIClient interface { - ListChildren(context.Context, *ListChildrenInput, ...func(*Options)) (*ListChildrenOutput, error) -} - -var _ ListChildrenAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListChildren(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListChildren", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListCreateAccountStatus.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListCreateAccountStatus.go deleted file mode 100644 index 1014940936..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListCreateAccountStatus.go +++ /dev/null @@ -1,276 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the account creation requests that match the specified status that is -// currently being tracked for the organization. -// -// When calling List* operations, always check the NextToken response parameter -// value, even if you receive an empty result set. These operations can -// occasionally return an empty set of results even when more results are -// available. Continue making requests until NextToken returns null. A null -// NextToken value indicates that you have retrieved all available results. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -func (c *Client) ListCreateAccountStatus(ctx context.Context, params *ListCreateAccountStatusInput, optFns ...func(*Options)) (*ListCreateAccountStatusOutput, error) { - if params == nil { - params = &ListCreateAccountStatusInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListCreateAccountStatus", params, optFns, c.addOperationListCreateAccountStatusMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListCreateAccountStatusOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListCreateAccountStatusInput struct { - - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - MaxResults *int32 - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more output - // is available. Set this parameter to the value of the previous call's NextToken - // response to indicate where the output should continue from. - NextToken *string - - // A list of one or more states that you want included in the response. If this - // parameter isn't present, all requests are included in the response. - States []types.CreateAccountState - - noSmithyDocumentSerde -} - -type ListCreateAccountStatusOutput struct { - - // A list of objects with details about the requests. Certain elements, such as - // the accountId number, are present in the output only after the account has been - // successfully created. - CreateAccountStatuses []types.CreateAccountStatus - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You should - // repeat this until the NextToken response element comes back as null . - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListCreateAccountStatusMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListCreateAccountStatus{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListCreateAccountStatus{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListCreateAccountStatus"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCreateAccountStatus(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListCreateAccountStatusPaginatorOptions is the paginator options for -// ListCreateAccountStatus -type ListCreateAccountStatusPaginatorOptions struct { - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListCreateAccountStatusPaginator is a paginator for ListCreateAccountStatus -type ListCreateAccountStatusPaginator struct { - options ListCreateAccountStatusPaginatorOptions - client ListCreateAccountStatusAPIClient - params *ListCreateAccountStatusInput - nextToken *string - firstPage bool -} - -// NewListCreateAccountStatusPaginator returns a new -// ListCreateAccountStatusPaginator -func NewListCreateAccountStatusPaginator(client ListCreateAccountStatusAPIClient, params *ListCreateAccountStatusInput, optFns ...func(*ListCreateAccountStatusPaginatorOptions)) *ListCreateAccountStatusPaginator { - if params == nil { - params = &ListCreateAccountStatusInput{} - } - - options := ListCreateAccountStatusPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListCreateAccountStatusPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListCreateAccountStatusPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListCreateAccountStatus page. -func (p *ListCreateAccountStatusPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCreateAccountStatusOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListCreateAccountStatus(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListCreateAccountStatusAPIClient is a client that implements the -// ListCreateAccountStatus operation. -type ListCreateAccountStatusAPIClient interface { - ListCreateAccountStatus(context.Context, *ListCreateAccountStatusInput, ...func(*Options)) (*ListCreateAccountStatusOutput, error) -} - -var _ ListCreateAccountStatusAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListCreateAccountStatus(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListCreateAccountStatus", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListDelegatedAdministrators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListDelegatedAdministrators.go deleted file mode 100644 index e48f90969c..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListDelegatedAdministrators.go +++ /dev/null @@ -1,272 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the Amazon Web Services accounts that are designated as delegated -// administrators in this organization. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -func (c *Client) ListDelegatedAdministrators(ctx context.Context, params *ListDelegatedAdministratorsInput, optFns ...func(*Options)) (*ListDelegatedAdministratorsOutput, error) { - if params == nil { - params = &ListDelegatedAdministratorsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListDelegatedAdministrators", params, optFns, c.addOperationListDelegatedAdministratorsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListDelegatedAdministratorsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListDelegatedAdministratorsInput struct { - - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - MaxResults *int32 - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more output - // is available. Set this parameter to the value of the previous call's NextToken - // response to indicate where the output should continue from. - NextToken *string - - // Specifies a service principal name. If specified, then the operation lists the - // delegated administrators only for the specified service. - // - // If you don't specify a service principal, the operation lists all delegated - // administrators for all services in your organization. - ServicePrincipal *string - - noSmithyDocumentSerde -} - -type ListDelegatedAdministratorsOutput struct { - - // The list of delegated administrators in your organization. - DelegatedAdministrators []types.DelegatedAdministrator - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You should - // repeat this until the NextToken response element comes back as null . - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListDelegatedAdministratorsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListDelegatedAdministrators{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListDelegatedAdministrators{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListDelegatedAdministrators"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDelegatedAdministrators(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListDelegatedAdministratorsPaginatorOptions is the paginator options for -// ListDelegatedAdministrators -type ListDelegatedAdministratorsPaginatorOptions struct { - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListDelegatedAdministratorsPaginator is a paginator for -// ListDelegatedAdministrators -type ListDelegatedAdministratorsPaginator struct { - options ListDelegatedAdministratorsPaginatorOptions - client ListDelegatedAdministratorsAPIClient - params *ListDelegatedAdministratorsInput - nextToken *string - firstPage bool -} - -// NewListDelegatedAdministratorsPaginator returns a new -// ListDelegatedAdministratorsPaginator -func NewListDelegatedAdministratorsPaginator(client ListDelegatedAdministratorsAPIClient, params *ListDelegatedAdministratorsInput, optFns ...func(*ListDelegatedAdministratorsPaginatorOptions)) *ListDelegatedAdministratorsPaginator { - if params == nil { - params = &ListDelegatedAdministratorsInput{} - } - - options := ListDelegatedAdministratorsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListDelegatedAdministratorsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListDelegatedAdministratorsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListDelegatedAdministrators page. -func (p *ListDelegatedAdministratorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDelegatedAdministratorsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListDelegatedAdministrators(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListDelegatedAdministratorsAPIClient is a client that implements the -// ListDelegatedAdministrators operation. -type ListDelegatedAdministratorsAPIClient interface { - ListDelegatedAdministrators(context.Context, *ListDelegatedAdministratorsInput, ...func(*Options)) (*ListDelegatedAdministratorsOutput, error) -} - -var _ ListDelegatedAdministratorsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListDelegatedAdministrators(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListDelegatedAdministrators", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListDelegatedServicesForAccount.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListDelegatedServicesForAccount.go deleted file mode 100644 index 052bb92aa2..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListDelegatedServicesForAccount.go +++ /dev/null @@ -1,273 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// List the Amazon Web Services services for which the specified account is a -// delegated administrator. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -func (c *Client) ListDelegatedServicesForAccount(ctx context.Context, params *ListDelegatedServicesForAccountInput, optFns ...func(*Options)) (*ListDelegatedServicesForAccountOutput, error) { - if params == nil { - params = &ListDelegatedServicesForAccountInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListDelegatedServicesForAccount", params, optFns, c.addOperationListDelegatedServicesForAccountMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListDelegatedServicesForAccountOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListDelegatedServicesForAccountInput struct { - - // The account ID number of a delegated administrator account in the organization. - // - // This member is required. - AccountId *string - - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - MaxResults *int32 - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more output - // is available. Set this parameter to the value of the previous call's NextToken - // response to indicate where the output should continue from. - NextToken *string - - noSmithyDocumentSerde -} - -type ListDelegatedServicesForAccountOutput struct { - - // The services for which the account is a delegated administrator. - DelegatedServices []types.DelegatedService - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You should - // repeat this until the NextToken response element comes back as null . - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListDelegatedServicesForAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListDelegatedServicesForAccount{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListDelegatedServicesForAccount{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListDelegatedServicesForAccount"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListDelegatedServicesForAccountValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDelegatedServicesForAccount(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListDelegatedServicesForAccountPaginatorOptions is the paginator options for -// ListDelegatedServicesForAccount -type ListDelegatedServicesForAccountPaginatorOptions struct { - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListDelegatedServicesForAccountPaginator is a paginator for -// ListDelegatedServicesForAccount -type ListDelegatedServicesForAccountPaginator struct { - options ListDelegatedServicesForAccountPaginatorOptions - client ListDelegatedServicesForAccountAPIClient - params *ListDelegatedServicesForAccountInput - nextToken *string - firstPage bool -} - -// NewListDelegatedServicesForAccountPaginator returns a new -// ListDelegatedServicesForAccountPaginator -func NewListDelegatedServicesForAccountPaginator(client ListDelegatedServicesForAccountAPIClient, params *ListDelegatedServicesForAccountInput, optFns ...func(*ListDelegatedServicesForAccountPaginatorOptions)) *ListDelegatedServicesForAccountPaginator { - if params == nil { - params = &ListDelegatedServicesForAccountInput{} - } - - options := ListDelegatedServicesForAccountPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListDelegatedServicesForAccountPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListDelegatedServicesForAccountPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListDelegatedServicesForAccount page. -func (p *ListDelegatedServicesForAccountPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDelegatedServicesForAccountOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListDelegatedServicesForAccount(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListDelegatedServicesForAccountAPIClient is a client that implements the -// ListDelegatedServicesForAccount operation. -type ListDelegatedServicesForAccountAPIClient interface { - ListDelegatedServicesForAccount(context.Context, *ListDelegatedServicesForAccountInput, ...func(*Options)) (*ListDelegatedServicesForAccountOutput, error) -} - -var _ ListDelegatedServicesForAccountAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListDelegatedServicesForAccount(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListDelegatedServicesForAccount", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListEffectivePolicyValidationErrors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListEffectivePolicyValidationErrors.go deleted file mode 100644 index 57b06d98d6..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListEffectivePolicyValidationErrors.go +++ /dev/null @@ -1,365 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Lists all the validation errors on an [effective policy] for a specified account and policy type. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -// -// [effective policy]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_effective.html -func (c *Client) ListEffectivePolicyValidationErrors(ctx context.Context, params *ListEffectivePolicyValidationErrorsInput, optFns ...func(*Options)) (*ListEffectivePolicyValidationErrorsOutput, error) { - if params == nil { - params = &ListEffectivePolicyValidationErrorsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListEffectivePolicyValidationErrors", params, optFns, c.addOperationListEffectivePolicyValidationErrorsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListEffectivePolicyValidationErrorsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListEffectivePolicyValidationErrorsInput struct { - - // The ID of the account that you want details about. Specifying an organization - // root or organizational unit (OU) as the target is not supported. - // - // This member is required. - AccountId *string - - // The type of policy that you want information about. You can specify one of the - // following values: - // - // [DECLARATIVE_POLICY_EC2] - // - // [BACKUP_POLICY] - // - // [TAG_POLICY] - // - // [CHATBOT_POLICY] - // - // [AISERVICES_OPT_OUT_POLICY] - // - // [SECURITYHUB_POLICY] - // - // [UPGRADE_ROLLOUT_POLICY] - // - // [INSPECTOR_POLICY] - // - // [BEDROCK_POLICY] - // - // [S3_POLICY] - // - // [NETWORK_SECURITY_DIRECTOR_POLICY] - // - // [AISERVICES_OPT_OUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html - // [BEDROCK_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_bedrock.html - // [NETWORK_SECURITY_DIRECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_network_security_director.html - // [UPGRADE_ROLLOUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_upgrade_rollout.html - // [SECURITYHUB_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_security_hub.html - // [BACKUP_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html - // [CHATBOT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_chatbot.html - // [TAG_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html - // [DECLARATIVE_POLICY_EC2]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_declarative.html - // [INSPECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_inspector.html - // [S3_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_s3.html - // - // This member is required. - PolicyType types.EffectivePolicyType - - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - MaxResults *int32 - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more output - // is available. Set this parameter to the value of the previous call's NextToken - // response to indicate where the output should continue from. - NextToken *string - - noSmithyDocumentSerde -} - -type ListEffectivePolicyValidationErrorsOutput struct { - - // The ID of the specified account. - AccountId *string - - // The EffectivePolicyValidationError object contains details about the validation - // errors that occurred when generating or enforcing an effective policy, such as - // which policies contributed to the error and location of the error. - EffectivePolicyValidationErrors []types.EffectivePolicyValidationError - - // The time when the latest effective policy was generated for the specified - // account. - EvaluationTimestamp *time.Time - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You should - // repeat this until the NextToken response element comes back as null . - NextToken *string - - // The path in the organization where the specified account exists. - Path *string - - // The specified policy type. One of the following values: - // - // [DECLARATIVE_POLICY_EC2] - // - // [BACKUP_POLICY] - // - // [TAG_POLICY] - // - // [CHATBOT_POLICY] - // - // [AISERVICES_OPT_OUT_POLICY] - // - // [SECURITYHUB_POLICY] - // - // [UPGRADE_ROLLOUT_POLICY] - // - // [INSPECTOR_POLICY] - // - // [BEDROCK_POLICY] - // - // [S3_POLICY] - // - // [NETWORK_SECURITY_DIRECTOR_POLICY] - // - // [AISERVICES_OPT_OUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html - // [BEDROCK_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_bedrock.html - // [NETWORK_SECURITY_DIRECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_network_security_director.html - // [UPGRADE_ROLLOUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_upgrade_rollout.html - // [SECURITYHUB_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_security_hub.html - // [BACKUP_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html - // [CHATBOT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_chatbot.html - // [TAG_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html - // [DECLARATIVE_POLICY_EC2]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_declarative.html - // [INSPECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_inspector.html - // [S3_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_s3.html - PolicyType types.EffectivePolicyType - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListEffectivePolicyValidationErrorsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListEffectivePolicyValidationErrors{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListEffectivePolicyValidationErrors{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListEffectivePolicyValidationErrors"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListEffectivePolicyValidationErrorsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListEffectivePolicyValidationErrors(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListEffectivePolicyValidationErrorsPaginatorOptions is the paginator options -// for ListEffectivePolicyValidationErrors -type ListEffectivePolicyValidationErrorsPaginatorOptions struct { - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListEffectivePolicyValidationErrorsPaginator is a paginator for -// ListEffectivePolicyValidationErrors -type ListEffectivePolicyValidationErrorsPaginator struct { - options ListEffectivePolicyValidationErrorsPaginatorOptions - client ListEffectivePolicyValidationErrorsAPIClient - params *ListEffectivePolicyValidationErrorsInput - nextToken *string - firstPage bool -} - -// NewListEffectivePolicyValidationErrorsPaginator returns a new -// ListEffectivePolicyValidationErrorsPaginator -func NewListEffectivePolicyValidationErrorsPaginator(client ListEffectivePolicyValidationErrorsAPIClient, params *ListEffectivePolicyValidationErrorsInput, optFns ...func(*ListEffectivePolicyValidationErrorsPaginatorOptions)) *ListEffectivePolicyValidationErrorsPaginator { - if params == nil { - params = &ListEffectivePolicyValidationErrorsInput{} - } - - options := ListEffectivePolicyValidationErrorsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListEffectivePolicyValidationErrorsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListEffectivePolicyValidationErrorsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListEffectivePolicyValidationErrors page. -func (p *ListEffectivePolicyValidationErrorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEffectivePolicyValidationErrorsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListEffectivePolicyValidationErrors(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListEffectivePolicyValidationErrorsAPIClient is a client that implements the -// ListEffectivePolicyValidationErrors operation. -type ListEffectivePolicyValidationErrorsAPIClient interface { - ListEffectivePolicyValidationErrors(context.Context, *ListEffectivePolicyValidationErrorsInput, ...func(*Options)) (*ListEffectivePolicyValidationErrorsOutput, error) -} - -var _ ListEffectivePolicyValidationErrorsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListEffectivePolicyValidationErrors(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListEffectivePolicyValidationErrors", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListHandshakesForAccount.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListHandshakesForAccount.go deleted file mode 100644 index 01a6317b8d..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListHandshakesForAccount.go +++ /dev/null @@ -1,275 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the recent handshakes that you have received. -// -// You can view CANCELED , ACCEPTED , DECLINED , or EXPIRED handshakes in API -// responses for 30 days before they are deleted. -// -// You can call this operation from any account in a organization. -// -// When calling List* operations, always check the NextToken response parameter -// value, even if you receive an empty result set. These operations can -// occasionally return an empty set of results even when more results are -// available. Continue making requests until NextToken returns null. A null -// NextToken value indicates that you have retrieved all available results. -func (c *Client) ListHandshakesForAccount(ctx context.Context, params *ListHandshakesForAccountInput, optFns ...func(*Options)) (*ListHandshakesForAccountOutput, error) { - if params == nil { - params = &ListHandshakesForAccountInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListHandshakesForAccount", params, optFns, c.addOperationListHandshakesForAccountMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListHandshakesForAccountOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListHandshakesForAccountInput struct { - - // A HandshakeFilter object. Contains the filer used to select the handshakes for - // an operation. - Filter *types.HandshakeFilter - - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - MaxResults *int32 - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more output - // is available. Set this parameter to the value of the previous call's NextToken - // response to indicate where the output should continue from. - NextToken *string - - noSmithyDocumentSerde -} - -type ListHandshakesForAccountOutput struct { - - // An array of Handshake objects. Contains details for a handshake. - Handshakes []types.Handshake - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You should - // repeat this until the NextToken response element comes back as null . - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListHandshakesForAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListHandshakesForAccount{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListHandshakesForAccount{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListHandshakesForAccount"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListHandshakesForAccount(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListHandshakesForAccountPaginatorOptions is the paginator options for -// ListHandshakesForAccount -type ListHandshakesForAccountPaginatorOptions struct { - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListHandshakesForAccountPaginator is a paginator for ListHandshakesForAccount -type ListHandshakesForAccountPaginator struct { - options ListHandshakesForAccountPaginatorOptions - client ListHandshakesForAccountAPIClient - params *ListHandshakesForAccountInput - nextToken *string - firstPage bool -} - -// NewListHandshakesForAccountPaginator returns a new -// ListHandshakesForAccountPaginator -func NewListHandshakesForAccountPaginator(client ListHandshakesForAccountAPIClient, params *ListHandshakesForAccountInput, optFns ...func(*ListHandshakesForAccountPaginatorOptions)) *ListHandshakesForAccountPaginator { - if params == nil { - params = &ListHandshakesForAccountInput{} - } - - options := ListHandshakesForAccountPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListHandshakesForAccountPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListHandshakesForAccountPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListHandshakesForAccount page. -func (p *ListHandshakesForAccountPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHandshakesForAccountOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListHandshakesForAccount(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListHandshakesForAccountAPIClient is a client that implements the -// ListHandshakesForAccount operation. -type ListHandshakesForAccountAPIClient interface { - ListHandshakesForAccount(context.Context, *ListHandshakesForAccountInput, ...func(*Options)) (*ListHandshakesForAccountOutput, error) -} - -var _ ListHandshakesForAccountAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListHandshakesForAccount(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListHandshakesForAccount", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListHandshakesForOrganization.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListHandshakesForOrganization.go deleted file mode 100644 index 5bfcceff23..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListHandshakesForOrganization.go +++ /dev/null @@ -1,277 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the recent handshakes that you have sent. -// -// You can view CANCELED , ACCEPTED , DECLINED , or EXPIRED handshakes in API -// responses for 30 days before they are deleted. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -// -// When calling List* operations, always check the NextToken response parameter -// value, even if you receive an empty result set. These operations can -// occasionally return an empty set of results even when more results are -// available. Continue making requests until NextToken returns null. A null -// NextToken value indicates that you have retrieved all available results. -func (c *Client) ListHandshakesForOrganization(ctx context.Context, params *ListHandshakesForOrganizationInput, optFns ...func(*Options)) (*ListHandshakesForOrganizationOutput, error) { - if params == nil { - params = &ListHandshakesForOrganizationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListHandshakesForOrganization", params, optFns, c.addOperationListHandshakesForOrganizationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListHandshakesForOrganizationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListHandshakesForOrganizationInput struct { - - // A HandshakeFilter object. Contains the filer used to select the handshakes for - // an operation. - Filter *types.HandshakeFilter - - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - MaxResults *int32 - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more output - // is available. Set this parameter to the value of the previous call's NextToken - // response to indicate where the output should continue from. - NextToken *string - - noSmithyDocumentSerde -} - -type ListHandshakesForOrganizationOutput struct { - - // An array of Handshake objects. Contains details for a handshake. - Handshakes []types.Handshake - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You should - // repeat this until the NextToken response element comes back as null . - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListHandshakesForOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListHandshakesForOrganization{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListHandshakesForOrganization{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListHandshakesForOrganization"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListHandshakesForOrganization(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListHandshakesForOrganizationPaginatorOptions is the paginator options for -// ListHandshakesForOrganization -type ListHandshakesForOrganizationPaginatorOptions struct { - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListHandshakesForOrganizationPaginator is a paginator for -// ListHandshakesForOrganization -type ListHandshakesForOrganizationPaginator struct { - options ListHandshakesForOrganizationPaginatorOptions - client ListHandshakesForOrganizationAPIClient - params *ListHandshakesForOrganizationInput - nextToken *string - firstPage bool -} - -// NewListHandshakesForOrganizationPaginator returns a new -// ListHandshakesForOrganizationPaginator -func NewListHandshakesForOrganizationPaginator(client ListHandshakesForOrganizationAPIClient, params *ListHandshakesForOrganizationInput, optFns ...func(*ListHandshakesForOrganizationPaginatorOptions)) *ListHandshakesForOrganizationPaginator { - if params == nil { - params = &ListHandshakesForOrganizationInput{} - } - - options := ListHandshakesForOrganizationPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListHandshakesForOrganizationPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListHandshakesForOrganizationPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListHandshakesForOrganization page. -func (p *ListHandshakesForOrganizationPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListHandshakesForOrganizationOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListHandshakesForOrganization(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListHandshakesForOrganizationAPIClient is a client that implements the -// ListHandshakesForOrganization operation. -type ListHandshakesForOrganizationAPIClient interface { - ListHandshakesForOrganization(context.Context, *ListHandshakesForOrganizationInput, ...func(*Options)) (*ListHandshakesForOrganizationOutput, error) -} - -var _ ListHandshakesForOrganizationAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListHandshakesForOrganization(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListHandshakesForOrganization", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListInboundResponsibilityTransfers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListInboundResponsibilityTransfers.go deleted file mode 100644 index e1d8dd3fb8..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListInboundResponsibilityTransfers.go +++ /dev/null @@ -1,182 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists transfers that allow you to manage the specified responsibilities for -// another organization. This operation returns both transfer invitations and -// transfers. -// -// When calling List* operations, always check the NextToken response parameter -// value, even if you receive an empty result set. These operations can -// occasionally return an empty set of results even when more results are -// available. Continue making requests until NextToken returns null. A null -// NextToken value indicates that you have retrieved all available results. -func (c *Client) ListInboundResponsibilityTransfers(ctx context.Context, params *ListInboundResponsibilityTransfersInput, optFns ...func(*Options)) (*ListInboundResponsibilityTransfersOutput, error) { - if params == nil { - params = &ListInboundResponsibilityTransfersInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListInboundResponsibilityTransfers", params, optFns, c.addOperationListInboundResponsibilityTransfersMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListInboundResponsibilityTransfersOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListInboundResponsibilityTransfersInput struct { - - // The type of responsibility. Currently, only BILLING is supported. - // - // This member is required. - Type types.ResponsibilityTransferType - - // ID for the transfer. - Id *string - - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - MaxResults *int32 - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more output - // is available. Set this parameter to the value of the previous call's NextToken - // response to indicate where the output should continue from. - NextToken *string - - noSmithyDocumentSerde -} - -type ListInboundResponsibilityTransfersOutput struct { - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You should - // repeat this until the NextToken response element comes back as null . - NextToken *string - - // A ResponsibilityTransfers object. Contains details for a transfer. - ResponsibilityTransfers []types.ResponsibilityTransfer - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListInboundResponsibilityTransfersMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListInboundResponsibilityTransfers{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListInboundResponsibilityTransfers{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListInboundResponsibilityTransfers"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListInboundResponsibilityTransfersValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListInboundResponsibilityTransfers(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opListInboundResponsibilityTransfers(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListInboundResponsibilityTransfers", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListOrganizationalUnitsForParent.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListOrganizationalUnitsForParent.go deleted file mode 100644 index 806890fd05..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListOrganizationalUnitsForParent.go +++ /dev/null @@ -1,290 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the organizational units (OUs) in a parent organizational unit or root. -// -// When calling List* operations, always check the NextToken response parameter -// value, even if you receive an empty result set. These operations can -// occasionally return an empty set of results even when more results are -// available. Continue making requests until NextToken returns null. A null -// NextToken value indicates that you have retrieved all available results. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -func (c *Client) ListOrganizationalUnitsForParent(ctx context.Context, params *ListOrganizationalUnitsForParentInput, optFns ...func(*Options)) (*ListOrganizationalUnitsForParentOutput, error) { - if params == nil { - params = &ListOrganizationalUnitsForParentInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListOrganizationalUnitsForParent", params, optFns, c.addOperationListOrganizationalUnitsForParentMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListOrganizationalUnitsForParentOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListOrganizationalUnitsForParentInput struct { - - // ID for the root or OU whose child OUs you want to list. - // - // The [regex pattern] for a parent ID string requires one of the following: - // - // - Root - A string that begins with "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // - Organizational unit (OU) - A string that begins with "ou-" followed by from - // 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This - // string is followed by a second "-" dash and from 8 to 32 additional lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - ParentId *string - - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - MaxResults *int32 - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more output - // is available. Set this parameter to the value of the previous call's NextToken - // response to indicate where the output should continue from. - NextToken *string - - noSmithyDocumentSerde -} - -type ListOrganizationalUnitsForParentOutput struct { - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You should - // repeat this until the NextToken response element comes back as null . - NextToken *string - - // A list of the OUs in the specified root or parent OU. - OrganizationalUnits []types.OrganizationalUnit - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListOrganizationalUnitsForParentMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListOrganizationalUnitsForParent{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListOrganizationalUnitsForParent{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListOrganizationalUnitsForParent"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListOrganizationalUnitsForParentValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListOrganizationalUnitsForParent(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListOrganizationalUnitsForParentPaginatorOptions is the paginator options for -// ListOrganizationalUnitsForParent -type ListOrganizationalUnitsForParentPaginatorOptions struct { - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListOrganizationalUnitsForParentPaginator is a paginator for -// ListOrganizationalUnitsForParent -type ListOrganizationalUnitsForParentPaginator struct { - options ListOrganizationalUnitsForParentPaginatorOptions - client ListOrganizationalUnitsForParentAPIClient - params *ListOrganizationalUnitsForParentInput - nextToken *string - firstPage bool -} - -// NewListOrganizationalUnitsForParentPaginator returns a new -// ListOrganizationalUnitsForParentPaginator -func NewListOrganizationalUnitsForParentPaginator(client ListOrganizationalUnitsForParentAPIClient, params *ListOrganizationalUnitsForParentInput, optFns ...func(*ListOrganizationalUnitsForParentPaginatorOptions)) *ListOrganizationalUnitsForParentPaginator { - if params == nil { - params = &ListOrganizationalUnitsForParentInput{} - } - - options := ListOrganizationalUnitsForParentPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListOrganizationalUnitsForParentPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListOrganizationalUnitsForParentPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListOrganizationalUnitsForParent page. -func (p *ListOrganizationalUnitsForParentPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOrganizationalUnitsForParentOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListOrganizationalUnitsForParent(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListOrganizationalUnitsForParentAPIClient is a client that implements the -// ListOrganizationalUnitsForParent operation. -type ListOrganizationalUnitsForParentAPIClient interface { - ListOrganizationalUnitsForParent(context.Context, *ListOrganizationalUnitsForParentInput, ...func(*Options)) (*ListOrganizationalUnitsForParentOutput, error) -} - -var _ ListOrganizationalUnitsForParentAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListOrganizationalUnitsForParent(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListOrganizationalUnitsForParent", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListOutboundResponsibilityTransfers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListOutboundResponsibilityTransfers.go deleted file mode 100644 index 46b07c98b5..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListOutboundResponsibilityTransfers.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists transfers that allow an account outside your organization to manage the -// specified responsibilities for your organization. This operation returns both -// transfer invitations and transfers. -// -// When calling List* operations, always check the NextToken response parameter -// value, even if you receive an empty result set. These operations can -// occasionally return an empty set of results even when more results are -// available. Continue making requests until NextToken returns null. A null -// NextToken value indicates that you have retrieved all available results. -func (c *Client) ListOutboundResponsibilityTransfers(ctx context.Context, params *ListOutboundResponsibilityTransfersInput, optFns ...func(*Options)) (*ListOutboundResponsibilityTransfersOutput, error) { - if params == nil { - params = &ListOutboundResponsibilityTransfersInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListOutboundResponsibilityTransfers", params, optFns, c.addOperationListOutboundResponsibilityTransfersMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListOutboundResponsibilityTransfersOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListOutboundResponsibilityTransfersInput struct { - - // The type of responsibility. Currently, only BILLING is supported. - // - // This member is required. - Type types.ResponsibilityTransferType - - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - MaxResults *int32 - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more output - // is available. Set this parameter to the value of the previous call's NextToken - // response to indicate where the output should continue from. - NextToken *string - - noSmithyDocumentSerde -} - -type ListOutboundResponsibilityTransfersOutput struct { - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You should - // repeat this until the NextToken response element comes back as null . - NextToken *string - - // An array of ResponsibilityTransfer objects. Contains details for a transfer. - ResponsibilityTransfers []types.ResponsibilityTransfer - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListOutboundResponsibilityTransfersMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListOutboundResponsibilityTransfers{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListOutboundResponsibilityTransfers{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListOutboundResponsibilityTransfers"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListOutboundResponsibilityTransfersValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListOutboundResponsibilityTransfers(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opListOutboundResponsibilityTransfers(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListOutboundResponsibilityTransfers", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListParents.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListParents.go deleted file mode 100644 index e34ad1d67a..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListParents.go +++ /dev/null @@ -1,290 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the root or organizational units (OUs) that serve as the immediate parent -// of the specified child OU or account. This operation, along with ListChildrenenables you to -// traverse the tree structure that makes up this root. -// -// When calling List* operations, always check the NextToken response parameter -// value, even if you receive an empty result set. These operations can -// occasionally return an empty set of results even when more results are -// available. Continue making requests until NextToken returns null. A null -// NextToken value indicates that you have retrieved all available results. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -// -// In the current release, a child can have only a single parent. -func (c *Client) ListParents(ctx context.Context, params *ListParentsInput, optFns ...func(*Options)) (*ListParentsOutput, error) { - if params == nil { - params = &ListParentsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListParents", params, optFns, c.addOperationListParentsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListParentsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListParentsInput struct { - - // ID for the OU or account whose parent containers you want to list. Don't - // specify a root. - // - // The [regex pattern] for a child ID string requires one of the following: - // - // - Account - A string that consists of exactly 12 digits. - // - // - Organizational unit (OU) - A string that begins with "ou-" followed by from - // 4 to 32 lowercase letters or digits (the ID of the root that contains the OU). - // This string is followed by a second "-" dash and from 8 to 32 additional - // lowercase letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - ChildId *string - - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - MaxResults *int32 - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more output - // is available. Set this parameter to the value of the previous call's NextToken - // response to indicate where the output should continue from. - NextToken *string - - noSmithyDocumentSerde -} - -type ListParentsOutput struct { - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You should - // repeat this until the NextToken response element comes back as null . - NextToken *string - - // A list of parents for the specified child account or OU. - Parents []types.Parent - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListParentsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListParents{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListParents{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListParents"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListParentsValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListParents(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListParentsPaginatorOptions is the paginator options for ListParents -type ListParentsPaginatorOptions struct { - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListParentsPaginator is a paginator for ListParents -type ListParentsPaginator struct { - options ListParentsPaginatorOptions - client ListParentsAPIClient - params *ListParentsInput - nextToken *string - firstPage bool -} - -// NewListParentsPaginator returns a new ListParentsPaginator -func NewListParentsPaginator(client ListParentsAPIClient, params *ListParentsInput, optFns ...func(*ListParentsPaginatorOptions)) *ListParentsPaginator { - if params == nil { - params = &ListParentsInput{} - } - - options := ListParentsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListParentsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListParentsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListParents page. -func (p *ListParentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListParentsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListParents(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListParentsAPIClient is a client that implements the ListParents operation. -type ListParentsAPIClient interface { - ListParents(context.Context, *ListParentsInput, ...func(*Options)) (*ListParentsOutput, error) -} - -var _ ListParentsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListParents(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListParents", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListPolicies.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListPolicies.go deleted file mode 100644 index 426fb2fad1..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListPolicies.go +++ /dev/null @@ -1,316 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Retrieves the list of all policies in an organization of a specified type. -// -// When calling List* operations, always check the NextToken response parameter -// value, even if you receive an empty result set. These operations can -// occasionally return an empty set of results even when more results are -// available. Continue making requests until NextToken returns null. A null -// NextToken value indicates that you have retrieved all available results. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -func (c *Client) ListPolicies(ctx context.Context, params *ListPoliciesInput, optFns ...func(*Options)) (*ListPoliciesOutput, error) { - if params == nil { - params = &ListPoliciesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListPolicies", params, optFns, c.addOperationListPoliciesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListPoliciesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListPoliciesInput struct { - - // Specifies the type of policy that you want to include in the response. You must - // specify one of the following values: - // - // [SERVICE_CONTROL_POLICY] - // - // [RESOURCE_CONTROL_POLICY] - // - // [DECLARATIVE_POLICY_EC2] - // - // [BACKUP_POLICY] - // - // [TAG_POLICY] - // - // [CHATBOT_POLICY] - // - // [AISERVICES_OPT_OUT_POLICY] - // - // [SECURITYHUB_POLICY] - // - // [UPGRADE_ROLLOUT_POLICY] - // - // [INSPECTOR_POLICY] - // - // [BEDROCK_POLICY] - // - // [S3_POLICY] - // - // [NETWORK_SECURITY_DIRECTOR_POLICY] - // - // [BEDROCK_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_bedrock.html - // [NETWORK_SECURITY_DIRECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_network_security_director.html - // [UPGRADE_ROLLOUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_upgrade_rollout.html - // [BACKUP_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html - // [CHATBOT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_chatbot.html - // [TAG_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html - // [INSPECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_inspector.html - // [S3_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_s3.html - // [RESOURCE_CONTROL_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_rcps.html - // [AISERVICES_OPT_OUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html - // [SECURITYHUB_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_security_hub.html - // [SERVICE_CONTROL_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html - // [DECLARATIVE_POLICY_EC2]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_declarative.html - // - // This member is required. - Filter types.PolicyType - - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - MaxResults *int32 - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more output - // is available. Set this parameter to the value of the previous call's NextToken - // response to indicate where the output should continue from. - NextToken *string - - noSmithyDocumentSerde -} - -type ListPoliciesOutput struct { - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You should - // repeat this until the NextToken response element comes back as null . - NextToken *string - - // A list of policies that match the filter criteria in the request. The output - // list doesn't include the policy contents. To see the content for a policy, see DescribePolicy. - Policies []types.PolicySummary - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListPolicies{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListPolicies{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListPolicies"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListPoliciesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPolicies(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListPoliciesPaginatorOptions is the paginator options for ListPolicies -type ListPoliciesPaginatorOptions struct { - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListPoliciesPaginator is a paginator for ListPolicies -type ListPoliciesPaginator struct { - options ListPoliciesPaginatorOptions - client ListPoliciesAPIClient - params *ListPoliciesInput - nextToken *string - firstPage bool -} - -// NewListPoliciesPaginator returns a new ListPoliciesPaginator -func NewListPoliciesPaginator(client ListPoliciesAPIClient, params *ListPoliciesInput, optFns ...func(*ListPoliciesPaginatorOptions)) *ListPoliciesPaginator { - if params == nil { - params = &ListPoliciesInput{} - } - - options := ListPoliciesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListPoliciesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListPoliciesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListPolicies page. -func (p *ListPoliciesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPoliciesOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListPolicies(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListPoliciesAPIClient is a client that implements the ListPolicies operation. -type ListPoliciesAPIClient interface { - ListPolicies(context.Context, *ListPoliciesInput, ...func(*Options)) (*ListPoliciesOutput, error) -} - -var _ ListPoliciesAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListPolicies(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListPolicies", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListPoliciesForTarget.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListPoliciesForTarget.go deleted file mode 100644 index ad9e4c52af..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListPoliciesForTarget.go +++ /dev/null @@ -1,339 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the policies that are directly attached to the specified target root, -// organizational unit (OU), or account. You must specify the policy type that you -// want included in the returned list. -// -// When calling List* operations, always check the NextToken response parameter -// value, even if you receive an empty result set. These operations can -// occasionally return an empty set of results even when more results are -// available. Continue making requests until NextToken returns null. A null -// NextToken value indicates that you have retrieved all available results. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -func (c *Client) ListPoliciesForTarget(ctx context.Context, params *ListPoliciesForTargetInput, optFns ...func(*Options)) (*ListPoliciesForTargetOutput, error) { - if params == nil { - params = &ListPoliciesForTargetInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListPoliciesForTarget", params, optFns, c.addOperationListPoliciesForTargetMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListPoliciesForTargetOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListPoliciesForTargetInput struct { - - // The type of policy that you want to include in the returned list. You must - // specify one of the following values: - // - // [SERVICE_CONTROL_POLICY] - // - // [RESOURCE_CONTROL_POLICY] - // - // [DECLARATIVE_POLICY_EC2] - // - // [BACKUP_POLICY] - // - // [TAG_POLICY] - // - // [CHATBOT_POLICY] - // - // [AISERVICES_OPT_OUT_POLICY] - // - // [SECURITYHUB_POLICY] - // - // [UPGRADE_ROLLOUT_POLICY] - // - // [INSPECTOR_POLICY] - // - // [BEDROCK_POLICY] - // - // [S3_POLICY] - // - // [NETWORK_SECURITY_DIRECTOR_POLICY] - // - // [BEDROCK_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_bedrock.html - // [NETWORK_SECURITY_DIRECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_network_security_director.html - // [UPGRADE_ROLLOUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_upgrade_rollout.html - // [BACKUP_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html - // [CHATBOT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_chatbot.html - // [TAG_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html - // [INSPECTOR_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_inspector.html - // [S3_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_s3.html - // [RESOURCE_CONTROL_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_rcps.html - // [AISERVICES_OPT_OUT_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html - // [SECURITYHUB_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_security_hub.html - // [SERVICE_CONTROL_POLICY]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html - // [DECLARATIVE_POLICY_EC2]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_declarative.html - // - // This member is required. - Filter types.PolicyType - - // ID for the root, organizational unit, or account whose policies you want to - // list. - // - // The [regex pattern] for a target ID string requires one of the following: - // - // - Root - A string that begins with "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // - Account - A string that consists of exactly 12 digits. - // - // - Organizational unit (OU) - A string that begins with "ou-" followed by from - // 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This - // string is followed by a second "-" dash and from 8 to 32 additional lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - TargetId *string - - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - MaxResults *int32 - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more output - // is available. Set this parameter to the value of the previous call's NextToken - // response to indicate where the output should continue from. - NextToken *string - - noSmithyDocumentSerde -} - -type ListPoliciesForTargetOutput struct { - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You should - // repeat this until the NextToken response element comes back as null . - NextToken *string - - // The list of policies that match the criteria in the request. - Policies []types.PolicySummary - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListPoliciesForTargetMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListPoliciesForTarget{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListPoliciesForTarget{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListPoliciesForTarget"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListPoliciesForTargetValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPoliciesForTarget(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListPoliciesForTargetPaginatorOptions is the paginator options for -// ListPoliciesForTarget -type ListPoliciesForTargetPaginatorOptions struct { - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListPoliciesForTargetPaginator is a paginator for ListPoliciesForTarget -type ListPoliciesForTargetPaginator struct { - options ListPoliciesForTargetPaginatorOptions - client ListPoliciesForTargetAPIClient - params *ListPoliciesForTargetInput - nextToken *string - firstPage bool -} - -// NewListPoliciesForTargetPaginator returns a new ListPoliciesForTargetPaginator -func NewListPoliciesForTargetPaginator(client ListPoliciesForTargetAPIClient, params *ListPoliciesForTargetInput, optFns ...func(*ListPoliciesForTargetPaginatorOptions)) *ListPoliciesForTargetPaginator { - if params == nil { - params = &ListPoliciesForTargetInput{} - } - - options := ListPoliciesForTargetPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListPoliciesForTargetPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListPoliciesForTargetPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListPoliciesForTarget page. -func (p *ListPoliciesForTargetPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPoliciesForTargetOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListPoliciesForTarget(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListPoliciesForTargetAPIClient is a client that implements the -// ListPoliciesForTarget operation. -type ListPoliciesForTargetAPIClient interface { - ListPoliciesForTarget(context.Context, *ListPoliciesForTargetInput, ...func(*Options)) (*ListPoliciesForTargetOutput, error) -} - -var _ ListPoliciesForTargetAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListPoliciesForTarget(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListPoliciesForTarget", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListRoots.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListRoots.go deleted file mode 100644 index c88fb085de..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListRoots.go +++ /dev/null @@ -1,272 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists the roots that are defined in the current organization. -// -// When calling List* operations, always check the NextToken response parameter -// value, even if you receive an empty result set. These operations can -// occasionally return an empty set of results even when more results are -// available. Continue making requests until NextToken returns null. A null -// NextToken value indicates that you have retrieved all available results. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -// -// Policy types can be enabled and disabled in roots. This is distinct from -// whether they're available in the organization. When you enable all features, you -// make policy types available for use in that organization. Individual policy -// types can then be enabled and disabled in a root. To see the availability of a -// policy type in an organization, use DescribeOrganization. -func (c *Client) ListRoots(ctx context.Context, params *ListRootsInput, optFns ...func(*Options)) (*ListRootsOutput, error) { - if params == nil { - params = &ListRootsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListRoots", params, optFns, c.addOperationListRootsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListRootsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListRootsInput struct { - - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - MaxResults *int32 - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more output - // is available. Set this parameter to the value of the previous call's NextToken - // response to indicate where the output should continue from. - NextToken *string - - noSmithyDocumentSerde -} - -type ListRootsOutput struct { - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You should - // repeat this until the NextToken response element comes back as null . - NextToken *string - - // A list of roots that are defined in an organization. - Roots []types.Root - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListRootsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListRoots{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListRoots{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListRoots"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRoots(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListRootsPaginatorOptions is the paginator options for ListRoots -type ListRootsPaginatorOptions struct { - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListRootsPaginator is a paginator for ListRoots -type ListRootsPaginator struct { - options ListRootsPaginatorOptions - client ListRootsAPIClient - params *ListRootsInput - nextToken *string - firstPage bool -} - -// NewListRootsPaginator returns a new ListRootsPaginator -func NewListRootsPaginator(client ListRootsAPIClient, params *ListRootsInput, optFns ...func(*ListRootsPaginatorOptions)) *ListRootsPaginator { - if params == nil { - params = &ListRootsInput{} - } - - options := ListRootsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListRootsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListRootsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListRoots page. -func (p *ListRootsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRootsOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListRoots(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListRootsAPIClient is a client that implements the ListRoots operation. -type ListRootsAPIClient interface { - ListRoots(context.Context, *ListRootsInput, ...func(*Options)) (*ListRootsOutput, error) -} - -var _ ListRootsAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListRoots(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListRoots", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListTagsForResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListTagsForResource.go deleted file mode 100644 index 5ba1db0bae..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListTagsForResource.go +++ /dev/null @@ -1,273 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists tags that are attached to the specified resource. -// -// You can attach tags to the following resources in Organizations. -// -// - Amazon Web Services account -// -// - Organization root -// -// - Organizational unit (OU) -// -// - Policy (any type) -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { - if params == nil { - params = &ListTagsForResourceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListTagsForResourceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListTagsForResourceInput struct { - - // The ID of the resource with the tags to list. - // - // You can specify any of the following taggable resources. - // - // - Amazon Web Services account – specify the account ID number. - // - // - Organizational unit – specify the OU ID that begins with ou- and looks - // similar to: ou-1a2b-34uvwxyz - // - // - Root – specify the root ID that begins with r- and looks similar to: r-1a2b - // - // - Policy – specify the policy ID that begins with p- andlooks similar to: - // p-12abcdefg3 - // - // This member is required. - ResourceId *string - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more output - // is available. Set this parameter to the value of the previous call's NextToken - // response to indicate where the output should continue from. - NextToken *string - - noSmithyDocumentSerde -} - -type ListTagsForResourceOutput struct { - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You should - // repeat this until the NextToken response element comes back as null . - NextToken *string - - // The tags that are assigned to the resource. - Tags []types.Tag - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForResource{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListTagsForResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListTagsForResourcePaginatorOptions is the paginator options for -// ListTagsForResource -type ListTagsForResourcePaginatorOptions struct { - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListTagsForResourcePaginator is a paginator for ListTagsForResource -type ListTagsForResourcePaginator struct { - options ListTagsForResourcePaginatorOptions - client ListTagsForResourceAPIClient - params *ListTagsForResourceInput - nextToken *string - firstPage bool -} - -// NewListTagsForResourcePaginator returns a new ListTagsForResourcePaginator -func NewListTagsForResourcePaginator(client ListTagsForResourceAPIClient, params *ListTagsForResourceInput, optFns ...func(*ListTagsForResourcePaginatorOptions)) *ListTagsForResourcePaginator { - if params == nil { - params = &ListTagsForResourceInput{} - } - - options := ListTagsForResourcePaginatorOptions{} - - for _, fn := range optFns { - fn(&options) - } - - return &ListTagsForResourcePaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListTagsForResourcePaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListTagsForResource page. -func (p *ListTagsForResourcePaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListTagsForResource(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListTagsForResourceAPIClient is a client that implements the -// ListTagsForResource operation. -type ListTagsForResourceAPIClient interface { - ListTagsForResource(context.Context, *ListTagsForResourceInput, ...func(*Options)) (*ListTagsForResourceOutput, error) -} - -var _ ListTagsForResourceAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListTagsForResource", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListTargetsForPolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListTargetsForPolicy.go deleted file mode 100644 index c84e7b8f28..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_ListTargetsForPolicy.go +++ /dev/null @@ -1,283 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Lists all the roots, organizational units (OUs), and accounts that the -// specified policy is attached to. -// -// When calling List* operations, always check the NextToken response parameter -// value, even if you receive an empty result set. These operations can -// occasionally return an empty set of results even when more results are -// available. Continue making requests until NextToken returns null. A null -// NextToken value indicates that you have retrieved all available results. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -func (c *Client) ListTargetsForPolicy(ctx context.Context, params *ListTargetsForPolicyInput, optFns ...func(*Options)) (*ListTargetsForPolicyOutput, error) { - if params == nil { - params = &ListTargetsForPolicyInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListTargetsForPolicy", params, optFns, c.addOperationListTargetsForPolicyMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListTargetsForPolicyOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListTargetsForPolicyInput struct { - - // ID for the policy whose attachments you want to know. - // - // The [regex pattern] for a policy ID string requires "p-" followed by from 8 to 128 lowercase - // or uppercase letters, digits, or the underscore character (_). - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - PolicyId *string - - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - MaxResults *int32 - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more output - // is available. Set this parameter to the value of the previous call's NextToken - // response to indicate where the output should continue from. - NextToken *string - - noSmithyDocumentSerde -} - -type ListTargetsForPolicyOutput struct { - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You should - // repeat this until the NextToken response element comes back as null . - NextToken *string - - // A list of structures, each of which contains details about one of the entities - // to which the specified policy is attached. - Targets []types.PolicyTargetSummary - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListTargetsForPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTargetsForPolicy{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTargetsForPolicy{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListTargetsForPolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpListTargetsForPolicyValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTargetsForPolicy(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -// ListTargetsForPolicyPaginatorOptions is the paginator options for -// ListTargetsForPolicy -type ListTargetsForPolicyPaginatorOptions struct { - // The maximum number of items to return in the response. If more results exist - // than the specified MaxResults value, a token is included in the response so - // that you can retrieve the remaining results. - Limit int32 - - // Set to true if pagination should stop if the service returns a pagination token - // that matches the most recent token provided to the service. - StopOnDuplicateToken bool -} - -// ListTargetsForPolicyPaginator is a paginator for ListTargetsForPolicy -type ListTargetsForPolicyPaginator struct { - options ListTargetsForPolicyPaginatorOptions - client ListTargetsForPolicyAPIClient - params *ListTargetsForPolicyInput - nextToken *string - firstPage bool -} - -// NewListTargetsForPolicyPaginator returns a new ListTargetsForPolicyPaginator -func NewListTargetsForPolicyPaginator(client ListTargetsForPolicyAPIClient, params *ListTargetsForPolicyInput, optFns ...func(*ListTargetsForPolicyPaginatorOptions)) *ListTargetsForPolicyPaginator { - if params == nil { - params = &ListTargetsForPolicyInput{} - } - - options := ListTargetsForPolicyPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListTargetsForPolicyPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListTargetsForPolicyPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListTargetsForPolicy page. -func (p *ListTargetsForPolicyPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTargetsForPolicyOutput, error) { - if !p.HasMorePages() { - return nil, fmt.Errorf("no more pages available") - } - - params := *p.params - params.NextToken = p.nextToken - - var limit *int32 - if p.options.Limit > 0 { - limit = &p.options.Limit - } - params.MaxResults = limit - - optFns = append([]func(*Options){ - addIsPaginatorUserAgent, - }, optFns...) - result, err := p.client.ListTargetsForPolicy(ctx, ¶ms, optFns...) - if err != nil { - return nil, err - } - p.firstPage = false - - prevToken := p.nextToken - p.nextToken = result.NextToken - - if p.options.StopOnDuplicateToken && - prevToken != nil && - p.nextToken != nil && - *prevToken == *p.nextToken { - p.nextToken = nil - } - - return result, nil -} - -// ListTargetsForPolicyAPIClient is a client that implements the -// ListTargetsForPolicy operation. -type ListTargetsForPolicyAPIClient interface { - ListTargetsForPolicy(context.Context, *ListTargetsForPolicyInput, ...func(*Options)) (*ListTargetsForPolicyOutput, error) -} - -var _ ListTargetsForPolicyAPIClient = (*Client)(nil) - -func newServiceMetadataMiddleware_opListTargetsForPolicy(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListTargetsForPolicy", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_MoveAccount.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_MoveAccount.go deleted file mode 100644 index 94f2829384..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_MoveAccount.go +++ /dev/null @@ -1,190 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Moves an account from its current source parent root or organizational unit -// (OU) to the specified destination parent root or OU. -// -// You can only call this operation from the management account. -func (c *Client) MoveAccount(ctx context.Context, params *MoveAccountInput, optFns ...func(*Options)) (*MoveAccountOutput, error) { - if params == nil { - params = &MoveAccountInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "MoveAccount", params, optFns, c.addOperationMoveAccountMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*MoveAccountOutput) - out.ResultMetadata = metadata - return out, nil -} - -type MoveAccountInput struct { - - // ID for the account that you want to move. - // - // The [regex pattern] for an account ID string requires exactly 12 digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - AccountId *string - - // ID for the root or organizational unit that you want to move the account to. - // - // The [regex pattern] for a parent ID string requires one of the following: - // - // - Root - A string that begins with "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // - Organizational unit (OU) - A string that begins with "ou-" followed by from - // 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This - // string is followed by a second "-" dash and from 8 to 32 additional lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - DestinationParentId *string - - // ID for the root or organizational unit that you want to move the account from. - // - // The [regex pattern] for a parent ID string requires one of the following: - // - // - Root - A string that begins with "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // - Organizational unit (OU) - A string that begins with "ou-" followed by from - // 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This - // string is followed by a second "-" dash and from 8 to 32 additional lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - SourceParentId *string - - noSmithyDocumentSerde -} - -type MoveAccountOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationMoveAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpMoveAccount{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpMoveAccount{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "MoveAccount"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpMoveAccountValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opMoveAccount(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opMoveAccount(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "MoveAccount", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_PutResourcePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_PutResourcePolicy.go deleted file mode 100644 index 47df84d610..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_PutResourcePolicy.go +++ /dev/null @@ -1,173 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Creates or updates a resource policy. -// -// You can only call this operation from the management account.. -func (c *Client) PutResourcePolicy(ctx context.Context, params *PutResourcePolicyInput, optFns ...func(*Options)) (*PutResourcePolicyOutput, error) { - if params == nil { - params = &PutResourcePolicyInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "PutResourcePolicy", params, optFns, c.addOperationPutResourcePolicyMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*PutResourcePolicyOutput) - out.ResultMetadata = metadata - return out, nil -} - -type PutResourcePolicyInput struct { - - // If provided, the new content for the resource policy. The text must be - // correctly formatted JSON that complies with the syntax for the resource policy's - // type. For more information, see [SCP syntax]in the Organizations User Guide. - // - // [SCP syntax]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_syntax.html - // - // This member is required. - Content *string - - // A list of tags that you want to attach to the newly created resource policy. - // For each tag in the list, you must specify both a tag key and a value. You can - // set the value to an empty string, but you can't set it to null . For more - // information about tagging, see [Tagging Organizations resources]in the Organizations User Guide. - // - // Calls with tags apply to the initial creation of the resource policy, otherwise - // an exception is thrown. If any one of the tags is not valid or if you exceed the - // allowed number of tags for the resource policy, then the entire request fails - // and the resource policy is not created. - // - // [Tagging Organizations resources]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html - Tags []types.Tag - - noSmithyDocumentSerde -} - -type PutResourcePolicyOutput struct { - - // A structure that contains details about the resource policy. - ResourcePolicy *types.ResourcePolicy - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationPutResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutResourcePolicy{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutResourcePolicy{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "PutResourcePolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpPutResourcePolicyValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutResourcePolicy(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opPutResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "PutResourcePolicy", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_RegisterDelegatedAdministrator.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_RegisterDelegatedAdministrator.go deleted file mode 100644 index f1892cb0dc..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_RegisterDelegatedAdministrator.go +++ /dev/null @@ -1,167 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Enables the specified member account to administer the Organizations features -// of the specified Amazon Web Services service. It grants read-only access to -// Organizations service data. The account still requires IAM permissions to access -// and administer the Amazon Web Services service. -// -// You can run this action only for Amazon Web Services services that support this -// feature. For a current list of services that support it, see the column Supports -// Delegated Administrator in the table at [Amazon Web Services Services that you can use with Organizations]in the Organizations User Guide. -// -// You can only call this operation from the management account. -// -// [Amazon Web Services Services that you can use with Organizations]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services_list.html -func (c *Client) RegisterDelegatedAdministrator(ctx context.Context, params *RegisterDelegatedAdministratorInput, optFns ...func(*Options)) (*RegisterDelegatedAdministratorOutput, error) { - if params == nil { - params = &RegisterDelegatedAdministratorInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RegisterDelegatedAdministrator", params, optFns, c.addOperationRegisterDelegatedAdministratorMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RegisterDelegatedAdministratorOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RegisterDelegatedAdministratorInput struct { - - // The account ID number of the member account in the organization to register as - // a delegated administrator. - // - // This member is required. - AccountId *string - - // The service principal of the Amazon Web Services service for which you want to - // make the member account a delegated administrator. - // - // This member is required. - ServicePrincipal *string - - noSmithyDocumentSerde -} - -type RegisterDelegatedAdministratorOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRegisterDelegatedAdministratorMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpRegisterDelegatedAdministrator{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRegisterDelegatedAdministrator{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RegisterDelegatedAdministrator"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRegisterDelegatedAdministratorValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterDelegatedAdministrator(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRegisterDelegatedAdministrator(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RegisterDelegatedAdministrator", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_RemoveAccountFromOrganization.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_RemoveAccountFromOrganization.go deleted file mode 100644 index ce12780f03..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_RemoveAccountFromOrganization.go +++ /dev/null @@ -1,180 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Removes the specified account from the organization. -// -// The removed account becomes a standalone account that isn't a member of any -// organization. It's no longer subject to any policies and is responsible for its -// own bill payments. The organization's management account is no longer charged -// for any expenses accrued by the member account after it's removed from the -// organization. -// -// You can only call this operation from the management account. Member accounts -// can remove themselves with LeaveOrganizationinstead. -// -// - You can remove an account from your organization only if the account is -// configured with the information required to operate as a standalone account. -// When you create an account in an organization using the Organizations console, -// API, or CLI commands, the information required of standalone accounts is not -// automatically collected. For more information, see [Considerations before removing an account from an organization]in the Organizations User -// Guide. -// -// - The account that you want to leave must not be a delegated administrator -// account for any Amazon Web Services service enabled for your organization. If -// the account is a delegated administrator, you must first change the delegated -// administrator account to another account that is remaining in the organization. -// -// - After the account leaves the organization, all tags that were attached to -// the account object in the organization are deleted. Amazon Web Services accounts -// outside of an organization do not support tags. -// -// [Considerations before removing an account from an organization]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_account-before-remove.html -func (c *Client) RemoveAccountFromOrganization(ctx context.Context, params *RemoveAccountFromOrganizationInput, optFns ...func(*Options)) (*RemoveAccountFromOrganizationOutput, error) { - if params == nil { - params = &RemoveAccountFromOrganizationInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "RemoveAccountFromOrganization", params, optFns, c.addOperationRemoveAccountFromOrganizationMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*RemoveAccountFromOrganizationOutput) - out.ResultMetadata = metadata - return out, nil -} - -type RemoveAccountFromOrganizationInput struct { - - // ID for the member account that you want to remove from the organization. - // - // The [regex pattern] for an account ID string requires exactly 12 digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - AccountId *string - - noSmithyDocumentSerde -} - -type RemoveAccountFromOrganizationOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationRemoveAccountFromOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpRemoveAccountFromOrganization{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRemoveAccountFromOrganization{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "RemoveAccountFromOrganization"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpRemoveAccountFromOrganizationValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRemoveAccountFromOrganization(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opRemoveAccountFromOrganization(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "RemoveAccountFromOrganization", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_TagResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_TagResource.go deleted file mode 100644 index 7ad6325ad5..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_TagResource.go +++ /dev/null @@ -1,186 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Adds one or more tags to the specified resource. -// -// Currently, you can attach tags to the following resources in Organizations. -// -// - Amazon Web Services account -// -// - Organization root -// -// - Organizational unit (OU) -// -// - Policy (any type) -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { - if params == nil { - params = &TagResourceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*TagResourceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type TagResourceInput struct { - - // The ID of the resource to add a tag to. - // - // You can specify any of the following taggable resources. - // - // - Amazon Web Services account – specify the account ID number. - // - // - Organizational unit – specify the OU ID that begins with ou- and looks - // similar to: ou-1a2b-34uvwxyz - // - // - Root – specify the root ID that begins with r- and looks similar to: r-1a2b - // - // - Policy – specify the policy ID that begins with p- andlooks similar to: - // p-12abcdefg3 - // - // This member is required. - ResourceId *string - - // A list of tags to add to the specified resource. - // - // For each tag in the list, you must specify both a tag key and a value. The - // value can be an empty string, but you can't set it to null . - // - // If any one of the tags is not valid or if you exceed the maximum allowed number - // of tags for a resource, then the entire request fails. - // - // This member is required. - Tags []types.Tag - - noSmithyDocumentSerde -} - -type TagResourceOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTagResource{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "TagResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpTagResourceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "TagResource", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_TerminateResponsibilityTransfer.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_TerminateResponsibilityTransfer.go deleted file mode 100644 index b0cb2c42b8..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_TerminateResponsibilityTransfer.go +++ /dev/null @@ -1,160 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "time" -) - -// Ends a transfer. A transfer is an arrangement between two management accounts -// where one account designates the other with specified responsibilities for their -// organization. -func (c *Client) TerminateResponsibilityTransfer(ctx context.Context, params *TerminateResponsibilityTransferInput, optFns ...func(*Options)) (*TerminateResponsibilityTransferOutput, error) { - if params == nil { - params = &TerminateResponsibilityTransferInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "TerminateResponsibilityTransfer", params, optFns, c.addOperationTerminateResponsibilityTransferMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*TerminateResponsibilityTransferOutput) - out.ResultMetadata = metadata - return out, nil -} - -type TerminateResponsibilityTransferInput struct { - - // ID for the transfer. - // - // This member is required. - Id *string - - // Timestamp when the responsibility transfer is to end. - EndTimestamp *time.Time - - noSmithyDocumentSerde -} - -type TerminateResponsibilityTransferOutput struct { - - // A ResponsibilityTransfer object. Contains details for a transfer. - ResponsibilityTransfer *types.ResponsibilityTransfer - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationTerminateResponsibilityTransferMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpTerminateResponsibilityTransfer{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTerminateResponsibilityTransfer{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "TerminateResponsibilityTransfer"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpTerminateResponsibilityTransferValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTerminateResponsibilityTransfer(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opTerminateResponsibilityTransfer(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "TerminateResponsibilityTransfer", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_UntagResource.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_UntagResource.go deleted file mode 100644 index c3b71ca733..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_UntagResource.go +++ /dev/null @@ -1,179 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Removes any tags with the specified keys from the specified resource. -// -// You can attach tags to the following resources in Organizations. -// -// - Amazon Web Services account -// -// - Organization root -// -// - Organizational unit (OU) -// -// - Policy (any type) -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { - if params == nil { - params = &UntagResourceInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UntagResourceOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UntagResourceInput struct { - - // The ID of the resource to remove a tag from. - // - // You can specify any of the following taggable resources. - // - // - Amazon Web Services account – specify the account ID number. - // - // - Organizational unit – specify the OU ID that begins with ou- and looks - // similar to: ou-1a2b-34uvwxyz - // - // - Root – specify the root ID that begins with r- and looks similar to: r-1a2b - // - // - Policy – specify the policy ID that begins with p- andlooks similar to: - // p-12abcdefg3 - // - // This member is required. - ResourceId *string - - // The list of keys for tags to remove from the specified resource. - // - // This member is required. - TagKeys []string - - noSmithyDocumentSerde -} - -type UntagResourceOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpUntagResource{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUntagResource{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UntagResource"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpUntagResourceValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UntagResource", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_UpdateOrganizationalUnit.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_UpdateOrganizationalUnit.go deleted file mode 100644 index 2ffea25357..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_UpdateOrganizationalUnit.go +++ /dev/null @@ -1,174 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Renames the specified organizational unit (OU). The ID and ARN don't change. -// The child OUs and accounts remain in place, and any attached policies of the OU -// remain attached. -// -// You can only call this operation from the management account. -func (c *Client) UpdateOrganizationalUnit(ctx context.Context, params *UpdateOrganizationalUnitInput, optFns ...func(*Options)) (*UpdateOrganizationalUnitOutput, error) { - if params == nil { - params = &UpdateOrganizationalUnitInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateOrganizationalUnit", params, optFns, c.addOperationUpdateOrganizationalUnitMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateOrganizationalUnitOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateOrganizationalUnitInput struct { - - // ID for the OU that you want to rename. You can get the ID from the ListOrganizationalUnitsForParent operation. - // - // The [regex pattern] for an organizational unit ID string requires "ou-" followed by from 4 to - // 32 lowercase letters or digits (the ID of the root that contains the OU). This - // string is followed by a second "-" dash and from 8 to 32 additional lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - OrganizationalUnitId *string - - // The new name that you want to assign to the OU. - // - // The [regex pattern] that is used to validate this parameter is a string of any of the - // characters in the ASCII character range. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - Name *string - - noSmithyDocumentSerde -} - -type UpdateOrganizationalUnitOutput struct { - - // A structure that contains the details about the specified OU, including its new - // name. - OrganizationalUnit *types.OrganizationalUnit - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateOrganizationalUnitMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateOrganizationalUnit{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateOrganizationalUnit{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateOrganizationalUnit"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpUpdateOrganizationalUnitValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateOrganizationalUnit(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUpdateOrganizationalUnit(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateOrganizationalUnit", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_UpdatePolicy.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_UpdatePolicy.go deleted file mode 100644 index 377c45a200..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_UpdatePolicy.go +++ /dev/null @@ -1,187 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Updates an existing policy with a new name, description, or content. If you -// don't supply any parameter, that value remains unchanged. You can't change a -// policy's type. -// -// You can only call this operation from the management account or a member -// account that is a delegated administrator. -func (c *Client) UpdatePolicy(ctx context.Context, params *UpdatePolicyInput, optFns ...func(*Options)) (*UpdatePolicyOutput, error) { - if params == nil { - params = &UpdatePolicyInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdatePolicy", params, optFns, c.addOperationUpdatePolicyMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdatePolicyOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdatePolicyInput struct { - - // ID for the policy that you want to update. - // - // The [regex pattern] for a policy ID string requires "p-" followed by from 8 to 128 lowercase - // or uppercase letters, digits, or the underscore character (_). - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - PolicyId *string - - // If provided, the new content for the policy. The text must be correctly - // formatted JSON that complies with the syntax for the policy's type. For more - // information, see [SCP syntax]in the Organizations User Guide. - // - // The maximum size of a policy document depends on the policy's type. For more - // information, see [Maximum and minimum values]in the Organizations User Guide. - // - // [Maximum and minimum values]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html#min-max-values - // [SCP syntax]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_syntax.html - Content *string - - // If provided, the new description for the policy. - Description *string - - // If provided, the new name for the policy. - // - // The [regex pattern] that is used to validate this parameter is a string of any of the - // characters in the ASCII character range. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - Name *string - - noSmithyDocumentSerde -} - -type UpdatePolicyOutput struct { - - // A structure that contains details about the updated policy, showing the - // requested changes. - Policy *types.Policy - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdatePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdatePolicy{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdatePolicy{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdatePolicy"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpUpdatePolicyValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePolicy(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUpdatePolicy(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdatePolicy", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_UpdateResponsibilityTransfer.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_UpdateResponsibilityTransfer.go deleted file mode 100644 index 012d01b049..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/api_op_UpdateResponsibilityTransfer.go +++ /dev/null @@ -1,165 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// Updates a transfer. A transfer is the arrangement between two management -// accounts where one account designates the other with specified responsibilities -// for their organization. -// -// You can update the name assigned to a transfer. -func (c *Client) UpdateResponsibilityTransfer(ctx context.Context, params *UpdateResponsibilityTransferInput, optFns ...func(*Options)) (*UpdateResponsibilityTransferOutput, error) { - if params == nil { - params = &UpdateResponsibilityTransferInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateResponsibilityTransfer", params, optFns, c.addOperationUpdateResponsibilityTransferMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateResponsibilityTransferOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateResponsibilityTransferInput struct { - - // ID for the transfer. - // - // This member is required. - Id *string - - // New name you want to assign to the transfer. - // - // This member is required. - Name *string - - noSmithyDocumentSerde -} - -type UpdateResponsibilityTransferOutput struct { - - // Contains details for a transfer. A transfer is the arrangement between two - // management accounts where one account designates the other with specified - // responsibilities for their organization. - ResponsibilityTransfer *types.ResponsibilityTransfer - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateResponsibilityTransferMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateResponsibilityTransfer{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateResponsibilityTransfer{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateResponsibilityTransfer"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = addClientRequestID(stack); err != nil { - return err - } - if err = addComputeContentLength(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = addComputePayloadSHA256(stack); err != nil { - return err - } - if err = addRetry(stack, options, c); err != nil { - return err - } - if err = addRawResponseToMetadata(stack); err != nil { - return err - } - if err = addRecordResponseTiming(stack); err != nil { - return err - } - if err = addSpanRetryLoop(stack, options); err != nil { - return err - } - if err = addClientUserAgent(stack, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addUserAgentRetryMode(stack, options); err != nil { - return err - } - if err = addCredentialSource(stack, options); err != nil { - return err - } - if err = addOpUpdateResponsibilityTransferValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateResponsibilityTransfer(options.Region), middleware.Before); err != nil { - return err - } - if err = addRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - if err = addInterceptBeforeRetryLoop(stack, options); err != nil { - return err - } - if err = addInterceptAttempt(stack, options); err != nil { - return err - } - if err = addInterceptors(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUpdateResponsibilityTransfer(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateResponsibilityTransfer", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/auth.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/auth.go deleted file mode 100644 index 7f502d148c..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/auth.go +++ /dev/null @@ -1,345 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "slices" - "strings" -) - -func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) error { - params.Region = options.Region - return nil -} - -type setLegacyContextSigningOptionsMiddleware struct { -} - -func (*setLegacyContextSigningOptionsMiddleware) ID() string { - return "setLegacyContextSigningOptions" -} - -func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - rscheme := getResolvedAuthScheme(ctx) - schemeID := rscheme.Scheme.SchemeID() - - if sn := awsmiddleware.GetSigningName(ctx); sn != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) - } - } - - if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) - } - } - - return next.HandleFinalize(ctx, in) -} - -func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { - return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) -} - -type withAnonymous struct { - resolver AuthSchemeResolver -} - -var _ AuthSchemeResolver = (*withAnonymous)(nil) - -func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - opts, err := v.resolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return nil, err - } - - opts = append(opts, &smithyauth.Option{ - SchemeID: smithyauth.SchemeIDAnonymous, - }) - return opts, nil -} - -func wrapWithAnonymousAuth(options *Options) { - if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { - return - } - - options.AuthSchemeResolver = &withAnonymous{ - resolver: options.AuthSchemeResolver, - } -} - -// AuthResolverParameters contains the set of inputs necessary for auth scheme -// resolution. -type AuthResolverParameters struct { - // The name of the operation being invoked. - Operation string - - // The region in which the operation is being invoked. - Region string -} - -func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) (*AuthResolverParameters, error) { - params := &AuthResolverParameters{ - Operation: operation, - } - - if err := bindAuthParamsRegion(ctx, params, input, options); err != nil { - return nil, err - } - - return params, nil -} - -// AuthSchemeResolver returns a set of possible authentication options for an -// operation. -type AuthSchemeResolver interface { - ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) -} - -type defaultAuthSchemeResolver struct{} - -var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) - -func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - if overrides, ok := operationAuthOptions[params.Operation]; ok { - return overrides(params), nil - } - return serviceAuthOptions(params), nil -} - -var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} - -func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - { - SchemeID: smithyauth.SchemeIDSigV4, - SignerProperties: func() smithy.Properties { - var props smithy.Properties - smithyhttp.SetSigV4SigningName(&props, "organizations") - smithyhttp.SetSigV4SigningRegion(&props, params.Region) - return props - }(), - }, - } -} - -type resolveAuthSchemeMiddleware struct { - operation string - options Options -} - -func (*resolveAuthSchemeMiddleware) ID() string { - return "ResolveAuthScheme" -} - -func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") - defer span.End() - - params, err := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) - if err != nil { - return out, metadata, fmt.Errorf("bind auth scheme params: %w", err) - } - options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) - } - - scheme, ok := m.selectScheme(options) - if !ok { - return out, metadata, fmt.Errorf("could not select an auth scheme") - } - - ctx = setResolvedAuthScheme(ctx, scheme) - - span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) - span.End() - return next.HandleFinalize(ctx, in) -} - -func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { - sorted := sortAuthOptions(options, m.options.AuthSchemePreference) - for _, option := range sorted { - if option.SchemeID == smithyauth.SchemeIDAnonymous { - return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true - } - - for _, scheme := range m.options.AuthSchemes { - if scheme.SchemeID() != option.SchemeID { - continue - } - - if scheme.IdentityResolver(m.options) != nil { - return newResolvedAuthScheme(scheme, option), true - } - } - } - - return nil, false -} - -func sortAuthOptions(options []*smithyauth.Option, preferred []string) []*smithyauth.Option { - byPriority := make([]*smithyauth.Option, 0, len(options)) - for _, prefName := range preferred { - for _, option := range options { - optName := option.SchemeID - if parts := strings.Split(option.SchemeID, "#"); len(parts) == 2 { - optName = parts[1] - } - if prefName == optName { - byPriority = append(byPriority, option) - } - } - } - for _, option := range options { - if !slices.ContainsFunc(byPriority, func(o *smithyauth.Option) bool { - return o.SchemeID == option.SchemeID - }) { - byPriority = append(byPriority, option) - } - } - return byPriority -} - -type resolvedAuthSchemeKey struct{} - -type resolvedAuthScheme struct { - Scheme smithyhttp.AuthScheme - IdentityProperties smithy.Properties - SignerProperties smithy.Properties -} - -func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { - return &resolvedAuthScheme{ - Scheme: scheme, - IdentityProperties: option.IdentityProperties, - SignerProperties: option.SignerProperties, - } -} - -func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { - return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) -} - -func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { - v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) - return v -} - -type getIdentityMiddleware struct { - options Options -} - -func (*getIdentityMiddleware) ID() string { - return "GetIdentity" -} - -func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") - defer span.End() - - rscheme := getResolvedAuthScheme(innerCtx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - resolver := rscheme.Scheme.IdentityResolver(m.options) - if resolver == nil { - return out, metadata, fmt.Errorf("no identity resolver") - } - - identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", - func() (smithyauth.Identity, error) { - return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) - }, - func(o *metrics.RecordMetricOptions) { - o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) - }) - if err != nil { - return out, metadata, fmt.Errorf("get identity: %w", err) - } - - ctx = setIdentity(ctx, identity) - - span.End() - return next.HandleFinalize(ctx, in) -} - -type identityKey struct{} - -func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { - return middleware.WithStackValue(ctx, identityKey{}, identity) -} - -func getIdentity(ctx context.Context) smithyauth.Identity { - v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) - return v -} - -type signRequestMiddleware struct { - options Options -} - -func (*signRequestMiddleware) ID() string { - return "Signing" -} - -func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "SignRequest") - defer span.End() - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - identity := getIdentity(ctx) - if identity == nil { - return out, metadata, fmt.Errorf("no identity") - } - - signer := rscheme.Scheme.Signer() - if signer == nil { - return out, metadata, fmt.Errorf("no signer") - } - - _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { - return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) - }, func(o *metrics.RecordMetricOptions) { - o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) - }) - if err != nil { - return out, metadata, fmt.Errorf("sign request: %w", err) - } - - span.End() - return next.HandleFinalize(ctx, in) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/deserializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/deserializers.go deleted file mode 100644 index a29ae3273d..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/deserializers.go +++ /dev/null @@ -1,16153 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - smithy "github.com/aws/smithy-go" - smithyio "github.com/aws/smithy-go/io" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/ptr" - smithytime "github.com/aws/smithy-go/time" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "io" - "io/ioutil" - "strings" -) - -type awsAwsjson11_deserializeOpAcceptHandshake struct { -} - -func (*awsAwsjson11_deserializeOpAcceptHandshake) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpAcceptHandshake) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorAcceptHandshake(response, &metadata) - } - output := &AcceptHandshakeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentAcceptHandshakeOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorAcceptHandshake(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("AccessDeniedForDependencyException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedForDependencyException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("HandshakeAlreadyInStateException", errorCode): - return awsAwsjson11_deserializeErrorHandshakeAlreadyInStateException(response, errorBody) - - case strings.EqualFold("HandshakeConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorHandshakeConstraintViolationException(response, errorBody) - - case strings.EqualFold("HandshakeNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorHandshakeNotFoundException(response, errorBody) - - case strings.EqualFold("InvalidHandshakeTransitionException", errorCode): - return awsAwsjson11_deserializeErrorInvalidHandshakeTransitionException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("MasterCannotLeaveOrganizationException", errorCode): - return awsAwsjson11_deserializeErrorMasterCannotLeaveOrganizationException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpAttachPolicy struct { -} - -func (*awsAwsjson11_deserializeOpAttachPolicy) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpAttachPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorAttachPolicy(response, &metadata) - } - output := &AttachPolicyOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorAttachPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("DuplicatePolicyAttachmentException", errorCode): - return awsAwsjson11_deserializeErrorDuplicatePolicyAttachmentException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("PolicyChangesInProgressException", errorCode): - return awsAwsjson11_deserializeErrorPolicyChangesInProgressException(response, errorBody) - - case strings.EqualFold("PolicyNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorPolicyNotFoundException(response, errorBody) - - case strings.EqualFold("PolicyTypeNotEnabledException", errorCode): - return awsAwsjson11_deserializeErrorPolicyTypeNotEnabledException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TargetNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorTargetNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpCancelHandshake struct { -} - -func (*awsAwsjson11_deserializeOpCancelHandshake) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpCancelHandshake) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorCancelHandshake(response, &metadata) - } - output := &CancelHandshakeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentCancelHandshakeOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorCancelHandshake(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("HandshakeAlreadyInStateException", errorCode): - return awsAwsjson11_deserializeErrorHandshakeAlreadyInStateException(response, errorBody) - - case strings.EqualFold("HandshakeNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorHandshakeNotFoundException(response, errorBody) - - case strings.EqualFold("InvalidHandshakeTransitionException", errorCode): - return awsAwsjson11_deserializeErrorInvalidHandshakeTransitionException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpCloseAccount struct { -} - -func (*awsAwsjson11_deserializeOpCloseAccount) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpCloseAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorCloseAccount(response, &metadata) - } - output := &CloseAccountOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorCloseAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("AccountAlreadyClosedException", errorCode): - return awsAwsjson11_deserializeErrorAccountAlreadyClosedException(response, errorBody) - - case strings.EqualFold("AccountNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorAccountNotFoundException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson11_deserializeErrorConflictException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpCreateAccount struct { -} - -func (*awsAwsjson11_deserializeOpCreateAccount) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpCreateAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorCreateAccount(response, &metadata) - } - output := &CreateAccountOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentCreateAccountOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorCreateAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("FinalizingOrganizationException", errorCode): - return awsAwsjson11_deserializeErrorFinalizingOrganizationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpCreateGovCloudAccount struct { -} - -func (*awsAwsjson11_deserializeOpCreateGovCloudAccount) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpCreateGovCloudAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorCreateGovCloudAccount(response, &metadata) - } - output := &CreateGovCloudAccountOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentCreateGovCloudAccountOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorCreateGovCloudAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("FinalizingOrganizationException", errorCode): - return awsAwsjson11_deserializeErrorFinalizingOrganizationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpCreateOrganization struct { -} - -func (*awsAwsjson11_deserializeOpCreateOrganization) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpCreateOrganization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorCreateOrganization(response, &metadata) - } - output := &CreateOrganizationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentCreateOrganizationOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorCreateOrganization(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("AccessDeniedForDependencyException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedForDependencyException(response, errorBody) - - case strings.EqualFold("AlreadyInOrganizationException", errorCode): - return awsAwsjson11_deserializeErrorAlreadyInOrganizationException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpCreateOrganizationalUnit struct { -} - -func (*awsAwsjson11_deserializeOpCreateOrganizationalUnit) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpCreateOrganizationalUnit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorCreateOrganizationalUnit(response, &metadata) - } - output := &CreateOrganizationalUnitOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentCreateOrganizationalUnitOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorCreateOrganizationalUnit(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("DuplicateOrganizationalUnitException", errorCode): - return awsAwsjson11_deserializeErrorDuplicateOrganizationalUnitException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ParentNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorParentNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpCreatePolicy struct { -} - -func (*awsAwsjson11_deserializeOpCreatePolicy) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpCreatePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorCreatePolicy(response, &metadata) - } - output := &CreatePolicyOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentCreatePolicyOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorCreatePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("DuplicatePolicyException", errorCode): - return awsAwsjson11_deserializeErrorDuplicatePolicyException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("MalformedPolicyDocumentException", errorCode): - return awsAwsjson11_deserializeErrorMalformedPolicyDocumentException(response, errorBody) - - case strings.EqualFold("PolicyTypeNotAvailableForOrganizationException", errorCode): - return awsAwsjson11_deserializeErrorPolicyTypeNotAvailableForOrganizationException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDeclineHandshake struct { -} - -func (*awsAwsjson11_deserializeOpDeclineHandshake) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDeclineHandshake) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeclineHandshake(response, &metadata) - } - output := &DeclineHandshakeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentDeclineHandshakeOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDeclineHandshake(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("HandshakeAlreadyInStateException", errorCode): - return awsAwsjson11_deserializeErrorHandshakeAlreadyInStateException(response, errorBody) - - case strings.EqualFold("HandshakeNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorHandshakeNotFoundException(response, errorBody) - - case strings.EqualFold("InvalidHandshakeTransitionException", errorCode): - return awsAwsjson11_deserializeErrorInvalidHandshakeTransitionException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDeleteOrganization struct { -} - -func (*awsAwsjson11_deserializeOpDeleteOrganization) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDeleteOrganization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteOrganization(response, &metadata) - } - output := &DeleteOrganizationOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDeleteOrganization(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("OrganizationNotEmptyException", errorCode): - return awsAwsjson11_deserializeErrorOrganizationNotEmptyException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDeleteOrganizationalUnit struct { -} - -func (*awsAwsjson11_deserializeOpDeleteOrganizationalUnit) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDeleteOrganizationalUnit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteOrganizationalUnit(response, &metadata) - } - output := &DeleteOrganizationalUnitOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDeleteOrganizationalUnit(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("OrganizationalUnitNotEmptyException", errorCode): - return awsAwsjson11_deserializeErrorOrganizationalUnitNotEmptyException(response, errorBody) - - case strings.EqualFold("OrganizationalUnitNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorOrganizationalUnitNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDeletePolicy struct { -} - -func (*awsAwsjson11_deserializeOpDeletePolicy) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDeletePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeletePolicy(response, &metadata) - } - output := &DeletePolicyOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDeletePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("PolicyInUseException", errorCode): - return awsAwsjson11_deserializeErrorPolicyInUseException(response, errorBody) - - case strings.EqualFold("PolicyNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorPolicyNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDeleteResourcePolicy struct { -} - -func (*awsAwsjson11_deserializeOpDeleteResourcePolicy) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDeleteResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response, &metadata) - } - output := &DeleteResourcePolicyOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("ResourcePolicyNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourcePolicyNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDeregisterDelegatedAdministrator struct { -} - -func (*awsAwsjson11_deserializeOpDeregisterDelegatedAdministrator) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDeregisterDelegatedAdministrator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeregisterDelegatedAdministrator(response, &metadata) - } - output := &DeregisterDelegatedAdministratorOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDeregisterDelegatedAdministrator(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("AccountNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorAccountNotFoundException(response, errorBody) - - case strings.EqualFold("AccountNotRegisteredException", errorCode): - return awsAwsjson11_deserializeErrorAccountNotRegisteredException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDescribeAccount struct { -} - -func (*awsAwsjson11_deserializeOpDescribeAccount) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDescribeAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeAccount(response, &metadata) - } - output := &DescribeAccountOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentDescribeAccountOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDescribeAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("AccountNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorAccountNotFoundException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDescribeCreateAccountStatus struct { -} - -func (*awsAwsjson11_deserializeOpDescribeCreateAccountStatus) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDescribeCreateAccountStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeCreateAccountStatus(response, &metadata) - } - output := &DescribeCreateAccountStatusOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentDescribeCreateAccountStatusOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDescribeCreateAccountStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("CreateAccountStatusNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorCreateAccountStatusNotFoundException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDescribeEffectivePolicy struct { -} - -func (*awsAwsjson11_deserializeOpDescribeEffectivePolicy) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDescribeEffectivePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeEffectivePolicy(response, &metadata) - } - output := &DescribeEffectivePolicyOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentDescribeEffectivePolicyOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDescribeEffectivePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("EffectivePolicyNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEffectivePolicyNotFoundException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TargetNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorTargetNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDescribeHandshake struct { -} - -func (*awsAwsjson11_deserializeOpDescribeHandshake) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDescribeHandshake) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeHandshake(response, &metadata) - } - output := &DescribeHandshakeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentDescribeHandshakeOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDescribeHandshake(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("HandshakeNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorHandshakeNotFoundException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDescribeOrganization struct { -} - -func (*awsAwsjson11_deserializeOpDescribeOrganization) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDescribeOrganization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeOrganization(response, &metadata) - } - output := &DescribeOrganizationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentDescribeOrganizationOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDescribeOrganization(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDescribeOrganizationalUnit struct { -} - -func (*awsAwsjson11_deserializeOpDescribeOrganizationalUnit) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDescribeOrganizationalUnit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeOrganizationalUnit(response, &metadata) - } - output := &DescribeOrganizationalUnitOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentDescribeOrganizationalUnitOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDescribeOrganizationalUnit(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("OrganizationalUnitNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorOrganizationalUnitNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDescribePolicy struct { -} - -func (*awsAwsjson11_deserializeOpDescribePolicy) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDescribePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribePolicy(response, &metadata) - } - output := &DescribePolicyOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentDescribePolicyOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDescribePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("PolicyNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorPolicyNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDescribeResourcePolicy struct { -} - -func (*awsAwsjson11_deserializeOpDescribeResourcePolicy) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDescribeResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeResourcePolicy(response, &metadata) - } - output := &DescribeResourcePolicyOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentDescribeResourcePolicyOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDescribeResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("ResourcePolicyNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourcePolicyNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDescribeResponsibilityTransfer struct { -} - -func (*awsAwsjson11_deserializeOpDescribeResponsibilityTransfer) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDescribeResponsibilityTransfer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeResponsibilityTransfer(response, &metadata) - } - output := &DescribeResponsibilityTransferOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentDescribeResponsibilityTransferOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDescribeResponsibilityTransfer(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ResponsibilityTransferNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResponsibilityTransferNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDetachPolicy struct { -} - -func (*awsAwsjson11_deserializeOpDetachPolicy) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDetachPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDetachPolicy(response, &metadata) - } - output := &DetachPolicyOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDetachPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("PolicyChangesInProgressException", errorCode): - return awsAwsjson11_deserializeErrorPolicyChangesInProgressException(response, errorBody) - - case strings.EqualFold("PolicyNotAttachedException", errorCode): - return awsAwsjson11_deserializeErrorPolicyNotAttachedException(response, errorBody) - - case strings.EqualFold("PolicyNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorPolicyNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TargetNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorTargetNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDisableAWSServiceAccess struct { -} - -func (*awsAwsjson11_deserializeOpDisableAWSServiceAccess) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDisableAWSServiceAccess) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDisableAWSServiceAccess(response, &metadata) - } - output := &DisableAWSServiceAccessOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDisableAWSServiceAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDisablePolicyType struct { -} - -func (*awsAwsjson11_deserializeOpDisablePolicyType) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDisablePolicyType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDisablePolicyType(response, &metadata) - } - output := &DisablePolicyTypeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentDisablePolicyTypeOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDisablePolicyType(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("PolicyChangesInProgressException", errorCode): - return awsAwsjson11_deserializeErrorPolicyChangesInProgressException(response, errorBody) - - case strings.EqualFold("PolicyTypeNotEnabledException", errorCode): - return awsAwsjson11_deserializeErrorPolicyTypeNotEnabledException(response, errorBody) - - case strings.EqualFold("RootNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorRootNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpEnableAllFeatures struct { -} - -func (*awsAwsjson11_deserializeOpEnableAllFeatures) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpEnableAllFeatures) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorEnableAllFeatures(response, &metadata) - } - output := &EnableAllFeaturesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentEnableAllFeaturesOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorEnableAllFeatures(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("HandshakeConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorHandshakeConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpEnableAWSServiceAccess struct { -} - -func (*awsAwsjson11_deserializeOpEnableAWSServiceAccess) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpEnableAWSServiceAccess) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorEnableAWSServiceAccess(response, &metadata) - } - output := &EnableAWSServiceAccessOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorEnableAWSServiceAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpEnablePolicyType struct { -} - -func (*awsAwsjson11_deserializeOpEnablePolicyType) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpEnablePolicyType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorEnablePolicyType(response, &metadata) - } - output := &EnablePolicyTypeOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentEnablePolicyTypeOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorEnablePolicyType(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("PolicyChangesInProgressException", errorCode): - return awsAwsjson11_deserializeErrorPolicyChangesInProgressException(response, errorBody) - - case strings.EqualFold("PolicyTypeAlreadyEnabledException", errorCode): - return awsAwsjson11_deserializeErrorPolicyTypeAlreadyEnabledException(response, errorBody) - - case strings.EqualFold("PolicyTypeNotAvailableForOrganizationException", errorCode): - return awsAwsjson11_deserializeErrorPolicyTypeNotAvailableForOrganizationException(response, errorBody) - - case strings.EqualFold("RootNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorRootNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpInviteAccountToOrganization struct { -} - -func (*awsAwsjson11_deserializeOpInviteAccountToOrganization) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpInviteAccountToOrganization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorInviteAccountToOrganization(response, &metadata) - } - output := &InviteAccountToOrganizationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentInviteAccountToOrganizationOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorInviteAccountToOrganization(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("AccountOwnerNotVerifiedException", errorCode): - return awsAwsjson11_deserializeErrorAccountOwnerNotVerifiedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("DuplicateHandshakeException", errorCode): - return awsAwsjson11_deserializeErrorDuplicateHandshakeException(response, errorBody) - - case strings.EqualFold("FinalizingOrganizationException", errorCode): - return awsAwsjson11_deserializeErrorFinalizingOrganizationException(response, errorBody) - - case strings.EqualFold("HandshakeConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorHandshakeConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpInviteOrganizationToTransferResponsibility struct { -} - -func (*awsAwsjson11_deserializeOpInviteOrganizationToTransferResponsibility) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpInviteOrganizationToTransferResponsibility) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorInviteOrganizationToTransferResponsibility(response, &metadata) - } - output := &InviteOrganizationToTransferResponsibilityOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentInviteOrganizationToTransferResponsibilityOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorInviteOrganizationToTransferResponsibility(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("DuplicateHandshakeException", errorCode): - return awsAwsjson11_deserializeErrorDuplicateHandshakeException(response, errorBody) - - case strings.EqualFold("HandshakeConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorHandshakeConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpLeaveOrganization struct { -} - -func (*awsAwsjson11_deserializeOpLeaveOrganization) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpLeaveOrganization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorLeaveOrganization(response, &metadata) - } - output := &LeaveOrganizationOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorLeaveOrganization(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("AccountNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorAccountNotFoundException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("MasterCannotLeaveOrganizationException", errorCode): - return awsAwsjson11_deserializeErrorMasterCannotLeaveOrganizationException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListAccounts struct { -} - -func (*awsAwsjson11_deserializeOpListAccounts) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListAccounts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListAccounts(response, &metadata) - } - output := &ListAccountsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListAccountsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListAccounts(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListAccountsForParent struct { -} - -func (*awsAwsjson11_deserializeOpListAccountsForParent) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListAccountsForParent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListAccountsForParent(response, &metadata) - } - output := &ListAccountsForParentOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListAccountsForParentOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListAccountsForParent(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ParentNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorParentNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListAccountsWithInvalidEffectivePolicy struct { -} - -func (*awsAwsjson11_deserializeOpListAccountsWithInvalidEffectivePolicy) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListAccountsWithInvalidEffectivePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListAccountsWithInvalidEffectivePolicy(response, &metadata) - } - output := &ListAccountsWithInvalidEffectivePolicyOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListAccountsWithInvalidEffectivePolicyOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListAccountsWithInvalidEffectivePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("EffectivePolicyNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEffectivePolicyNotFoundException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListAWSServiceAccessForOrganization struct { -} - -func (*awsAwsjson11_deserializeOpListAWSServiceAccessForOrganization) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListAWSServiceAccessForOrganization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListAWSServiceAccessForOrganization(response, &metadata) - } - output := &ListAWSServiceAccessForOrganizationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListAWSServiceAccessForOrganizationOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListAWSServiceAccessForOrganization(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListChildren struct { -} - -func (*awsAwsjson11_deserializeOpListChildren) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListChildren) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListChildren(response, &metadata) - } - output := &ListChildrenOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListChildrenOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListChildren(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ParentNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorParentNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListCreateAccountStatus struct { -} - -func (*awsAwsjson11_deserializeOpListCreateAccountStatus) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListCreateAccountStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListCreateAccountStatus(response, &metadata) - } - output := &ListCreateAccountStatusOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListCreateAccountStatusOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListCreateAccountStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListDelegatedAdministrators struct { -} - -func (*awsAwsjson11_deserializeOpListDelegatedAdministrators) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListDelegatedAdministrators) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListDelegatedAdministrators(response, &metadata) - } - output := &ListDelegatedAdministratorsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListDelegatedAdministratorsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListDelegatedAdministrators(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListDelegatedServicesForAccount struct { -} - -func (*awsAwsjson11_deserializeOpListDelegatedServicesForAccount) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListDelegatedServicesForAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListDelegatedServicesForAccount(response, &metadata) - } - output := &ListDelegatedServicesForAccountOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListDelegatedServicesForAccountOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListDelegatedServicesForAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("AccountNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorAccountNotFoundException(response, errorBody) - - case strings.EqualFold("AccountNotRegisteredException", errorCode): - return awsAwsjson11_deserializeErrorAccountNotRegisteredException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListEffectivePolicyValidationErrors struct { -} - -func (*awsAwsjson11_deserializeOpListEffectivePolicyValidationErrors) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListEffectivePolicyValidationErrors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListEffectivePolicyValidationErrors(response, &metadata) - } - output := &ListEffectivePolicyValidationErrorsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListEffectivePolicyValidationErrorsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListEffectivePolicyValidationErrors(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("AccountNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorAccountNotFoundException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("EffectivePolicyNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEffectivePolicyNotFoundException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListHandshakesForAccount struct { -} - -func (*awsAwsjson11_deserializeOpListHandshakesForAccount) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListHandshakesForAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListHandshakesForAccount(response, &metadata) - } - output := &ListHandshakesForAccountOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListHandshakesForAccountOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListHandshakesForAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListHandshakesForOrganization struct { -} - -func (*awsAwsjson11_deserializeOpListHandshakesForOrganization) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListHandshakesForOrganization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListHandshakesForOrganization(response, &metadata) - } - output := &ListHandshakesForOrganizationOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListHandshakesForOrganizationOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListHandshakesForOrganization(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListInboundResponsibilityTransfers struct { -} - -func (*awsAwsjson11_deserializeOpListInboundResponsibilityTransfers) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListInboundResponsibilityTransfers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListInboundResponsibilityTransfers(response, &metadata) - } - output := &ListInboundResponsibilityTransfersOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListInboundResponsibilityTransfersOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListInboundResponsibilityTransfers(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ResponsibilityTransferNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResponsibilityTransferNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListOrganizationalUnitsForParent struct { -} - -func (*awsAwsjson11_deserializeOpListOrganizationalUnitsForParent) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListOrganizationalUnitsForParent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListOrganizationalUnitsForParent(response, &metadata) - } - output := &ListOrganizationalUnitsForParentOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListOrganizationalUnitsForParentOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListOrganizationalUnitsForParent(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ParentNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorParentNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListOutboundResponsibilityTransfers struct { -} - -func (*awsAwsjson11_deserializeOpListOutboundResponsibilityTransfers) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListOutboundResponsibilityTransfers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListOutboundResponsibilityTransfers(response, &metadata) - } - output := &ListOutboundResponsibilityTransfersOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListOutboundResponsibilityTransfersOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListOutboundResponsibilityTransfers(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListParents struct { -} - -func (*awsAwsjson11_deserializeOpListParents) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListParents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListParents(response, &metadata) - } - output := &ListParentsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListParentsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListParents(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ChildNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorChildNotFoundException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListPolicies struct { -} - -func (*awsAwsjson11_deserializeOpListPolicies) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListPolicies(response, &metadata) - } - output := &ListPoliciesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListPoliciesOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListPoliciesForTarget struct { -} - -func (*awsAwsjson11_deserializeOpListPoliciesForTarget) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListPoliciesForTarget) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListPoliciesForTarget(response, &metadata) - } - output := &ListPoliciesForTargetOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListPoliciesForTargetOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListPoliciesForTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TargetNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorTargetNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListRoots struct { -} - -func (*awsAwsjson11_deserializeOpListRoots) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListRoots) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListRoots(response, &metadata) - } - output := &ListRootsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListRootsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListRoots(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListTagsForResource struct { -} - -func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) - } - output := &ListTagsForResourceOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TargetNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorTargetNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListTargetsForPolicy struct { -} - -func (*awsAwsjson11_deserializeOpListTargetsForPolicy) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListTargetsForPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListTargetsForPolicy(response, &metadata) - } - output := &ListTargetsForPolicyOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListTargetsForPolicyOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorListTargetsForPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("PolicyNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorPolicyNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpMoveAccount struct { -} - -func (*awsAwsjson11_deserializeOpMoveAccount) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpMoveAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorMoveAccount(response, &metadata) - } - output := &MoveAccountOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorMoveAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("AccountNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorAccountNotFoundException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("DestinationParentNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorDestinationParentNotFoundException(response, errorBody) - - case strings.EqualFold("DuplicateAccountException", errorCode): - return awsAwsjson11_deserializeErrorDuplicateAccountException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("SourceParentNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorSourceParentNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpPutResourcePolicy struct { -} - -func (*awsAwsjson11_deserializeOpPutResourcePolicy) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpPutResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutResourcePolicy(response, &metadata) - } - output := &PutResourcePolicyOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentPutResourcePolicyOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpRegisterDelegatedAdministrator struct { -} - -func (*awsAwsjson11_deserializeOpRegisterDelegatedAdministrator) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpRegisterDelegatedAdministrator) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorRegisterDelegatedAdministrator(response, &metadata) - } - output := &RegisterDelegatedAdministratorOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorRegisterDelegatedAdministrator(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("AccountAlreadyRegisteredException", errorCode): - return awsAwsjson11_deserializeErrorAccountAlreadyRegisteredException(response, errorBody) - - case strings.EqualFold("AccountNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorAccountNotFoundException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpRemoveAccountFromOrganization struct { -} - -func (*awsAwsjson11_deserializeOpRemoveAccountFromOrganization) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpRemoveAccountFromOrganization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorRemoveAccountFromOrganization(response, &metadata) - } - output := &RemoveAccountFromOrganizationOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorRemoveAccountFromOrganization(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("AccountNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorAccountNotFoundException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("MasterCannotLeaveOrganizationException", errorCode): - return awsAwsjson11_deserializeErrorMasterCannotLeaveOrganizationException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpTagResource struct { -} - -func (*awsAwsjson11_deserializeOpTagResource) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) - } - output := &TagResourceOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TargetNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorTargetNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpTerminateResponsibilityTransfer struct { -} - -func (*awsAwsjson11_deserializeOpTerminateResponsibilityTransfer) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpTerminateResponsibilityTransfer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorTerminateResponsibilityTransfer(response, &metadata) - } - output := &TerminateResponsibilityTransferOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentTerminateResponsibilityTransferOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorTerminateResponsibilityTransfer(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("InvalidResponsibilityTransferTransitionException", errorCode): - return awsAwsjson11_deserializeErrorInvalidResponsibilityTransferTransitionException(response, errorBody) - - case strings.EqualFold("ResponsibilityTransferAlreadyInStatusException", errorCode): - return awsAwsjson11_deserializeErrorResponsibilityTransferAlreadyInStatusException(response, errorBody) - - case strings.EqualFold("ResponsibilityTransferNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResponsibilityTransferNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpUntagResource struct { -} - -func (*awsAwsjson11_deserializeOpUntagResource) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) - } - output := &UntagResourceOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TargetNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorTargetNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpUpdateOrganizationalUnit struct { -} - -func (*awsAwsjson11_deserializeOpUpdateOrganizationalUnit) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpUpdateOrganizationalUnit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateOrganizationalUnit(response, &metadata) - } - output := &UpdateOrganizationalUnitOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentUpdateOrganizationalUnitOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorUpdateOrganizationalUnit(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("DuplicateOrganizationalUnitException", errorCode): - return awsAwsjson11_deserializeErrorDuplicateOrganizationalUnitException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("OrganizationalUnitNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorOrganizationalUnitNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpUpdatePolicy struct { -} - -func (*awsAwsjson11_deserializeOpUpdatePolicy) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpUpdatePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdatePolicy(response, &metadata) - } - output := &UpdatePolicyOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentUpdatePolicyOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorUpdatePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConcurrentModificationException", errorCode): - return awsAwsjson11_deserializeErrorConcurrentModificationException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("DuplicatePolicyException", errorCode): - return awsAwsjson11_deserializeErrorDuplicatePolicyException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("MalformedPolicyDocumentException", errorCode): - return awsAwsjson11_deserializeErrorMalformedPolicyDocumentException(response, errorBody) - - case strings.EqualFold("PolicyChangesInProgressException", errorCode): - return awsAwsjson11_deserializeErrorPolicyChangesInProgressException(response, errorBody) - - case strings.EqualFold("PolicyNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorPolicyNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpUpdateResponsibilityTransfer struct { -} - -func (*awsAwsjson11_deserializeOpUpdateResponsibilityTransfer) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpUpdateResponsibilityTransfer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateResponsibilityTransfer(response, &metadata) - } - output := &UpdateResponsibilityTransferOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentUpdateResponsibilityTransferOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorUpdateResponsibilityTransfer(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - bodyInfo, err := getProtocolErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { - errorCode = restjson.SanitizeErrorCode(typ) - } - if len(bodyInfo.Message) != 0 { - errorMessage = bodyInfo.Message - } - switch { - case strings.EqualFold("AWSOrganizationsNotInUseException", errorCode): - return awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response, errorBody) - - case strings.EqualFold("AccessDeniedException", errorCode): - return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) - - case strings.EqualFold("ConstraintViolationException", errorCode): - return awsAwsjson11_deserializeErrorConstraintViolationException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("ResponsibilityTransferNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResponsibilityTransferNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceException", errorCode): - return awsAwsjson11_deserializeErrorServiceException(response, errorBody) - - case strings.EqualFold("TooManyRequestsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) - - case strings.EqualFold("UnsupportedAPIEndpointException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsAwsjson11_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.AccessDeniedException{} - err := awsAwsjson11_deserializeDocumentAccessDeniedException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorAccessDeniedForDependencyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.AccessDeniedForDependencyException{} - err := awsAwsjson11_deserializeDocumentAccessDeniedForDependencyException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorAccountAlreadyClosedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.AccountAlreadyClosedException{} - err := awsAwsjson11_deserializeDocumentAccountAlreadyClosedException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorAccountAlreadyRegisteredException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.AccountAlreadyRegisteredException{} - err := awsAwsjson11_deserializeDocumentAccountAlreadyRegisteredException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorAccountNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.AccountNotFoundException{} - err := awsAwsjson11_deserializeDocumentAccountNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorAccountNotRegisteredException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.AccountNotRegisteredException{} - err := awsAwsjson11_deserializeDocumentAccountNotRegisteredException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorAccountOwnerNotVerifiedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.AccountOwnerNotVerifiedException{} - err := awsAwsjson11_deserializeDocumentAccountOwnerNotVerifiedException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorAlreadyInOrganizationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.AlreadyInOrganizationException{} - err := awsAwsjson11_deserializeDocumentAlreadyInOrganizationException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorAWSOrganizationsNotInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.AWSOrganizationsNotInUseException{} - err := awsAwsjson11_deserializeDocumentAWSOrganizationsNotInUseException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorChildNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.ChildNotFoundException{} - err := awsAwsjson11_deserializeDocumentChildNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorConcurrentModificationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.ConcurrentModificationException{} - err := awsAwsjson11_deserializeDocumentConcurrentModificationException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.ConflictException{} - err := awsAwsjson11_deserializeDocumentConflictException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorConstraintViolationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.ConstraintViolationException{} - err := awsAwsjson11_deserializeDocumentConstraintViolationException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorCreateAccountStatusNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.CreateAccountStatusNotFoundException{} - err := awsAwsjson11_deserializeDocumentCreateAccountStatusNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorDestinationParentNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.DestinationParentNotFoundException{} - err := awsAwsjson11_deserializeDocumentDestinationParentNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorDuplicateAccountException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.DuplicateAccountException{} - err := awsAwsjson11_deserializeDocumentDuplicateAccountException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorDuplicateHandshakeException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.DuplicateHandshakeException{} - err := awsAwsjson11_deserializeDocumentDuplicateHandshakeException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorDuplicateOrganizationalUnitException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.DuplicateOrganizationalUnitException{} - err := awsAwsjson11_deserializeDocumentDuplicateOrganizationalUnitException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorDuplicatePolicyAttachmentException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.DuplicatePolicyAttachmentException{} - err := awsAwsjson11_deserializeDocumentDuplicatePolicyAttachmentException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorDuplicatePolicyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.DuplicatePolicyException{} - err := awsAwsjson11_deserializeDocumentDuplicatePolicyException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorEffectivePolicyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.EffectivePolicyNotFoundException{} - err := awsAwsjson11_deserializeDocumentEffectivePolicyNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorFinalizingOrganizationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.FinalizingOrganizationException{} - err := awsAwsjson11_deserializeDocumentFinalizingOrganizationException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorHandshakeAlreadyInStateException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.HandshakeAlreadyInStateException{} - err := awsAwsjson11_deserializeDocumentHandshakeAlreadyInStateException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorHandshakeConstraintViolationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.HandshakeConstraintViolationException{} - err := awsAwsjson11_deserializeDocumentHandshakeConstraintViolationException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorHandshakeNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.HandshakeNotFoundException{} - err := awsAwsjson11_deserializeDocumentHandshakeNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorInvalidHandshakeTransitionException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.InvalidHandshakeTransitionException{} - err := awsAwsjson11_deserializeDocumentInvalidHandshakeTransitionException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorInvalidInputException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.InvalidInputException{} - err := awsAwsjson11_deserializeDocumentInvalidInputException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorInvalidResponsibilityTransferTransitionException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.InvalidResponsibilityTransferTransitionException{} - err := awsAwsjson11_deserializeDocumentInvalidResponsibilityTransferTransitionException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorMalformedPolicyDocumentException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.MalformedPolicyDocumentException{} - err := awsAwsjson11_deserializeDocumentMalformedPolicyDocumentException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorMasterCannotLeaveOrganizationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.MasterCannotLeaveOrganizationException{} - err := awsAwsjson11_deserializeDocumentMasterCannotLeaveOrganizationException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorOrganizationalUnitNotEmptyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.OrganizationalUnitNotEmptyException{} - err := awsAwsjson11_deserializeDocumentOrganizationalUnitNotEmptyException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorOrganizationalUnitNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.OrganizationalUnitNotFoundException{} - err := awsAwsjson11_deserializeDocumentOrganizationalUnitNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorOrganizationNotEmptyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.OrganizationNotEmptyException{} - err := awsAwsjson11_deserializeDocumentOrganizationNotEmptyException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorParentNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.ParentNotFoundException{} - err := awsAwsjson11_deserializeDocumentParentNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorPolicyChangesInProgressException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.PolicyChangesInProgressException{} - err := awsAwsjson11_deserializeDocumentPolicyChangesInProgressException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorPolicyInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.PolicyInUseException{} - err := awsAwsjson11_deserializeDocumentPolicyInUseException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorPolicyNotAttachedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.PolicyNotAttachedException{} - err := awsAwsjson11_deserializeDocumentPolicyNotAttachedException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorPolicyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.PolicyNotFoundException{} - err := awsAwsjson11_deserializeDocumentPolicyNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorPolicyTypeAlreadyEnabledException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.PolicyTypeAlreadyEnabledException{} - err := awsAwsjson11_deserializeDocumentPolicyTypeAlreadyEnabledException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorPolicyTypeNotAvailableForOrganizationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.PolicyTypeNotAvailableForOrganizationException{} - err := awsAwsjson11_deserializeDocumentPolicyTypeNotAvailableForOrganizationException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorPolicyTypeNotEnabledException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.PolicyTypeNotEnabledException{} - err := awsAwsjson11_deserializeDocumentPolicyTypeNotEnabledException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorResourcePolicyNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.ResourcePolicyNotFoundException{} - err := awsAwsjson11_deserializeDocumentResourcePolicyNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorResponsibilityTransferAlreadyInStatusException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.ResponsibilityTransferAlreadyInStatusException{} - err := awsAwsjson11_deserializeDocumentResponsibilityTransferAlreadyInStatusException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorResponsibilityTransferNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.ResponsibilityTransferNotFoundException{} - err := awsAwsjson11_deserializeDocumentResponsibilityTransferNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorRootNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.RootNotFoundException{} - err := awsAwsjson11_deserializeDocumentRootNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorServiceException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.ServiceException{} - err := awsAwsjson11_deserializeDocumentServiceException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorSourceParentNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.SourceParentNotFoundException{} - err := awsAwsjson11_deserializeDocumentSourceParentNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorTargetNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.TargetNotFoundException{} - err := awsAwsjson11_deserializeDocumentTargetNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.TooManyRequestsException{} - err := awsAwsjson11_deserializeDocumentTooManyRequestsException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorUnsupportedAPIEndpointException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.UnsupportedAPIEndpointException{} - err := awsAwsjson11_deserializeDocumentUnsupportedAPIEndpointException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AccessDeniedException - if *v == nil { - sv = &types.AccessDeniedException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentAccessDeniedForDependencyException(v **types.AccessDeniedForDependencyException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AccessDeniedForDependencyException - if *v == nil { - sv = &types.AccessDeniedForDependencyException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "Reason": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccessDeniedForDependencyExceptionReason to be of type string, got %T instead", value) - } - sv.Reason = types.AccessDeniedForDependencyExceptionReason(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentAccount(v **types.Account, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Account - if *v == nil { - sv = &types.Account{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "Email": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Email to be of type string, got %T instead", value) - } - sv.Email = ptr.String(jtv) - } - - case "Id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "JoinedMethod": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountJoinedMethod to be of type string, got %T instead", value) - } - sv.JoinedMethod = types.AccountJoinedMethod(jtv) - } - - case "JoinedTimestamp": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.JoinedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "Paths": - if err := awsAwsjson11_deserializeDocumentPaths(&sv.Paths, value); err != nil { - return err - } - - case "State": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountState to be of type string, got %T instead", value) - } - sv.State = types.AccountState(jtv) - } - - case "Status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountStatus to be of type string, got %T instead", value) - } - sv.Status = types.AccountStatus(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentAccountAlreadyClosedException(v **types.AccountAlreadyClosedException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AccountAlreadyClosedException - if *v == nil { - sv = &types.AccountAlreadyClosedException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentAccountAlreadyRegisteredException(v **types.AccountAlreadyRegisteredException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AccountAlreadyRegisteredException - if *v == nil { - sv = &types.AccountAlreadyRegisteredException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentAccountNotFoundException(v **types.AccountNotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AccountNotFoundException - if *v == nil { - sv = &types.AccountNotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentAccountNotRegisteredException(v **types.AccountNotRegisteredException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AccountNotRegisteredException - if *v == nil { - sv = &types.AccountNotRegisteredException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentAccountOwnerNotVerifiedException(v **types.AccountOwnerNotVerifiedException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AccountOwnerNotVerifiedException - if *v == nil { - sv = &types.AccountOwnerNotVerifiedException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentAccounts(v *[]types.Account, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.Account - if *v == nil { - cv = []types.Account{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.Account - destAddr := &col - if err := awsAwsjson11_deserializeDocumentAccount(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentAlreadyInOrganizationException(v **types.AlreadyInOrganizationException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AlreadyInOrganizationException - if *v == nil { - sv = &types.AlreadyInOrganizationException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentAWSOrganizationsNotInUseException(v **types.AWSOrganizationsNotInUseException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AWSOrganizationsNotInUseException - if *v == nil { - sv = &types.AWSOrganizationsNotInUseException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentChild(v **types.Child, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Child - if *v == nil { - sv = &types.Child{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ChildId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "Type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ChildType to be of type string, got %T instead", value) - } - sv.Type = types.ChildType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentChildNotFoundException(v **types.ChildNotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ChildNotFoundException - if *v == nil { - sv = &types.ChildNotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentChildren(v *[]types.Child, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.Child - if *v == nil { - cv = []types.Child{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.Child - destAddr := &col - if err := awsAwsjson11_deserializeDocumentChild(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentConcurrentModificationException(v **types.ConcurrentModificationException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ConcurrentModificationException - if *v == nil { - sv = &types.ConcurrentModificationException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ConflictException - if *v == nil { - sv = &types.ConflictException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentConstraintViolationException(v **types.ConstraintViolationException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ConstraintViolationException - if *v == nil { - sv = &types.ConstraintViolationException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "Reason": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ConstraintViolationExceptionReason to be of type string, got %T instead", value) - } - sv.Reason = types.ConstraintViolationExceptionReason(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCreateAccountStatus(v **types.CreateAccountStatus, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CreateAccountStatus - if *v == nil { - sv = &types.CreateAccountStatus{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AccountId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) - } - sv.AccountId = ptr.String(jtv) - } - - case "AccountName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CreateAccountName to be of type string, got %T instead", value) - } - sv.AccountName = ptr.String(jtv) - } - - case "CompletedTimestamp": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CompletedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "FailureReason": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CreateAccountFailureReason to be of type string, got %T instead", value) - } - sv.FailureReason = types.CreateAccountFailureReason(jtv) - } - - case "GovCloudAccountId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) - } - sv.GovCloudAccountId = ptr.String(jtv) - } - - case "Id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CreateAccountRequestId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "RequestedTimestamp": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.RequestedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "State": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CreateAccountState to be of type string, got %T instead", value) - } - sv.State = types.CreateAccountState(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentCreateAccountStatuses(v *[]types.CreateAccountStatus, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.CreateAccountStatus - if *v == nil { - cv = []types.CreateAccountStatus{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.CreateAccountStatus - destAddr := &col - if err := awsAwsjson11_deserializeDocumentCreateAccountStatus(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentCreateAccountStatusNotFoundException(v **types.CreateAccountStatusNotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.CreateAccountStatusNotFoundException - if *v == nil { - sv = &types.CreateAccountStatusNotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentDelegatedAdministrator(v **types.DelegatedAdministrator, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.DelegatedAdministrator - if *v == nil { - sv = &types.DelegatedAdministrator{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "DelegationEnabledDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.DelegationEnabledDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "Email": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Email to be of type string, got %T instead", value) - } - sv.Email = ptr.String(jtv) - } - - case "Id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "JoinedMethod": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountJoinedMethod to be of type string, got %T instead", value) - } - sv.JoinedMethod = types.AccountJoinedMethod(jtv) - } - - case "JoinedTimestamp": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.JoinedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "State": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountState to be of type string, got %T instead", value) - } - sv.State = types.AccountState(jtv) - } - - case "Status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountStatus to be of type string, got %T instead", value) - } - sv.Status = types.AccountStatus(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentDelegatedAdministrators(v *[]types.DelegatedAdministrator, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.DelegatedAdministrator - if *v == nil { - cv = []types.DelegatedAdministrator{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.DelegatedAdministrator - destAddr := &col - if err := awsAwsjson11_deserializeDocumentDelegatedAdministrator(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentDelegatedService(v **types.DelegatedService, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.DelegatedService - if *v == nil { - sv = &types.DelegatedService{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "DelegationEnabledDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.DelegationEnabledDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "ServicePrincipal": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ServicePrincipal to be of type string, got %T instead", value) - } - sv.ServicePrincipal = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentDelegatedServices(v *[]types.DelegatedService, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.DelegatedService - if *v == nil { - cv = []types.DelegatedService{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.DelegatedService - destAddr := &col - if err := awsAwsjson11_deserializeDocumentDelegatedService(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentDestinationParentNotFoundException(v **types.DestinationParentNotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.DestinationParentNotFoundException - if *v == nil { - sv = &types.DestinationParentNotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentDuplicateAccountException(v **types.DuplicateAccountException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.DuplicateAccountException - if *v == nil { - sv = &types.DuplicateAccountException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentDuplicateHandshakeException(v **types.DuplicateHandshakeException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.DuplicateHandshakeException - if *v == nil { - sv = &types.DuplicateHandshakeException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentDuplicateOrganizationalUnitException(v **types.DuplicateOrganizationalUnitException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.DuplicateOrganizationalUnitException - if *v == nil { - sv = &types.DuplicateOrganizationalUnitException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentDuplicatePolicyAttachmentException(v **types.DuplicatePolicyAttachmentException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.DuplicatePolicyAttachmentException - if *v == nil { - sv = &types.DuplicatePolicyAttachmentException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentDuplicatePolicyException(v **types.DuplicatePolicyException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.DuplicatePolicyException - if *v == nil { - sv = &types.DuplicatePolicyException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentEffectivePolicy(v **types.EffectivePolicy, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.EffectivePolicy - if *v == nil { - sv = &types.EffectivePolicy{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "LastUpdatedTimestamp": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastUpdatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "PolicyContent": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PolicyContent to be of type string, got %T instead", value) - } - sv.PolicyContent = ptr.String(jtv) - } - - case "PolicyType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EffectivePolicyType to be of type string, got %T instead", value) - } - sv.PolicyType = types.EffectivePolicyType(jtv) - } - - case "TargetId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PolicyTargetId to be of type string, got %T instead", value) - } - sv.TargetId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentEffectivePolicyNotFoundException(v **types.EffectivePolicyNotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.EffectivePolicyNotFoundException - if *v == nil { - sv = &types.EffectivePolicyNotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentEffectivePolicyValidationError(v **types.EffectivePolicyValidationError, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.EffectivePolicyValidationError - if *v == nil { - sv = &types.EffectivePolicyValidationError{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "ContributingPolicies": - if err := awsAwsjson11_deserializeDocumentPolicyIds(&sv.ContributingPolicies, value); err != nil { - return err - } - - case "ErrorCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) - } - sv.ErrorCode = ptr.String(jtv) - } - - case "ErrorMessage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.ErrorMessage = ptr.String(jtv) - } - - case "PathToError": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PathToError to be of type string, got %T instead", value) - } - sv.PathToError = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentEffectivePolicyValidationErrors(v *[]types.EffectivePolicyValidationError, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.EffectivePolicyValidationError - if *v == nil { - cv = []types.EffectivePolicyValidationError{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.EffectivePolicyValidationError - destAddr := &col - if err := awsAwsjson11_deserializeDocumentEffectivePolicyValidationError(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentEnabledServicePrincipal(v **types.EnabledServicePrincipal, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.EnabledServicePrincipal - if *v == nil { - sv = &types.EnabledServicePrincipal{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "DateEnabled": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.DateEnabled = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "ServicePrincipal": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ServicePrincipal to be of type string, got %T instead", value) - } - sv.ServicePrincipal = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentEnabledServicePrincipals(v *[]types.EnabledServicePrincipal, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.EnabledServicePrincipal - if *v == nil { - cv = []types.EnabledServicePrincipal{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.EnabledServicePrincipal - destAddr := &col - if err := awsAwsjson11_deserializeDocumentEnabledServicePrincipal(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentFinalizingOrganizationException(v **types.FinalizingOrganizationException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.FinalizingOrganizationException - if *v == nil { - sv = &types.FinalizingOrganizationException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentHandshake(v **types.Handshake, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Handshake - if *v == nil { - sv = &types.Handshake{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Action": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ActionType to be of type string, got %T instead", value) - } - sv.Action = types.ActionType(jtv) - } - - case "Arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected HandshakeArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "ExpirationTimestamp": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.ExpirationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "Id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected HandshakeId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "Parties": - if err := awsAwsjson11_deserializeDocumentHandshakeParties(&sv.Parties, value); err != nil { - return err - } - - case "RequestedTimestamp": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.RequestedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "Resources": - if err := awsAwsjson11_deserializeDocumentHandshakeResources(&sv.Resources, value); err != nil { - return err - } - - case "State": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected HandshakeState to be of type string, got %T instead", value) - } - sv.State = types.HandshakeState(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentHandshakeAlreadyInStateException(v **types.HandshakeAlreadyInStateException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.HandshakeAlreadyInStateException - if *v == nil { - sv = &types.HandshakeAlreadyInStateException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentHandshakeConstraintViolationException(v **types.HandshakeConstraintViolationException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.HandshakeConstraintViolationException - if *v == nil { - sv = &types.HandshakeConstraintViolationException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "Reason": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected HandshakeConstraintViolationExceptionReason to be of type string, got %T instead", value) - } - sv.Reason = types.HandshakeConstraintViolationExceptionReason(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentHandshakeNotFoundException(v **types.HandshakeNotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.HandshakeNotFoundException - if *v == nil { - sv = &types.HandshakeNotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentHandshakeParties(v *[]types.HandshakeParty, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.HandshakeParty - if *v == nil { - cv = []types.HandshakeParty{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.HandshakeParty - destAddr := &col - if err := awsAwsjson11_deserializeDocumentHandshakeParty(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentHandshakeParty(v **types.HandshakeParty, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.HandshakeParty - if *v == nil { - sv = &types.HandshakeParty{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected HandshakePartyId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "Type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected HandshakePartyType to be of type string, got %T instead", value) - } - sv.Type = types.HandshakePartyType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentHandshakeResource(v **types.HandshakeResource, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.HandshakeResource - if *v == nil { - sv = &types.HandshakeResource{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Resources": - if err := awsAwsjson11_deserializeDocumentHandshakeResources(&sv.Resources, value); err != nil { - return err - } - - case "Type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected HandshakeResourceType to be of type string, got %T instead", value) - } - sv.Type = types.HandshakeResourceType(jtv) - } - - case "Value": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected HandshakeResourceValue to be of type string, got %T instead", value) - } - sv.Value = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentHandshakeResources(v *[]types.HandshakeResource, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.HandshakeResource - if *v == nil { - cv = []types.HandshakeResource{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.HandshakeResource - destAddr := &col - if err := awsAwsjson11_deserializeDocumentHandshakeResource(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentHandshakes(v *[]types.Handshake, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.Handshake - if *v == nil { - cv = []types.Handshake{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.Handshake - destAddr := &col - if err := awsAwsjson11_deserializeDocumentHandshake(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentInvalidHandshakeTransitionException(v **types.InvalidHandshakeTransitionException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InvalidHandshakeTransitionException - if *v == nil { - sv = &types.InvalidHandshakeTransitionException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentInvalidInputException(v **types.InvalidInputException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InvalidInputException - if *v == nil { - sv = &types.InvalidInputException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "Reason": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected InvalidInputExceptionReason to be of type string, got %T instead", value) - } - sv.Reason = types.InvalidInputExceptionReason(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentInvalidResponsibilityTransferTransitionException(v **types.InvalidResponsibilityTransferTransitionException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InvalidResponsibilityTransferTransitionException - if *v == nil { - sv = &types.InvalidResponsibilityTransferTransitionException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentMalformedPolicyDocumentException(v **types.MalformedPolicyDocumentException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.MalformedPolicyDocumentException - if *v == nil { - sv = &types.MalformedPolicyDocumentException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentMasterCannotLeaveOrganizationException(v **types.MasterCannotLeaveOrganizationException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.MasterCannotLeaveOrganizationException - if *v == nil { - sv = &types.MasterCannotLeaveOrganizationException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentOrganization(v **types.Organization, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Organization - if *v == nil { - sv = &types.Organization{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OrganizationArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "AvailablePolicyTypes": - if err := awsAwsjson11_deserializeDocumentPolicyTypes(&sv.AvailablePolicyTypes, value); err != nil { - return err - } - - case "FeatureSet": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OrganizationFeatureSet to be of type string, got %T instead", value) - } - sv.FeatureSet = types.OrganizationFeatureSet(jtv) - } - - case "Id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OrganizationId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "MasterAccountArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountArn to be of type string, got %T instead", value) - } - sv.MasterAccountArn = ptr.String(jtv) - } - - case "MasterAccountEmail": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Email to be of type string, got %T instead", value) - } - sv.MasterAccountEmail = ptr.String(jtv) - } - - case "MasterAccountId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) - } - sv.MasterAccountId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentOrganizationalUnit(v **types.OrganizationalUnit, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.OrganizationalUnit - if *v == nil { - sv = &types.OrganizationalUnit{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OrganizationalUnitArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "Id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OrganizationalUnitId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected OrganizationalUnitName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "Path": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Path to be of type string, got %T instead", value) - } - sv.Path = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentOrganizationalUnitNotEmptyException(v **types.OrganizationalUnitNotEmptyException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.OrganizationalUnitNotEmptyException - if *v == nil { - sv = &types.OrganizationalUnitNotEmptyException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentOrganizationalUnitNotFoundException(v **types.OrganizationalUnitNotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.OrganizationalUnitNotFoundException - if *v == nil { - sv = &types.OrganizationalUnitNotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentOrganizationalUnits(v *[]types.OrganizationalUnit, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.OrganizationalUnit - if *v == nil { - cv = []types.OrganizationalUnit{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.OrganizationalUnit - destAddr := &col - if err := awsAwsjson11_deserializeDocumentOrganizationalUnit(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentOrganizationNotEmptyException(v **types.OrganizationNotEmptyException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.OrganizationNotEmptyException - if *v == nil { - sv = &types.OrganizationNotEmptyException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentParent(v **types.Parent, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Parent - if *v == nil { - sv = &types.Parent{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ParentId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "Type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ParentType to be of type string, got %T instead", value) - } - sv.Type = types.ParentType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentParentNotFoundException(v **types.ParentNotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ParentNotFoundException - if *v == nil { - sv = &types.ParentNotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentParents(v *[]types.Parent, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.Parent - if *v == nil { - cv = []types.Parent{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.Parent - destAddr := &col - if err := awsAwsjson11_deserializeDocumentParent(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentPaths(v *[]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []string - if *v == nil { - cv = []string{} - } else { - cv = *v - } - - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Path to be of type string, got %T instead", value) - } - col = jtv - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentPolicies(v *[]types.PolicySummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.PolicySummary - if *v == nil { - cv = []types.PolicySummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.PolicySummary - destAddr := &col - if err := awsAwsjson11_deserializeDocumentPolicySummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentPolicy(v **types.Policy, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Policy - if *v == nil { - sv = &types.Policy{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Content": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PolicyContent to be of type string, got %T instead", value) - } - sv.Content = ptr.String(jtv) - } - - case "PolicySummary": - if err := awsAwsjson11_deserializeDocumentPolicySummary(&sv.PolicySummary, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentPolicyChangesInProgressException(v **types.PolicyChangesInProgressException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.PolicyChangesInProgressException - if *v == nil { - sv = &types.PolicyChangesInProgressException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentPolicyIds(v *[]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []string - if *v == nil { - cv = []string{} - } else { - cv = *v - } - - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PolicyId to be of type string, got %T instead", value) - } - col = jtv - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentPolicyInUseException(v **types.PolicyInUseException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.PolicyInUseException - if *v == nil { - sv = &types.PolicyInUseException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentPolicyNotAttachedException(v **types.PolicyNotAttachedException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.PolicyNotAttachedException - if *v == nil { - sv = &types.PolicyNotAttachedException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentPolicyNotFoundException(v **types.PolicyNotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.PolicyNotFoundException - if *v == nil { - sv = &types.PolicyNotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentPolicySummary(v **types.PolicySummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.PolicySummary - if *v == nil { - sv = &types.PolicySummary{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PolicyArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "AwsManaged": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected AwsManagedPolicy to be of type *bool, got %T instead", value) - } - sv.AwsManaged = jtv - } - - case "Description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PolicyDescription to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "Id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PolicyId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "Type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PolicyType to be of type string, got %T instead", value) - } - sv.Type = types.PolicyType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentPolicyTargets(v *[]types.PolicyTargetSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.PolicyTargetSummary - if *v == nil { - cv = []types.PolicyTargetSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.PolicyTargetSummary - destAddr := &col - if err := awsAwsjson11_deserializeDocumentPolicyTargetSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentPolicyTargetSummary(v **types.PolicyTargetSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.PolicyTargetSummary - if *v == nil { - sv = &types.PolicyTargetSummary{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenericArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TargetName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "TargetId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PolicyTargetId to be of type string, got %T instead", value) - } - sv.TargetId = ptr.String(jtv) - } - - case "Type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TargetType to be of type string, got %T instead", value) - } - sv.Type = types.TargetType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentPolicyTypeAlreadyEnabledException(v **types.PolicyTypeAlreadyEnabledException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.PolicyTypeAlreadyEnabledException - if *v == nil { - sv = &types.PolicyTypeAlreadyEnabledException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentPolicyTypeNotAvailableForOrganizationException(v **types.PolicyTypeNotAvailableForOrganizationException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.PolicyTypeNotAvailableForOrganizationException - if *v == nil { - sv = &types.PolicyTypeNotAvailableForOrganizationException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentPolicyTypeNotEnabledException(v **types.PolicyTypeNotEnabledException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.PolicyTypeNotEnabledException - if *v == nil { - sv = &types.PolicyTypeNotEnabledException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentPolicyTypes(v *[]types.PolicyTypeSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.PolicyTypeSummary - if *v == nil { - cv = []types.PolicyTypeSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.PolicyTypeSummary - destAddr := &col - if err := awsAwsjson11_deserializeDocumentPolicyTypeSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentPolicyTypeSummary(v **types.PolicyTypeSummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.PolicyTypeSummary - if *v == nil { - sv = &types.PolicyTypeSummary{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PolicyTypeStatus to be of type string, got %T instead", value) - } - sv.Status = types.PolicyTypeStatus(jtv) - } - - case "Type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PolicyType to be of type string, got %T instead", value) - } - sv.Type = types.PolicyType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentResourcePolicy(v **types.ResourcePolicy, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ResourcePolicy - if *v == nil { - sv = &types.ResourcePolicy{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Content": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourcePolicyContent to be of type string, got %T instead", value) - } - sv.Content = ptr.String(jtv) - } - - case "ResourcePolicySummary": - if err := awsAwsjson11_deserializeDocumentResourcePolicySummary(&sv.ResourcePolicySummary, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentResourcePolicyNotFoundException(v **types.ResourcePolicyNotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ResourcePolicyNotFoundException - if *v == nil { - sv = &types.ResourcePolicyNotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentResourcePolicySummary(v **types.ResourcePolicySummary, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ResourcePolicySummary - if *v == nil { - sv = &types.ResourcePolicySummary{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourcePolicyArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "Id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourcePolicyId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentResponsibilityTransfer(v **types.ResponsibilityTransfer, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ResponsibilityTransfer - if *v == nil { - sv = &types.ResponsibilityTransfer{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "ActiveHandshakeId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected HandshakeId to be of type string, got %T instead", value) - } - sv.ActiveHandshakeId = ptr.String(jtv) - } - - case "Arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResponsibilityTransferArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "EndTimestamp": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.EndTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "Id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResponsibilityTransferId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResponsibilityTransferName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "Source": - if err := awsAwsjson11_deserializeDocumentTransferParticipant(&sv.Source, value); err != nil { - return err - } - - case "StartTimestamp": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.StartTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "Status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResponsibilityTransferStatus to be of type string, got %T instead", value) - } - sv.Status = types.ResponsibilityTransferStatus(jtv) - } - - case "Target": - if err := awsAwsjson11_deserializeDocumentTransferParticipant(&sv.Target, value); err != nil { - return err - } - - case "Type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResponsibilityTransferType to be of type string, got %T instead", value) - } - sv.Type = types.ResponsibilityTransferType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentResponsibilityTransferAlreadyInStatusException(v **types.ResponsibilityTransferAlreadyInStatusException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ResponsibilityTransferAlreadyInStatusException - if *v == nil { - sv = &types.ResponsibilityTransferAlreadyInStatusException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentResponsibilityTransferNotFoundException(v **types.ResponsibilityTransferNotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ResponsibilityTransferNotFoundException - if *v == nil { - sv = &types.ResponsibilityTransferNotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentResponsibilityTransfers(v *[]types.ResponsibilityTransfer, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.ResponsibilityTransfer - if *v == nil { - cv = []types.ResponsibilityTransfer{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ResponsibilityTransfer - destAddr := &col - if err := awsAwsjson11_deserializeDocumentResponsibilityTransfer(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentRoot(v **types.Root, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Root - if *v == nil { - sv = &types.Root{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RootArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "Id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RootId to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RootName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "PolicyTypes": - if err := awsAwsjson11_deserializeDocumentPolicyTypes(&sv.PolicyTypes, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentRootNotFoundException(v **types.RootNotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.RootNotFoundException - if *v == nil { - sv = &types.RootNotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentRoots(v *[]types.Root, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.Root - if *v == nil { - cv = []types.Root{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.Root - destAddr := &col - if err := awsAwsjson11_deserializeDocumentRoot(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentServiceException(v **types.ServiceException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ServiceException - if *v == nil { - sv = &types.ServiceException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentSourceParentNotFoundException(v **types.SourceParentNotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.SourceParentNotFoundException - if *v == nil { - sv = &types.SourceParentNotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.Tag - if *v == nil { - sv = &types.Tag{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Key": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) - } - sv.Key = ptr.String(jtv) - } - - case "Value": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) - } - sv.Value = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentTags(v *[]types.Tag, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.Tag - if *v == nil { - cv = []types.Tag{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.Tag - destAddr := &col - if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentTargetNotFoundException(v **types.TargetNotFoundException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.TargetNotFoundException - if *v == nil { - sv = &types.TargetNotFoundException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentTooManyRequestsException(v **types.TooManyRequestsException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.TooManyRequestsException - if *v == nil { - sv = &types.TooManyRequestsException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "Type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionType to be of type string, got %T instead", value) - } - sv.Type = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentTransferParticipant(v **types.TransferParticipant, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.TransferParticipant - if *v == nil { - sv = &types.TransferParticipant{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "ManagementAccountEmail": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Email to be of type string, got %T instead", value) - } - sv.ManagementAccountEmail = ptr.String(jtv) - } - - case "ManagementAccountId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) - } - sv.ManagementAccountId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentUnsupportedAPIEndpointException(v **types.UnsupportedAPIEndpointException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.UnsupportedAPIEndpointException - if *v == nil { - sv = &types.UnsupportedAPIEndpointException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentAcceptHandshakeOutput(v **AcceptHandshakeOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *AcceptHandshakeOutput - if *v == nil { - sv = &AcceptHandshakeOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Handshake": - if err := awsAwsjson11_deserializeDocumentHandshake(&sv.Handshake, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentCancelHandshakeOutput(v **CancelHandshakeOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *CancelHandshakeOutput - if *v == nil { - sv = &CancelHandshakeOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Handshake": - if err := awsAwsjson11_deserializeDocumentHandshake(&sv.Handshake, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentCreateAccountOutput(v **CreateAccountOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *CreateAccountOutput - if *v == nil { - sv = &CreateAccountOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CreateAccountStatus": - if err := awsAwsjson11_deserializeDocumentCreateAccountStatus(&sv.CreateAccountStatus, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentCreateGovCloudAccountOutput(v **CreateGovCloudAccountOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *CreateGovCloudAccountOutput - if *v == nil { - sv = &CreateGovCloudAccountOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CreateAccountStatus": - if err := awsAwsjson11_deserializeDocumentCreateAccountStatus(&sv.CreateAccountStatus, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentCreateOrganizationalUnitOutput(v **CreateOrganizationalUnitOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *CreateOrganizationalUnitOutput - if *v == nil { - sv = &CreateOrganizationalUnitOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "OrganizationalUnit": - if err := awsAwsjson11_deserializeDocumentOrganizationalUnit(&sv.OrganizationalUnit, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentCreateOrganizationOutput(v **CreateOrganizationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *CreateOrganizationOutput - if *v == nil { - sv = &CreateOrganizationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Organization": - if err := awsAwsjson11_deserializeDocumentOrganization(&sv.Organization, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentCreatePolicyOutput(v **CreatePolicyOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *CreatePolicyOutput - if *v == nil { - sv = &CreatePolicyOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Policy": - if err := awsAwsjson11_deserializeDocumentPolicy(&sv.Policy, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentDeclineHandshakeOutput(v **DeclineHandshakeOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DeclineHandshakeOutput - if *v == nil { - sv = &DeclineHandshakeOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Handshake": - if err := awsAwsjson11_deserializeDocumentHandshake(&sv.Handshake, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentDescribeAccountOutput(v **DescribeAccountOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeAccountOutput - if *v == nil { - sv = &DescribeAccountOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Account": - if err := awsAwsjson11_deserializeDocumentAccount(&sv.Account, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentDescribeCreateAccountStatusOutput(v **DescribeCreateAccountStatusOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeCreateAccountStatusOutput - if *v == nil { - sv = &DescribeCreateAccountStatusOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CreateAccountStatus": - if err := awsAwsjson11_deserializeDocumentCreateAccountStatus(&sv.CreateAccountStatus, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentDescribeEffectivePolicyOutput(v **DescribeEffectivePolicyOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeEffectivePolicyOutput - if *v == nil { - sv = &DescribeEffectivePolicyOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "EffectivePolicy": - if err := awsAwsjson11_deserializeDocumentEffectivePolicy(&sv.EffectivePolicy, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentDescribeHandshakeOutput(v **DescribeHandshakeOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeHandshakeOutput - if *v == nil { - sv = &DescribeHandshakeOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Handshake": - if err := awsAwsjson11_deserializeDocumentHandshake(&sv.Handshake, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentDescribeOrganizationalUnitOutput(v **DescribeOrganizationalUnitOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeOrganizationalUnitOutput - if *v == nil { - sv = &DescribeOrganizationalUnitOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "OrganizationalUnit": - if err := awsAwsjson11_deserializeDocumentOrganizationalUnit(&sv.OrganizationalUnit, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentDescribeOrganizationOutput(v **DescribeOrganizationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeOrganizationOutput - if *v == nil { - sv = &DescribeOrganizationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Organization": - if err := awsAwsjson11_deserializeDocumentOrganization(&sv.Organization, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentDescribePolicyOutput(v **DescribePolicyOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribePolicyOutput - if *v == nil { - sv = &DescribePolicyOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Policy": - if err := awsAwsjson11_deserializeDocumentPolicy(&sv.Policy, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentDescribeResourcePolicyOutput(v **DescribeResourcePolicyOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeResourcePolicyOutput - if *v == nil { - sv = &DescribeResourcePolicyOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "ResourcePolicy": - if err := awsAwsjson11_deserializeDocumentResourcePolicy(&sv.ResourcePolicy, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentDescribeResponsibilityTransferOutput(v **DescribeResponsibilityTransferOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeResponsibilityTransferOutput - if *v == nil { - sv = &DescribeResponsibilityTransferOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "ResponsibilityTransfer": - if err := awsAwsjson11_deserializeDocumentResponsibilityTransfer(&sv.ResponsibilityTransfer, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentDisablePolicyTypeOutput(v **DisablePolicyTypeOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DisablePolicyTypeOutput - if *v == nil { - sv = &DisablePolicyTypeOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Root": - if err := awsAwsjson11_deserializeDocumentRoot(&sv.Root, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentEnableAllFeaturesOutput(v **EnableAllFeaturesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *EnableAllFeaturesOutput - if *v == nil { - sv = &EnableAllFeaturesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Handshake": - if err := awsAwsjson11_deserializeDocumentHandshake(&sv.Handshake, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentEnablePolicyTypeOutput(v **EnablePolicyTypeOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *EnablePolicyTypeOutput - if *v == nil { - sv = &EnablePolicyTypeOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Root": - if err := awsAwsjson11_deserializeDocumentRoot(&sv.Root, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentInviteAccountToOrganizationOutput(v **InviteAccountToOrganizationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *InviteAccountToOrganizationOutput - if *v == nil { - sv = &InviteAccountToOrganizationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Handshake": - if err := awsAwsjson11_deserializeDocumentHandshake(&sv.Handshake, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentInviteOrganizationToTransferResponsibilityOutput(v **InviteOrganizationToTransferResponsibilityOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *InviteOrganizationToTransferResponsibilityOutput - if *v == nil { - sv = &InviteOrganizationToTransferResponsibilityOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Handshake": - if err := awsAwsjson11_deserializeDocumentHandshake(&sv.Handshake, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListAccountsForParentOutput(v **ListAccountsForParentOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListAccountsForParentOutput - if *v == nil { - sv = &ListAccountsForParentOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Accounts": - if err := awsAwsjson11_deserializeDocumentAccounts(&sv.Accounts, value); err != nil { - return err - } - - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListAccountsOutput(v **ListAccountsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListAccountsOutput - if *v == nil { - sv = &ListAccountsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Accounts": - if err := awsAwsjson11_deserializeDocumentAccounts(&sv.Accounts, value); err != nil { - return err - } - - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListAccountsWithInvalidEffectivePolicyOutput(v **ListAccountsWithInvalidEffectivePolicyOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListAccountsWithInvalidEffectivePolicyOutput - if *v == nil { - sv = &ListAccountsWithInvalidEffectivePolicyOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Accounts": - if err := awsAwsjson11_deserializeDocumentAccounts(&sv.Accounts, value); err != nil { - return err - } - - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "PolicyType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EffectivePolicyType to be of type string, got %T instead", value) - } - sv.PolicyType = types.EffectivePolicyType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListAWSServiceAccessForOrganizationOutput(v **ListAWSServiceAccessForOrganizationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListAWSServiceAccessForOrganizationOutput - if *v == nil { - sv = &ListAWSServiceAccessForOrganizationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "EnabledServicePrincipals": - if err := awsAwsjson11_deserializeDocumentEnabledServicePrincipals(&sv.EnabledServicePrincipals, value); err != nil { - return err - } - - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListChildrenOutput(v **ListChildrenOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListChildrenOutput - if *v == nil { - sv = &ListChildrenOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Children": - if err := awsAwsjson11_deserializeDocumentChildren(&sv.Children, value); err != nil { - return err - } - - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListCreateAccountStatusOutput(v **ListCreateAccountStatusOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListCreateAccountStatusOutput - if *v == nil { - sv = &ListCreateAccountStatusOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "CreateAccountStatuses": - if err := awsAwsjson11_deserializeDocumentCreateAccountStatuses(&sv.CreateAccountStatuses, value); err != nil { - return err - } - - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListDelegatedAdministratorsOutput(v **ListDelegatedAdministratorsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListDelegatedAdministratorsOutput - if *v == nil { - sv = &ListDelegatedAdministratorsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "DelegatedAdministrators": - if err := awsAwsjson11_deserializeDocumentDelegatedAdministrators(&sv.DelegatedAdministrators, value); err != nil { - return err - } - - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListDelegatedServicesForAccountOutput(v **ListDelegatedServicesForAccountOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListDelegatedServicesForAccountOutput - if *v == nil { - sv = &ListDelegatedServicesForAccountOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "DelegatedServices": - if err := awsAwsjson11_deserializeDocumentDelegatedServices(&sv.DelegatedServices, value); err != nil { - return err - } - - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListEffectivePolicyValidationErrorsOutput(v **ListEffectivePolicyValidationErrorsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListEffectivePolicyValidationErrorsOutput - if *v == nil { - sv = &ListEffectivePolicyValidationErrorsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "AccountId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) - } - sv.AccountId = ptr.String(jtv) - } - - case "EffectivePolicyValidationErrors": - if err := awsAwsjson11_deserializeDocumentEffectivePolicyValidationErrors(&sv.EffectivePolicyValidationErrors, value); err != nil { - return err - } - - case "EvaluationTimestamp": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.EvaluationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "Path": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Path to be of type string, got %T instead", value) - } - sv.Path = ptr.String(jtv) - } - - case "PolicyType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EffectivePolicyType to be of type string, got %T instead", value) - } - sv.PolicyType = types.EffectivePolicyType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListHandshakesForAccountOutput(v **ListHandshakesForAccountOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListHandshakesForAccountOutput - if *v == nil { - sv = &ListHandshakesForAccountOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Handshakes": - if err := awsAwsjson11_deserializeDocumentHandshakes(&sv.Handshakes, value); err != nil { - return err - } - - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListHandshakesForOrganizationOutput(v **ListHandshakesForOrganizationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListHandshakesForOrganizationOutput - if *v == nil { - sv = &ListHandshakesForOrganizationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Handshakes": - if err := awsAwsjson11_deserializeDocumentHandshakes(&sv.Handshakes, value); err != nil { - return err - } - - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListInboundResponsibilityTransfersOutput(v **ListInboundResponsibilityTransfersOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListInboundResponsibilityTransfersOutput - if *v == nil { - sv = &ListInboundResponsibilityTransfersOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "ResponsibilityTransfers": - if err := awsAwsjson11_deserializeDocumentResponsibilityTransfers(&sv.ResponsibilityTransfers, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListOrganizationalUnitsForParentOutput(v **ListOrganizationalUnitsForParentOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListOrganizationalUnitsForParentOutput - if *v == nil { - sv = &ListOrganizationalUnitsForParentOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "OrganizationalUnits": - if err := awsAwsjson11_deserializeDocumentOrganizationalUnits(&sv.OrganizationalUnits, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListOutboundResponsibilityTransfersOutput(v **ListOutboundResponsibilityTransfersOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListOutboundResponsibilityTransfersOutput - if *v == nil { - sv = &ListOutboundResponsibilityTransfersOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "ResponsibilityTransfers": - if err := awsAwsjson11_deserializeDocumentResponsibilityTransfers(&sv.ResponsibilityTransfers, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListParentsOutput(v **ListParentsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListParentsOutput - if *v == nil { - sv = &ListParentsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "Parents": - if err := awsAwsjson11_deserializeDocumentParents(&sv.Parents, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListPoliciesForTargetOutput(v **ListPoliciesForTargetOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListPoliciesForTargetOutput - if *v == nil { - sv = &ListPoliciesForTargetOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "Policies": - if err := awsAwsjson11_deserializeDocumentPolicies(&sv.Policies, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListPoliciesOutput(v **ListPoliciesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListPoliciesOutput - if *v == nil { - sv = &ListPoliciesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "Policies": - if err := awsAwsjson11_deserializeDocumentPolicies(&sv.Policies, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListRootsOutput(v **ListRootsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListRootsOutput - if *v == nil { - sv = &ListRootsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "Roots": - if err := awsAwsjson11_deserializeDocumentRoots(&sv.Roots, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListTagsForResourceOutput - if *v == nil { - sv = &ListTagsForResourceOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "Tags": - if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListTargetsForPolicyOutput(v **ListTargetsForPolicyOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListTargetsForPolicyOutput - if *v == nil { - sv = &ListTargetsForPolicyOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "Targets": - if err := awsAwsjson11_deserializeDocumentPolicyTargets(&sv.Targets, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentPutResourcePolicyOutput(v **PutResourcePolicyOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *PutResourcePolicyOutput - if *v == nil { - sv = &PutResourcePolicyOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "ResourcePolicy": - if err := awsAwsjson11_deserializeDocumentResourcePolicy(&sv.ResourcePolicy, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentTerminateResponsibilityTransferOutput(v **TerminateResponsibilityTransferOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *TerminateResponsibilityTransferOutput - if *v == nil { - sv = &TerminateResponsibilityTransferOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "ResponsibilityTransfer": - if err := awsAwsjson11_deserializeDocumentResponsibilityTransfer(&sv.ResponsibilityTransfer, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentUpdateOrganizationalUnitOutput(v **UpdateOrganizationalUnitOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateOrganizationalUnitOutput - if *v == nil { - sv = &UpdateOrganizationalUnitOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "OrganizationalUnit": - if err := awsAwsjson11_deserializeDocumentOrganizationalUnit(&sv.OrganizationalUnit, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentUpdatePolicyOutput(v **UpdatePolicyOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdatePolicyOutput - if *v == nil { - sv = &UpdatePolicyOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Policy": - if err := awsAwsjson11_deserializeDocumentPolicy(&sv.Policy, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentUpdateResponsibilityTransferOutput(v **UpdateResponsibilityTransferOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateResponsibilityTransferOutput - if *v == nil { - sv = &UpdateResponsibilityTransferOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "ResponsibilityTransfer": - if err := awsAwsjson11_deserializeDocumentResponsibilityTransfer(&sv.ResponsibilityTransfer, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type protocolErrorInfo struct { - Type string `json:"__type"` - Message string - Code any // nonstandard for awsjson but some services do present the type here -} - -func getProtocolErrorInfo(decoder *json.Decoder) (protocolErrorInfo, error) { - var errInfo protocolErrorInfo - if err := decoder.Decode(&errInfo); err != nil { - if err == io.EOF { - return errInfo, nil - } - return errInfo, err - } - - return errInfo, nil -} - -func resolveProtocolErrorType(headerType string, bodyInfo protocolErrorInfo) (string, bool) { - if len(headerType) != 0 { - return headerType, true - } else if len(bodyInfo.Type) != 0 { - return bodyInfo.Type, true - } else if code, ok := bodyInfo.Code.(string); ok && len(code) != 0 { - return code, true - } - return "", false -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/doc.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/doc.go deleted file mode 100644 index 8c1066f89c..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/doc.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -// Package organizations provides the API client, operations, and parameter types -// for AWS Organizations. -// -// Organizations is a web service that enables you to consolidate your multiple -// Amazon Web Services accounts into an organization and centrally manage your -// accounts and their resources. -// -// This guide provides descriptions of the Organizations operations. For more -// information about using this service, see the [Organizations User Guide]. -// -// # Support and feedback for Organizations -// -// We welcome your feedback. You can post your feedback and questions in the [Organizations support forum]. For -// more information about the Amazon Web Services Support forums, see [Forums Help]. -// -// # Endpoint to call When using the CLI or the Amazon Web Services SDK -// -// For the current release of Organizations, specify the us-east-1 region for all -// Amazon Web Services API and CLI calls made from the commercial Amazon Web -// Services Regions outside of China. If calling from one of the Amazon Web -// Services Regions in China, then specify cn-northwest-1 . You can do this in the -// CLI by using these parameters and commands: -// -// - Use the following parameter with each command to specify both the endpoint -// and its region: -// -// --endpoint-url https://organizations.us-east-1.amazonaws.com (from commercial -// -// Amazon Web Services Regions outside of China) -// -// or -// -// --endpoint-url https://organizations.cn-northwest-1.amazonaws.com.cn (from -// -// Amazon Web Services Regions in China) -// -// - Use the default endpoint, but configure your default region with this -// command: -// -// aws configure set default.region us-east-1 (from commercial Amazon Web Services -// -// Regions outside of China) -// -// or -// -// aws configure set default.region cn-northwest-1 (from Amazon Web Services -// -// Regions in China) -// -// - Use the following parameter with each command to specify the endpoint: -// -// --region us-east-1 (from commercial Amazon Web Services Regions outside of -// -// China) -// -// or -// -// --region cn-northwest-1 (from Amazon Web Services Regions in China) -// -// # Recording API Requests -// -// Organizations supports CloudTrail, a service that records Amazon Web Services -// API calls for your Amazon Web Services account and delivers log files to an -// Amazon S3 bucket. By using information collected by CloudTrail, you can -// determine which requests the Organizations service received, who made the -// request and when, and so on. For more about Organizations and its support for -// CloudTrail, see [Logging Organizations API calls with CloudTrail]in the Organizations User Guide. To learn more about -// CloudTrail, including how to turn it on and find your log files, see the [CloudTrail User Guide]. -// -// [Forums Help]: https://forums.aws.amazon.com/help.jspa -// [Organizations support forum]: https://forums.aws.amazon.com/forum.jspa?forumID=219 -// [CloudTrail User Guide]: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html -// [Organizations User Guide]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html -// [Logging Organizations API calls with CloudTrail]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_incident-response.html#orgs_cloudtrail-integration -package organizations diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/endpoints.go deleted file mode 100644 index 1a25a57cde..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/endpoints.go +++ /dev/null @@ -1,825 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "errors" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - "github.com/aws/aws-sdk-go-v2/internal/endpoints" - "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" - internalendpoints "github.com/aws/aws-sdk-go-v2/service/organizations/internal/endpoints" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - smithyendpoints "github.com/aws/smithy-go/endpoints" - "github.com/aws/smithy-go/endpoints/private/rulesfn" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/ptr" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" - "net/url" - "os" - "strings" -) - -// EndpointResolverOptions is the service endpoint resolver options -type EndpointResolverOptions = internalendpoints.Options - -// EndpointResolver interface for resolving service endpoints. -type EndpointResolver interface { - ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) -} - -var _ EndpointResolver = &internalendpoints.Resolver{} - -// NewDefaultEndpointResolver constructs a new service endpoint resolver -func NewDefaultEndpointResolver() *internalendpoints.Resolver { - return internalendpoints.New() -} - -// EndpointResolverFunc is a helper utility that wraps a function so it satisfies -// the EndpointResolver interface. This is useful when you want to add additional -// endpoint resolving logic, or stub out specific endpoints with custom values. -type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) - -func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return fn(region, options) -} - -// EndpointResolverFromURL returns an EndpointResolver configured using the -// provided endpoint url. By default, the resolved endpoint resolver uses the -// client region as signing region, and the endpoint source is set to -// EndpointSourceCustom.You can provide functional options to configure endpoint -// values for the resolved endpoint. -func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { - e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} - for _, fn := range optFns { - fn(&e) - } - - return EndpointResolverFunc( - func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { - if len(e.SigningRegion) == 0 { - e.SigningRegion = region - } - return e, nil - }, - ) -} - -type ResolveEndpoint struct { - Resolver EndpointResolver - Options EndpointResolverOptions -} - -func (*ResolveEndpoint) ID() string { - return "ResolveEndpoint" -} - -func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.Resolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - eo := m.Options - eo.Logger = middleware.GetLogger(ctx) - - var endpoint aws.Endpoint - endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) - if err != nil { - nf := (&aws.EndpointNotFoundError{}) - if errors.As(err, &nf) { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) - return next.HandleSerialize(ctx, in) - } - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL, err = url.Parse(endpoint.URL) - if err != nil { - return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) - } - - if len(awsmiddleware.GetSigningName(ctx)) == 0 { - signingName := endpoint.SigningName - if len(signingName) == 0 { - signingName = "organizations" - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - } - ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) - ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) - ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) - return next.HandleSerialize(ctx, in) -} -func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { - return stack.Serialize.Insert(&ResolveEndpoint{ - Resolver: o.EndpointResolver, - Options: o.EndpointOptions, - }, "OperationSerializer", middleware.Before) -} - -func removeResolveEndpointMiddleware(stack *middleware.Stack) error { - _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) - return err -} - -type wrappedEndpointResolver struct { - awsResolver aws.EndpointResolverWithOptions -} - -func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return w.awsResolver.ResolveEndpoint(ServiceID, region, options) -} - -type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) - -func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { - return a(service, region) -} - -var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) - -// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. -// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, -// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked -// via its middleware. -// -// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. -func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { - var resolver aws.EndpointResolverWithOptions - - if awsResolverWithOptions != nil { - resolver = awsResolverWithOptions - } else if awsResolver != nil { - resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) - } - - return &wrappedEndpointResolver{ - awsResolver: resolver, - } -} - -func finalizeClientEndpointResolverOptions(options *Options) { - options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() - - if len(options.EndpointOptions.ResolvedRegion) == 0 { - const fipsInfix = "-fips-" - const fipsPrefix = "fips-" - const fipsSuffix = "-fips" - - if strings.Contains(options.Region, fipsInfix) || - strings.Contains(options.Region, fipsPrefix) || - strings.Contains(options.Region, fipsSuffix) { - options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( - options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") - options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled - } - } - -} - -func resolveEndpointResolverV2(options *Options) { - if options.EndpointResolverV2 == nil { - options.EndpointResolverV2 = NewDefaultEndpointResolverV2() - } -} - -func resolveBaseEndpoint(cfg aws.Config, o *Options) { - if cfg.BaseEndpoint != nil { - o.BaseEndpoint = cfg.BaseEndpoint - } - - _, g := os.LookupEnv("AWS_ENDPOINT_URL") - _, s := os.LookupEnv("AWS_ENDPOINT_URL_ORGANIZATIONS") - - if g && !s { - return - } - - value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "Organizations", cfg.ConfigSources) - if found && err == nil { - o.BaseEndpoint = &value - } -} - -func bindRegion(region string) (*string, error) { - if region == "" { - return nil, nil - } - if !rulesfn.IsValidHostLabel(region, true) { - return nil, fmt.Errorf("invalid input region %s", region) - } - - return aws.String(endpoints.MapFIPSRegion(region)), nil -} - -// EndpointParameters provides the parameters that influence how endpoints are -// resolved. -type EndpointParameters struct { - // The AWS region used to dispatch the request. - // - // Parameter is - // required. - // - // AWS::Region - Region *string - - // When true, use the dual-stack endpoint. If the configured endpoint does not - // support dual-stack, dispatching the request MAY return an error. - // - // Defaults to - // false if no value is provided. - // - // AWS::UseDualStack - UseDualStack *bool - - // When true, send this request to the FIPS-compliant regional endpoint. If the - // configured endpoint does not have a FIPS compliant endpoint, dispatching the - // request will return an error. - // - // Defaults to false if no value is - // provided. - // - // AWS::UseFIPS - UseFIPS *bool - - // Override the endpoint used to send this request - // - // Parameter is - // required. - // - // SDK::Endpoint - Endpoint *string -} - -// ValidateRequired validates required parameters are set. -func (p EndpointParameters) ValidateRequired() error { - if p.UseDualStack == nil { - return fmt.Errorf("parameter UseDualStack is required") - } - - if p.UseFIPS == nil { - return fmt.Errorf("parameter UseFIPS is required") - } - - return nil -} - -// WithDefaults returns a shallow copy of EndpointParameterswith default values -// applied to members where applicable. -func (p EndpointParameters) WithDefaults() EndpointParameters { - if p.UseDualStack == nil { - p.UseDualStack = ptr.Bool(false) - } - - if p.UseFIPS == nil { - p.UseFIPS = ptr.Bool(false) - } - return p -} - -type stringSlice []string - -func (s stringSlice) Get(i int) *string { - if i < 0 || i >= len(s) { - return nil - } - - v := s[i] - return &v -} - -// EndpointResolverV2 provides the interface for resolving service endpoints. -type EndpointResolverV2 interface { - // ResolveEndpoint attempts to resolve the endpoint with the provided options, - // returning the endpoint if found. Otherwise an error is returned. - ResolveEndpoint(ctx context.Context, params EndpointParameters) ( - smithyendpoints.Endpoint, error, - ) -} - -// resolver provides the implementation for resolving endpoints. -type resolver struct{} - -func NewDefaultEndpointResolverV2() EndpointResolverV2 { - return &resolver{} -} - -// ResolveEndpoint attempts to resolve the endpoint with the provided options, -// returning the endpoint if found. Otherwise an error is returned. -func (r *resolver) ResolveEndpoint( - ctx context.Context, params EndpointParameters, -) ( - endpoint smithyendpoints.Endpoint, err error, -) { - params = params.WithDefaults() - if err = params.ValidateRequired(); err != nil { - return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) - } - _UseDualStack := *params.UseDualStack - _ = _UseDualStack - _UseFIPS := *params.UseFIPS - _ = _UseFIPS - - if exprVal := params.Endpoint; exprVal != nil { - _Endpoint := *exprVal - _ = _Endpoint - if _UseFIPS == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") - } - if _UseDualStack == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") - } - uriString := _Endpoint - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if exprVal := params.Region; exprVal != nil { - _Region := *exprVal - _ = _Region - if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { - _PartitionResult := *exprVal - _ = _PartitionResult - if _PartitionResult.Name == "aws" { - if _UseFIPS == false { - if _UseDualStack == false { - uriString := "https://organizations.us-east-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "organizations") - smithyhttp.SetSigV4ASigningName(&sp, "organizations") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - } - } - if _PartitionResult.Name == "aws" { - if _UseFIPS == true { - if _UseDualStack == false { - uriString := "https://organizations-fips.us-east-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "organizations") - smithyhttp.SetSigV4ASigningName(&sp, "organizations") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - } - } - if _PartitionResult.Name == "aws-cn" { - if _UseFIPS == false { - if _UseDualStack == false { - uriString := "https://organizations.cn-northwest-1.amazonaws.com.cn" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "organizations") - smithyhttp.SetSigV4ASigningName(&sp, "organizations") - - smithyhttp.SetSigV4SigningRegion(&sp, "cn-northwest-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - } - } - if _PartitionResult.Name == "aws-us-gov" { - if _UseFIPS == false { - if _UseDualStack == false { - uriString := "https://organizations.us-gov-west-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "organizations") - smithyhttp.SetSigV4ASigningName(&sp, "organizations") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-gov-west-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - } - } - if _PartitionResult.Name == "aws-us-gov" { - if _UseFIPS == true { - if _UseDualStack == false { - uriString := "https://organizations.us-gov-west-1.amazonaws.com" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "organizations") - smithyhttp.SetSigV4ASigningName(&sp, "organizations") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-gov-west-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - } - } - if _PartitionResult.Name == "aws-iso" { - if _UseFIPS == false { - if _UseDualStack == false { - uriString := "https://organizations.us-iso-east-1.c2s.ic.gov" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "organizations") - smithyhttp.SetSigV4ASigningName(&sp, "organizations") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-iso-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - } - } - if _PartitionResult.Name == "aws-iso-b" { - if _UseFIPS == false { - if _UseDualStack == false { - uriString := "https://organizations.us-isob-east-1.sc2s.sgov.gov" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "organizations") - smithyhttp.SetSigV4ASigningName(&sp, "organizations") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-isob-east-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - } - } - if _PartitionResult.Name == "aws-iso-f" { - if _UseFIPS == false { - if _UseDualStack == false { - uriString := "https://organizations.us-isof-south-1.csp.hci.ic.gov" - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: func() smithy.Properties { - var out smithy.Properties - smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ - { - SchemeID: "aws.auth#sigv4", - SignerProperties: func() smithy.Properties { - var sp smithy.Properties - smithyhttp.SetSigV4SigningName(&sp, "organizations") - smithyhttp.SetSigV4ASigningName(&sp, "organizations") - - smithyhttp.SetSigV4SigningRegion(&sp, "us-isof-south-1") - return sp - }(), - }, - }) - return out - }(), - }, nil - } - } - } - if _UseFIPS == true { - if _UseDualStack == true { - if true == _PartitionResult.SupportsFIPS { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://organizations-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") - } - } - if _UseFIPS == true { - if _PartitionResult.SupportsFIPS == true { - uriString := func() string { - var out strings.Builder - out.WriteString("https://organizations-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") - } - if _UseDualStack == true { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://organizations.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") - } - uriString := func() string { - var out strings.Builder - out.WriteString("https://organizations.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") -} - -type endpointParamsBinder interface { - bindEndpointParams(*EndpointParameters) -} - -func bindEndpointParams(ctx context.Context, input interface{}, options Options) (*EndpointParameters, error) { - params := &EndpointParameters{} - - region, err := bindRegion(options.Region) - if err != nil { - return nil, err - } - params.Region = region - - params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) - params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) - params.Endpoint = options.BaseEndpoint - - if b, ok := input.(endpointParamsBinder); ok { - b.bindEndpointParams(params) - } - - return params, nil -} - -type resolveEndpointV2Middleware struct { - options Options -} - -func (*resolveEndpointV2Middleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "ResolveEndpoint") - defer span.End() - - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleFinalize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.options.EndpointResolverV2 == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params, err := bindEndpointParams(ctx, getOperationInput(ctx), m.options) - if err != nil { - return out, metadata, fmt.Errorf("failed to bind endpoint params, %w", err) - } - endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", - func() (smithyendpoints.Endpoint, error) { - return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) - }) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) - - if endpt.URI.RawPath == "" && req.URL.RawPath != "" { - endpt.URI.RawPath = endpt.URI.Path - } - req.URL.Scheme = endpt.URI.Scheme - req.URL.Host = endpt.URI.Host - req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) - req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) - for k := range endpt.Headers { - req.Header.Set(k, endpt.Headers.Get(k)) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) - for _, o := range opts { - rscheme.SignerProperties.SetAll(&o.SignerProperties) - } - - span.End() - return next.HandleFinalize(ctx, in) -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/generated.json b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/generated.json deleted file mode 100644 index 7dfbcce850..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/generated.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "dependencies": { - "github.com/aws/aws-sdk-go-v2": "v1.4.0", - "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", - "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", - "github.com/aws/smithy-go": "v1.4.0" - }, - "files": [ - "api_client.go", - "api_client_test.go", - "api_op_AcceptHandshake.go", - "api_op_AttachPolicy.go", - "api_op_CancelHandshake.go", - "api_op_CloseAccount.go", - "api_op_CreateAccount.go", - "api_op_CreateGovCloudAccount.go", - "api_op_CreateOrganization.go", - "api_op_CreateOrganizationalUnit.go", - "api_op_CreatePolicy.go", - "api_op_DeclineHandshake.go", - "api_op_DeleteOrganization.go", - "api_op_DeleteOrganizationalUnit.go", - "api_op_DeletePolicy.go", - "api_op_DeleteResourcePolicy.go", - "api_op_DeregisterDelegatedAdministrator.go", - "api_op_DescribeAccount.go", - "api_op_DescribeCreateAccountStatus.go", - "api_op_DescribeEffectivePolicy.go", - "api_op_DescribeHandshake.go", - "api_op_DescribeOrganization.go", - "api_op_DescribeOrganizationalUnit.go", - "api_op_DescribePolicy.go", - "api_op_DescribeResourcePolicy.go", - "api_op_DescribeResponsibilityTransfer.go", - "api_op_DetachPolicy.go", - "api_op_DisableAWSServiceAccess.go", - "api_op_DisablePolicyType.go", - "api_op_EnableAWSServiceAccess.go", - "api_op_EnableAllFeatures.go", - "api_op_EnablePolicyType.go", - "api_op_InviteAccountToOrganization.go", - "api_op_InviteOrganizationToTransferResponsibility.go", - "api_op_LeaveOrganization.go", - "api_op_ListAWSServiceAccessForOrganization.go", - "api_op_ListAccounts.go", - "api_op_ListAccountsForParent.go", - "api_op_ListAccountsWithInvalidEffectivePolicy.go", - "api_op_ListChildren.go", - "api_op_ListCreateAccountStatus.go", - "api_op_ListDelegatedAdministrators.go", - "api_op_ListDelegatedServicesForAccount.go", - "api_op_ListEffectivePolicyValidationErrors.go", - "api_op_ListHandshakesForAccount.go", - "api_op_ListHandshakesForOrganization.go", - "api_op_ListInboundResponsibilityTransfers.go", - "api_op_ListOrganizationalUnitsForParent.go", - "api_op_ListOutboundResponsibilityTransfers.go", - "api_op_ListParents.go", - "api_op_ListPolicies.go", - "api_op_ListPoliciesForTarget.go", - "api_op_ListRoots.go", - "api_op_ListTagsForResource.go", - "api_op_ListTargetsForPolicy.go", - "api_op_MoveAccount.go", - "api_op_PutResourcePolicy.go", - "api_op_RegisterDelegatedAdministrator.go", - "api_op_RemoveAccountFromOrganization.go", - "api_op_TagResource.go", - "api_op_TerminateResponsibilityTransfer.go", - "api_op_UntagResource.go", - "api_op_UpdateOrganizationalUnit.go", - "api_op_UpdatePolicy.go", - "api_op_UpdateResponsibilityTransfer.go", - "auth.go", - "deserializers.go", - "doc.go", - "endpoints.go", - "endpoints_config_test.go", - "endpoints_test.go", - "generated.json", - "internal/endpoints/endpoints.go", - "internal/endpoints/endpoints_test.go", - "options.go", - "serializers.go", - "snapshot_test.go", - "sra_operation_order_test.go", - "types/enums.go", - "types/errors.go", - "types/types.go", - "validators.go" - ], - "go": "1.24", - "module": "github.com/aws/aws-sdk-go-v2/service/organizations", - "unstable": false -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/go_module_metadata.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/go_module_metadata.go deleted file mode 100644 index 20fdeb7701..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package organizations - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "1.51.0" diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/internal/endpoints/endpoints.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/internal/endpoints/endpoints.go deleted file mode 100644 index 3fb729b606..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/internal/endpoints/endpoints.go +++ /dev/null @@ -1,446 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package endpoints - -import ( - "github.com/aws/aws-sdk-go-v2/aws" - endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" - "github.com/aws/smithy-go/logging" - "regexp" -) - -// Options is the endpoint resolver configuration options -type Options struct { - // Logger is a logging implementation that log events should be sent to. - Logger logging.Logger - - // LogDeprecated indicates that deprecated endpoints should be logged to the - // provided logger. - LogDeprecated bool - - // ResolvedRegion is used to override the region to be resolved, rather then the - // using the value passed to the ResolveEndpoint method. This value is used by the - // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative - // name. You must not set this value directly in your application. - ResolvedRegion string - - // DisableHTTPS informs the resolver to return an endpoint that does not use the - // HTTPS scheme. - DisableHTTPS bool - - // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. - UseDualStackEndpoint aws.DualStackEndpointState - - // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. - UseFIPSEndpoint aws.FIPSEndpointState -} - -func (o Options) GetResolvedRegion() string { - return o.ResolvedRegion -} - -func (o Options) GetDisableHTTPS() bool { - return o.DisableHTTPS -} - -func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { - return o.UseDualStackEndpoint -} - -func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { - return o.UseFIPSEndpoint -} - -func transformToSharedOptions(options Options) endpoints.Options { - return endpoints.Options{ - Logger: options.Logger, - LogDeprecated: options.LogDeprecated, - ResolvedRegion: options.ResolvedRegion, - DisableHTTPS: options.DisableHTTPS, - UseDualStackEndpoint: options.UseDualStackEndpoint, - UseFIPSEndpoint: options.UseFIPSEndpoint, - } -} - -// Resolver Organizations endpoint resolver -type Resolver struct { - partitions endpoints.Partitions -} - -// ResolveEndpoint resolves the service endpoint for the given region and options -func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { - if len(region) == 0 { - return endpoint, &aws.MissingRegionError{} - } - - opt := transformToSharedOptions(options) - return r.partitions.ResolveEndpoint(region, opt) -} - -// New returns a new Resolver -func New() *Resolver { - return &Resolver{ - partitions: defaultPartitions, - } -} - -var partitionRegexp = struct { - Aws *regexp.Regexp - AwsCn *regexp.Regexp - AwsEusc *regexp.Regexp - AwsIso *regexp.Regexp - AwsIsoB *regexp.Regexp - AwsIsoE *regexp.Regexp - AwsIsoF *regexp.Regexp - AwsUsGov *regexp.Regexp -}{ - - Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), - AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), - AwsEusc: regexp.MustCompile("^eusc\\-(de)\\-\\w+\\-\\d+$"), - AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), - AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), - AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), - AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), - AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), -} - -var defaultPartitions = endpoints.Partitions{ - { - ID: "aws", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "organizations.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "organizations-fips.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "organizations-fips.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "organizations.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.Aws, - IsRegionalized: false, - PartitionEndpoint: "aws-global", - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "aws-global", - }: endpoints.Endpoint{ - Hostname: "organizations.us-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-east-1", - }, - }, - endpoints.EndpointKey{ - Region: "aws-global", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "organizations-fips.us-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-east-1", - }, - }, - endpoints.EndpointKey{ - Region: "fips-aws-global", - }: endpoints.Endpoint{ - Hostname: "organizations-fips.us-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-east-1", - }, - Deprecated: aws.TrueTernary, - }, - }, - }, - { - ID: "aws-cn", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "organizations.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "organizations-fips.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "organizations-fips.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "organizations.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsCn, - IsRegionalized: false, - PartitionEndpoint: "aws-cn-global", - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "aws-cn-global", - }: endpoints.Endpoint{ - Hostname: "organizations.cn-northwest-1.amazonaws.com.cn", - CredentialScope: endpoints.CredentialScope{ - Region: "cn-northwest-1", - }, - }, - }, - }, - { - ID: "aws-eusc", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "organizations.{region}.api.amazonwebservices.eu", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "organizations-fips.{region}.amazonaws.eu", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "organizations-fips.{region}.api.amazonwebservices.eu", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "organizations.{region}.amazonaws.eu", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsEusc, - IsRegionalized: true, - }, - { - ID: "aws-iso", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "organizations-fips.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "organizations.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIso, - IsRegionalized: false, - PartitionEndpoint: "aws-iso-global", - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "aws-iso-global", - }: endpoints.Endpoint{ - Hostname: "organizations.us-iso-east-1.c2s.ic.gov", - CredentialScope: endpoints.CredentialScope{ - Region: "us-iso-east-1", - }, - }, - }, - }, - { - ID: "aws-iso-b", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "organizations-fips.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "organizations.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoB, - IsRegionalized: false, - PartitionEndpoint: "aws-iso-b-global", - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "aws-iso-b-global", - }: endpoints.Endpoint{ - Hostname: "organizations.us-isob-east-1.sc2s.sgov.gov", - CredentialScope: endpoints.CredentialScope{ - Region: "us-isob-east-1", - }, - }, - }, - }, - { - ID: "aws-iso-e", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "organizations-fips.{region}.cloud.adc-e.uk", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "organizations.{region}.cloud.adc-e.uk", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoE, - IsRegionalized: false, - PartitionEndpoint: "aws-iso-e-global", - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "aws-iso-e-global", - }: endpoints.Endpoint{ - Hostname: "organizations.eu-isoe-west-1.cloud.adc-e.uk", - CredentialScope: endpoints.CredentialScope{ - Region: "eu-isoe-west-1", - }, - }, - }, - }, - { - ID: "aws-iso-f", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "organizations-fips.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "organizations.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoF, - IsRegionalized: false, - PartitionEndpoint: "aws-iso-f-global", - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "aws-iso-f-global", - }: endpoints.Endpoint{ - Hostname: "organizations.us-isof-south-1.csp.hci.ic.gov", - CredentialScope: endpoints.CredentialScope{ - Region: "us-isof-south-1", - }, - }, - }, - }, - { - ID: "aws-us-gov", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "organizations.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "organizations-fips.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "organizations-fips.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "organizations.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsUsGov, - IsRegionalized: false, - PartitionEndpoint: "aws-us-gov-global", - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "aws-us-gov-global", - }: endpoints.Endpoint{ - Hostname: "organizations.us-gov-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-gov-west-1", - }, - }, - endpoints.EndpointKey{ - Region: "aws-us-gov-global", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "organizations.us-gov-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-gov-west-1", - }, - }, - endpoints.EndpointKey{ - Region: "fips-aws-us-gov-global", - }: endpoints.Endpoint{ - Hostname: "organizations.us-gov-west-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-gov-west-1", - }, - Deprecated: aws.TrueTernary, - }, - }, - }, -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/options.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/options.go deleted file mode 100644 index f7075e1bb3..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/options.go +++ /dev/null @@ -1,238 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/metrics" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" -) - -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -type Options struct { - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - APIOptions []func(*middleware.Stack) error - - // The optional application specific identifier appended to the User-Agent header. - AppID string - - // This endpoint will be given as input to an EndpointResolverV2. It is used for - // providing a custom base endpoint that is subject to modifications by the - // processing EndpointResolverV2. - BaseEndpoint *string - - // Configures the events that will be sent to the configured logger. - ClientLogMode aws.ClientLogMode - - // The credentials object to use when signing requests. - Credentials aws.CredentialsProvider - - // The configuration DefaultsMode that the SDK should use when constructing the - // clients initial default settings. - DefaultsMode aws.DefaultsMode - - // The endpoint options to be used when attempting to resolve an endpoint. - EndpointOptions EndpointResolverOptions - - // The service endpoint resolver. - // - // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a - // value for this field will likely prevent you from using any endpoint-related - // service features released after the introduction of EndpointResolverV2 and - // BaseEndpoint. - // - // To migrate an EndpointResolver implementation that uses a custom endpoint, set - // the client option BaseEndpoint instead. - EndpointResolver EndpointResolver - - // Resolves the endpoint used for a particular service operation. - EndpointResolverV2 EndpointResolverV2 - - // Signature Version 4 (SigV4) Signer - HTTPSignerV4 HTTPSignerV4 - - // The logger writer interface to write logging messages to. - Logger logging.Logger - - // The client meter provider. - MeterProvider metrics.MeterProvider - - // The region to send requests to. (Required) - Region string - - // RetryMaxAttempts specifies the maximum number attempts an API client will call - // an operation that fails with a retryable error. A value of 0 is ignored, and - // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. - // - // If specified in an operation call's functional options with a value that is - // different than the constructed client's Options, the Client's Retryer will be - // wrapped to use the operation's specific RetryMaxAttempts value. - RetryMaxAttempts int - - // RetryMode specifies the retry mode the API client will be created with, if - // Retryer option is not also specified. - // - // When creating a new API Clients this member will only be used if the Retryer - // Options member is nil. This value will be ignored if Retryer is not nil. - // - // Currently does not support per operation call overrides, may in the future. - RetryMode aws.RetryMode - - // Retryer guides how HTTP requests should be retried in case of recoverable - // failures. When nil the API client will use a default retryer. The kind of - // default retry created by the API client can be changed with the RetryMode - // option. - Retryer aws.Retryer - - // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set - // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You - // should not populate this structure programmatically, or rely on the values here - // within your applications. - RuntimeEnvironment aws.RuntimeEnvironment - - // The client tracer provider. - TracerProvider tracing.TracerProvider - - // The initial DefaultsMode used when the client options were constructed. If the - // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved - // value was at that point in time. - // - // Currently does not support per operation call overrides, may in the future. - resolvedDefaultsMode aws.DefaultsMode - - // The HTTP client to invoke API calls with. Defaults to client's default HTTP - // implementation if nil. - HTTPClient HTTPClient - - // Client registry of operation interceptors. - Interceptors smithyhttp.InterceptorRegistry - - // The auth scheme resolver which determines how to authenticate for each - // operation. - AuthSchemeResolver AuthSchemeResolver - - // The list of auth schemes supported by the client. - AuthSchemes []smithyhttp.AuthScheme - - // Priority list of preferred auth scheme names (e.g. sigv4a). - AuthSchemePreference []string -} - -// Copy creates a clone where the APIOptions list is deep copied. -func (o Options) Copy() Options { - to := o - to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) - copy(to.APIOptions, o.APIOptions) - to.Interceptors = o.Interceptors.Copy() - - return to -} - -func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { - if schemeID == "aws.auth#sigv4" { - return getSigV4IdentityResolver(o) - } - if schemeID == "smithy.api#noAuth" { - return &smithyauth.AnonymousIdentityResolver{} - } - return nil -} - -// WithAPIOptions returns a functional option for setting the Client's APIOptions -// option. -func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { - return func(o *Options) { - o.APIOptions = append(o.APIOptions, optFns...) - } -} - -// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for -// this field will likely prevent you from using any endpoint-related service -// features released after the introduction of EndpointResolverV2 and BaseEndpoint. -// -// To migrate an EndpointResolver implementation that uses a custom endpoint, set -// the client option BaseEndpoint instead. -func WithEndpointResolver(v EndpointResolver) func(*Options) { - return func(o *Options) { - o.EndpointResolver = v - } -} - -// WithEndpointResolverV2 returns a functional option for setting the Client's -// EndpointResolverV2 option. -func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { - return func(o *Options) { - o.EndpointResolverV2 = v - } -} - -func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { - if o.Credentials != nil { - return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} - } - return nil -} - -// WithSigV4SigningName applies an override to the authentication workflow to -// use the given signing name for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing name from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningName(name string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), - middleware.Before, - ) - }) - } -} - -// WithSigV4SigningRegion applies an override to the authentication workflow to -// use the given signing region for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing region from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningRegion(region string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), - middleware.Before, - ) - }) - } -} - -func ignoreAnonymousAuth(options *Options) { - if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { - options.Credentials = nil - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/serializers.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/serializers.go deleted file mode 100644 index e284a49621..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/serializers.go +++ /dev/null @@ -1,5036 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "bytes" - "context" - "fmt" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/encoding/httpbinding" - smithyjson "github.com/aws/smithy-go/encoding/json" - "github.com/aws/smithy-go/middleware" - smithytime "github.com/aws/smithy-go/time" - "github.com/aws/smithy-go/tracing" - smithyhttp "github.com/aws/smithy-go/transport/http" - "path" - "strings" -) - -type awsAwsjson11_serializeOpAcceptHandshake struct { -} - -func (*awsAwsjson11_serializeOpAcceptHandshake) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpAcceptHandshake) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*AcceptHandshakeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.AcceptHandshake") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentAcceptHandshakeInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpAttachPolicy struct { -} - -func (*awsAwsjson11_serializeOpAttachPolicy) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpAttachPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*AttachPolicyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.AttachPolicy") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentAttachPolicyInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpCancelHandshake struct { -} - -func (*awsAwsjson11_serializeOpCancelHandshake) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpCancelHandshake) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*CancelHandshakeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.CancelHandshake") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentCancelHandshakeInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpCloseAccount struct { -} - -func (*awsAwsjson11_serializeOpCloseAccount) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpCloseAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*CloseAccountInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.CloseAccount") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentCloseAccountInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpCreateAccount struct { -} - -func (*awsAwsjson11_serializeOpCreateAccount) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpCreateAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*CreateAccountInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.CreateAccount") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentCreateAccountInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpCreateGovCloudAccount struct { -} - -func (*awsAwsjson11_serializeOpCreateGovCloudAccount) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpCreateGovCloudAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*CreateGovCloudAccountInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.CreateGovCloudAccount") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentCreateGovCloudAccountInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpCreateOrganization struct { -} - -func (*awsAwsjson11_serializeOpCreateOrganization) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpCreateOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*CreateOrganizationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.CreateOrganization") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentCreateOrganizationInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpCreateOrganizationalUnit struct { -} - -func (*awsAwsjson11_serializeOpCreateOrganizationalUnit) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpCreateOrganizationalUnit) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*CreateOrganizationalUnitInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.CreateOrganizationalUnit") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentCreateOrganizationalUnitInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpCreatePolicy struct { -} - -func (*awsAwsjson11_serializeOpCreatePolicy) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpCreatePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*CreatePolicyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.CreatePolicy") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentCreatePolicyInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDeclineHandshake struct { -} - -func (*awsAwsjson11_serializeOpDeclineHandshake) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDeclineHandshake) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DeclineHandshakeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.DeclineHandshake") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeclineHandshakeInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDeleteOrganization struct { -} - -func (*awsAwsjson11_serializeOpDeleteOrganization) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDeleteOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DeleteOrganizationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.DeleteOrganization") - - if request, err = request.SetStream(strings.NewReader(`{}`)); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDeleteOrganizationalUnit struct { -} - -func (*awsAwsjson11_serializeOpDeleteOrganizationalUnit) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDeleteOrganizationalUnit) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DeleteOrganizationalUnitInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.DeleteOrganizationalUnit") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeleteOrganizationalUnitInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDeletePolicy struct { -} - -func (*awsAwsjson11_serializeOpDeletePolicy) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDeletePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DeletePolicyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.DeletePolicy") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeletePolicyInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDeleteResourcePolicy struct { -} - -func (*awsAwsjson11_serializeOpDeleteResourcePolicy) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDeleteResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DeleteResourcePolicyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.DeleteResourcePolicy") - - if request, err = request.SetStream(strings.NewReader(`{}`)); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDeregisterDelegatedAdministrator struct { -} - -func (*awsAwsjson11_serializeOpDeregisterDelegatedAdministrator) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDeregisterDelegatedAdministrator) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DeregisterDelegatedAdministratorInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.DeregisterDelegatedAdministrator") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeregisterDelegatedAdministratorInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDescribeAccount struct { -} - -func (*awsAwsjson11_serializeOpDescribeAccount) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDescribeAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeAccountInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.DescribeAccount") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeAccountInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDescribeCreateAccountStatus struct { -} - -func (*awsAwsjson11_serializeOpDescribeCreateAccountStatus) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDescribeCreateAccountStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeCreateAccountStatusInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.DescribeCreateAccountStatus") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeCreateAccountStatusInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDescribeEffectivePolicy struct { -} - -func (*awsAwsjson11_serializeOpDescribeEffectivePolicy) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDescribeEffectivePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeEffectivePolicyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.DescribeEffectivePolicy") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeEffectivePolicyInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDescribeHandshake struct { -} - -func (*awsAwsjson11_serializeOpDescribeHandshake) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDescribeHandshake) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeHandshakeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.DescribeHandshake") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeHandshakeInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDescribeOrganization struct { -} - -func (*awsAwsjson11_serializeOpDescribeOrganization) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDescribeOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeOrganizationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.DescribeOrganization") - - if request, err = request.SetStream(strings.NewReader(`{}`)); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDescribeOrganizationalUnit struct { -} - -func (*awsAwsjson11_serializeOpDescribeOrganizationalUnit) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDescribeOrganizationalUnit) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeOrganizationalUnitInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.DescribeOrganizationalUnit") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeOrganizationalUnitInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDescribePolicy struct { -} - -func (*awsAwsjson11_serializeOpDescribePolicy) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDescribePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribePolicyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.DescribePolicy") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribePolicyInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDescribeResourcePolicy struct { -} - -func (*awsAwsjson11_serializeOpDescribeResourcePolicy) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDescribeResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeResourcePolicyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.DescribeResourcePolicy") - - if request, err = request.SetStream(strings.NewReader(`{}`)); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDescribeResponsibilityTransfer struct { -} - -func (*awsAwsjson11_serializeOpDescribeResponsibilityTransfer) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDescribeResponsibilityTransfer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DescribeResponsibilityTransferInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.DescribeResponsibilityTransfer") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeResponsibilityTransferInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDetachPolicy struct { -} - -func (*awsAwsjson11_serializeOpDetachPolicy) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDetachPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DetachPolicyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.DetachPolicy") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDetachPolicyInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDisableAWSServiceAccess struct { -} - -func (*awsAwsjson11_serializeOpDisableAWSServiceAccess) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDisableAWSServiceAccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DisableAWSServiceAccessInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.DisableAWSServiceAccess") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDisableAWSServiceAccessInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpDisablePolicyType struct { -} - -func (*awsAwsjson11_serializeOpDisablePolicyType) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDisablePolicyType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DisablePolicyTypeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.DisablePolicyType") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDisablePolicyTypeInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpEnableAllFeatures struct { -} - -func (*awsAwsjson11_serializeOpEnableAllFeatures) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpEnableAllFeatures) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*EnableAllFeaturesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.EnableAllFeatures") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentEnableAllFeaturesInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpEnableAWSServiceAccess struct { -} - -func (*awsAwsjson11_serializeOpEnableAWSServiceAccess) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpEnableAWSServiceAccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*EnableAWSServiceAccessInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.EnableAWSServiceAccess") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentEnableAWSServiceAccessInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpEnablePolicyType struct { -} - -func (*awsAwsjson11_serializeOpEnablePolicyType) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpEnablePolicyType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*EnablePolicyTypeInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.EnablePolicyType") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentEnablePolicyTypeInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpInviteAccountToOrganization struct { -} - -func (*awsAwsjson11_serializeOpInviteAccountToOrganization) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpInviteAccountToOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*InviteAccountToOrganizationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.InviteAccountToOrganization") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentInviteAccountToOrganizationInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpInviteOrganizationToTransferResponsibility struct { -} - -func (*awsAwsjson11_serializeOpInviteOrganizationToTransferResponsibility) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpInviteOrganizationToTransferResponsibility) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*InviteOrganizationToTransferResponsibilityInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.InviteOrganizationToTransferResponsibility") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentInviteOrganizationToTransferResponsibilityInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpLeaveOrganization struct { -} - -func (*awsAwsjson11_serializeOpLeaveOrganization) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpLeaveOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*LeaveOrganizationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.LeaveOrganization") - - if request, err = request.SetStream(strings.NewReader(`{}`)); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListAccounts struct { -} - -func (*awsAwsjson11_serializeOpListAccounts) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListAccounts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListAccountsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListAccounts") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListAccountsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListAccountsForParent struct { -} - -func (*awsAwsjson11_serializeOpListAccountsForParent) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListAccountsForParent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListAccountsForParentInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListAccountsForParent") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListAccountsForParentInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListAccountsWithInvalidEffectivePolicy struct { -} - -func (*awsAwsjson11_serializeOpListAccountsWithInvalidEffectivePolicy) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListAccountsWithInvalidEffectivePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListAccountsWithInvalidEffectivePolicyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListAccountsWithInvalidEffectivePolicy") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListAccountsWithInvalidEffectivePolicyInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListAWSServiceAccessForOrganization struct { -} - -func (*awsAwsjson11_serializeOpListAWSServiceAccessForOrganization) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListAWSServiceAccessForOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListAWSServiceAccessForOrganizationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListAWSServiceAccessForOrganization") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListAWSServiceAccessForOrganizationInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListChildren struct { -} - -func (*awsAwsjson11_serializeOpListChildren) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListChildren) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListChildrenInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListChildren") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListChildrenInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListCreateAccountStatus struct { -} - -func (*awsAwsjson11_serializeOpListCreateAccountStatus) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListCreateAccountStatus) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListCreateAccountStatusInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListCreateAccountStatus") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListCreateAccountStatusInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListDelegatedAdministrators struct { -} - -func (*awsAwsjson11_serializeOpListDelegatedAdministrators) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListDelegatedAdministrators) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListDelegatedAdministratorsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListDelegatedAdministrators") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListDelegatedAdministratorsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListDelegatedServicesForAccount struct { -} - -func (*awsAwsjson11_serializeOpListDelegatedServicesForAccount) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListDelegatedServicesForAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListDelegatedServicesForAccountInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListDelegatedServicesForAccount") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListDelegatedServicesForAccountInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListEffectivePolicyValidationErrors struct { -} - -func (*awsAwsjson11_serializeOpListEffectivePolicyValidationErrors) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListEffectivePolicyValidationErrors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListEffectivePolicyValidationErrorsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListEffectivePolicyValidationErrors") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListEffectivePolicyValidationErrorsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListHandshakesForAccount struct { -} - -func (*awsAwsjson11_serializeOpListHandshakesForAccount) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListHandshakesForAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListHandshakesForAccountInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListHandshakesForAccount") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListHandshakesForAccountInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListHandshakesForOrganization struct { -} - -func (*awsAwsjson11_serializeOpListHandshakesForOrganization) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListHandshakesForOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListHandshakesForOrganizationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListHandshakesForOrganization") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListHandshakesForOrganizationInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListInboundResponsibilityTransfers struct { -} - -func (*awsAwsjson11_serializeOpListInboundResponsibilityTransfers) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListInboundResponsibilityTransfers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListInboundResponsibilityTransfersInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListInboundResponsibilityTransfers") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListInboundResponsibilityTransfersInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListOrganizationalUnitsForParent struct { -} - -func (*awsAwsjson11_serializeOpListOrganizationalUnitsForParent) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListOrganizationalUnitsForParent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListOrganizationalUnitsForParentInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListOrganizationalUnitsForParent") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListOrganizationalUnitsForParentInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListOutboundResponsibilityTransfers struct { -} - -func (*awsAwsjson11_serializeOpListOutboundResponsibilityTransfers) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListOutboundResponsibilityTransfers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListOutboundResponsibilityTransfersInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListOutboundResponsibilityTransfers") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListOutboundResponsibilityTransfersInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListParents struct { -} - -func (*awsAwsjson11_serializeOpListParents) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListParents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListParentsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListParents") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListParentsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListPolicies struct { -} - -func (*awsAwsjson11_serializeOpListPolicies) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListPolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListPoliciesInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListPolicies") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListPoliciesInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListPoliciesForTarget struct { -} - -func (*awsAwsjson11_serializeOpListPoliciesForTarget) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListPoliciesForTarget) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListPoliciesForTargetInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListPoliciesForTarget") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListPoliciesForTargetInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListRoots struct { -} - -func (*awsAwsjson11_serializeOpListRoots) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListRoots) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListRootsInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListRoots") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListRootsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListTagsForResource struct { -} - -func (*awsAwsjson11_serializeOpListTagsForResource) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListTagsForResourceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListTagsForResource") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpListTargetsForPolicy struct { -} - -func (*awsAwsjson11_serializeOpListTargetsForPolicy) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListTargetsForPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListTargetsForPolicyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.ListTargetsForPolicy") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListTargetsForPolicyInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpMoveAccount struct { -} - -func (*awsAwsjson11_serializeOpMoveAccount) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpMoveAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*MoveAccountInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.MoveAccount") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentMoveAccountInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpPutResourcePolicy struct { -} - -func (*awsAwsjson11_serializeOpPutResourcePolicy) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpPutResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*PutResourcePolicyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.PutResourcePolicy") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentPutResourcePolicyInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpRegisterDelegatedAdministrator struct { -} - -func (*awsAwsjson11_serializeOpRegisterDelegatedAdministrator) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpRegisterDelegatedAdministrator) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*RegisterDelegatedAdministratorInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.RegisterDelegatedAdministrator") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentRegisterDelegatedAdministratorInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpRemoveAccountFromOrganization struct { -} - -func (*awsAwsjson11_serializeOpRemoveAccountFromOrganization) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpRemoveAccountFromOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*RemoveAccountFromOrganizationInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.RemoveAccountFromOrganization") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentRemoveAccountFromOrganizationInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpTagResource struct { -} - -func (*awsAwsjson11_serializeOpTagResource) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*TagResourceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.TagResource") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpTerminateResponsibilityTransfer struct { -} - -func (*awsAwsjson11_serializeOpTerminateResponsibilityTransfer) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpTerminateResponsibilityTransfer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*TerminateResponsibilityTransferInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.TerminateResponsibilityTransfer") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentTerminateResponsibilityTransferInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpUntagResource struct { -} - -func (*awsAwsjson11_serializeOpUntagResource) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UntagResourceInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.UntagResource") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpUpdateOrganizationalUnit struct { -} - -func (*awsAwsjson11_serializeOpUpdateOrganizationalUnit) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpUpdateOrganizationalUnit) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdateOrganizationalUnitInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.UpdateOrganizationalUnit") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentUpdateOrganizationalUnitInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpUpdatePolicy struct { -} - -func (*awsAwsjson11_serializeOpUpdatePolicy) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpUpdatePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdatePolicyInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.UpdatePolicy") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentUpdatePolicyInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} - -type awsAwsjson11_serializeOpUpdateResponsibilityTransfer struct { -} - -func (*awsAwsjson11_serializeOpUpdateResponsibilityTransfer) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpUpdateResponsibilityTransfer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - _, span := tracing.StartSpan(ctx, "OperationSerializer") - endTimer := startMetricTimer(ctx, "client.call.serialization_duration") - defer endTimer() - defer span.End() - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdateResponsibilityTransferInput) - _ = input - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} - } - - operationPath := "/" - if len(request.Request.URL.Path) == 0 { - request.Request.URL.Path = operationPath - } else { - request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) - if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { - request.Request.URL.Path += "/" - } - } - request.Request.Method = "POST" - httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) - if err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSOrganizationsV20161128.UpdateResponsibilityTransfer") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentUpdateResponsibilityTransferInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - endTimer() - span.End() - return next.HandleSerialize(ctx, in) -} -func awsAwsjson11_serializeDocumentCreateAccountStates(v []types.CreateAccountState, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsAwsjson11_serializeDocumentHandshakeFilter(v *types.HandshakeFilter, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.ActionType) > 0 { - ok := object.Key("ActionType") - ok.String(string(v.ActionType)) - } - - if v.ParentHandshakeId != nil { - ok := object.Key("ParentHandshakeId") - ok.String(*v.ParentHandshakeId) - } - - return nil -} - -func awsAwsjson11_serializeDocumentHandshakeParty(v *types.HandshakeParty, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Id != nil { - ok := object.Key("Id") - ok.String(*v.Id) - } - - if len(v.Type) > 0 { - ok := object.Key("Type") - ok.String(string(v.Type)) - } - - return nil -} - -func awsAwsjson11_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Key != nil { - ok := object.Key("Key") - ok.String(*v.Key) - } - - if v.Value != nil { - ok := object.Key("Value") - ok.String(*v.Value) - } - - return nil -} - -func awsAwsjson11_serializeDocumentTagKeys(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(v[i]) - } - return nil -} - -func awsAwsjson11_serializeDocumentTags(v []types.Tag, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsAwsjson11_serializeOpDocumentAcceptHandshakeInput(v *AcceptHandshakeInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.HandshakeId != nil { - ok := object.Key("HandshakeId") - ok.String(*v.HandshakeId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentAttachPolicyInput(v *AttachPolicyInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.PolicyId != nil { - ok := object.Key("PolicyId") - ok.String(*v.PolicyId) - } - - if v.TargetId != nil { - ok := object.Key("TargetId") - ok.String(*v.TargetId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentCancelHandshakeInput(v *CancelHandshakeInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.HandshakeId != nil { - ok := object.Key("HandshakeId") - ok.String(*v.HandshakeId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentCloseAccountInput(v *CloseAccountInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AccountId != nil { - ok := object.Key("AccountId") - ok.String(*v.AccountId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentCreateAccountInput(v *CreateAccountInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AccountName != nil { - ok := object.Key("AccountName") - ok.String(*v.AccountName) - } - - if v.Email != nil { - ok := object.Key("Email") - ok.String(*v.Email) - } - - if len(v.IamUserAccessToBilling) > 0 { - ok := object.Key("IamUserAccessToBilling") - ok.String(string(v.IamUserAccessToBilling)) - } - - if v.RoleName != nil { - ok := object.Key("RoleName") - ok.String(*v.RoleName) - } - - if v.Tags != nil { - ok := object.Key("Tags") - if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentCreateGovCloudAccountInput(v *CreateGovCloudAccountInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AccountName != nil { - ok := object.Key("AccountName") - ok.String(*v.AccountName) - } - - if v.Email != nil { - ok := object.Key("Email") - ok.String(*v.Email) - } - - if len(v.IamUserAccessToBilling) > 0 { - ok := object.Key("IamUserAccessToBilling") - ok.String(string(v.IamUserAccessToBilling)) - } - - if v.RoleName != nil { - ok := object.Key("RoleName") - ok.String(*v.RoleName) - } - - if v.Tags != nil { - ok := object.Key("Tags") - if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentCreateOrganizationalUnitInput(v *CreateOrganizationalUnitInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Name != nil { - ok := object.Key("Name") - ok.String(*v.Name) - } - - if v.ParentId != nil { - ok := object.Key("ParentId") - ok.String(*v.ParentId) - } - - if v.Tags != nil { - ok := object.Key("Tags") - if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentCreateOrganizationInput(v *CreateOrganizationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.FeatureSet) > 0 { - ok := object.Key("FeatureSet") - ok.String(string(v.FeatureSet)) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentCreatePolicyInput(v *CreatePolicyInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Content != nil { - ok := object.Key("Content") - ok.String(*v.Content) - } - - if v.Description != nil { - ok := object.Key("Description") - ok.String(*v.Description) - } - - if v.Name != nil { - ok := object.Key("Name") - ok.String(*v.Name) - } - - if v.Tags != nil { - ok := object.Key("Tags") - if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { - return err - } - } - - if len(v.Type) > 0 { - ok := object.Key("Type") - ok.String(string(v.Type)) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentDeclineHandshakeInput(v *DeclineHandshakeInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.HandshakeId != nil { - ok := object.Key("HandshakeId") - ok.String(*v.HandshakeId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentDeleteOrganizationalUnitInput(v *DeleteOrganizationalUnitInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.OrganizationalUnitId != nil { - ok := object.Key("OrganizationalUnitId") - ok.String(*v.OrganizationalUnitId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentDeletePolicyInput(v *DeletePolicyInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.PolicyId != nil { - ok := object.Key("PolicyId") - ok.String(*v.PolicyId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentDeregisterDelegatedAdministratorInput(v *DeregisterDelegatedAdministratorInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AccountId != nil { - ok := object.Key("AccountId") - ok.String(*v.AccountId) - } - - if v.ServicePrincipal != nil { - ok := object.Key("ServicePrincipal") - ok.String(*v.ServicePrincipal) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentDescribeAccountInput(v *DescribeAccountInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AccountId != nil { - ok := object.Key("AccountId") - ok.String(*v.AccountId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentDescribeCreateAccountStatusInput(v *DescribeCreateAccountStatusInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.CreateAccountRequestId != nil { - ok := object.Key("CreateAccountRequestId") - ok.String(*v.CreateAccountRequestId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentDescribeEffectivePolicyInput(v *DescribeEffectivePolicyInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.PolicyType) > 0 { - ok := object.Key("PolicyType") - ok.String(string(v.PolicyType)) - } - - if v.TargetId != nil { - ok := object.Key("TargetId") - ok.String(*v.TargetId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentDescribeHandshakeInput(v *DescribeHandshakeInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.HandshakeId != nil { - ok := object.Key("HandshakeId") - ok.String(*v.HandshakeId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentDescribeOrganizationalUnitInput(v *DescribeOrganizationalUnitInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.OrganizationalUnitId != nil { - ok := object.Key("OrganizationalUnitId") - ok.String(*v.OrganizationalUnitId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentDescribePolicyInput(v *DescribePolicyInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.PolicyId != nil { - ok := object.Key("PolicyId") - ok.String(*v.PolicyId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentDescribeResponsibilityTransferInput(v *DescribeResponsibilityTransferInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Id != nil { - ok := object.Key("Id") - ok.String(*v.Id) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentDetachPolicyInput(v *DetachPolicyInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.PolicyId != nil { - ok := object.Key("PolicyId") - ok.String(*v.PolicyId) - } - - if v.TargetId != nil { - ok := object.Key("TargetId") - ok.String(*v.TargetId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentDisableAWSServiceAccessInput(v *DisableAWSServiceAccessInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ServicePrincipal != nil { - ok := object.Key("ServicePrincipal") - ok.String(*v.ServicePrincipal) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentDisablePolicyTypeInput(v *DisablePolicyTypeInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.PolicyType) > 0 { - ok := object.Key("PolicyType") - ok.String(string(v.PolicyType)) - } - - if v.RootId != nil { - ok := object.Key("RootId") - ok.String(*v.RootId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentEnableAllFeaturesInput(v *EnableAllFeaturesInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - return nil -} - -func awsAwsjson11_serializeOpDocumentEnableAWSServiceAccessInput(v *EnableAWSServiceAccessInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ServicePrincipal != nil { - ok := object.Key("ServicePrincipal") - ok.String(*v.ServicePrincipal) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentEnablePolicyTypeInput(v *EnablePolicyTypeInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.PolicyType) > 0 { - ok := object.Key("PolicyType") - ok.String(string(v.PolicyType)) - } - - if v.RootId != nil { - ok := object.Key("RootId") - ok.String(*v.RootId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentInviteAccountToOrganizationInput(v *InviteAccountToOrganizationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Notes != nil { - ok := object.Key("Notes") - ok.String(*v.Notes) - } - - if v.Tags != nil { - ok := object.Key("Tags") - if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { - return err - } - } - - if v.Target != nil { - ok := object.Key("Target") - if err := awsAwsjson11_serializeDocumentHandshakeParty(v.Target, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentInviteOrganizationToTransferResponsibilityInput(v *InviteOrganizationToTransferResponsibilityInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Notes != nil { - ok := object.Key("Notes") - ok.String(*v.Notes) - } - - if v.SourceName != nil { - ok := object.Key("SourceName") - ok.String(*v.SourceName) - } - - if v.StartTimestamp != nil { - ok := object.Key("StartTimestamp") - ok.Double(smithytime.FormatEpochSeconds(*v.StartTimestamp)) - } - - if v.Tags != nil { - ok := object.Key("Tags") - if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { - return err - } - } - - if v.Target != nil { - ok := object.Key("Target") - if err := awsAwsjson11_serializeDocumentHandshakeParty(v.Target, ok); err != nil { - return err - } - } - - if len(v.Type) > 0 { - ok := object.Key("Type") - ok.String(string(v.Type)) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListAccountsForParentInput(v *ListAccountsForParentInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - if v.ParentId != nil { - ok := object.Key("ParentId") - ok.String(*v.ParentId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListAccountsInput(v *ListAccountsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListAccountsWithInvalidEffectivePolicyInput(v *ListAccountsWithInvalidEffectivePolicyInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - if len(v.PolicyType) > 0 { - ok := object.Key("PolicyType") - ok.String(string(v.PolicyType)) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListAWSServiceAccessForOrganizationInput(v *ListAWSServiceAccessForOrganizationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListChildrenInput(v *ListChildrenInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.ChildType) > 0 { - ok := object.Key("ChildType") - ok.String(string(v.ChildType)) - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - if v.ParentId != nil { - ok := object.Key("ParentId") - ok.String(*v.ParentId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListCreateAccountStatusInput(v *ListCreateAccountStatusInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - if v.States != nil { - ok := object.Key("States") - if err := awsAwsjson11_serializeDocumentCreateAccountStates(v.States, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListDelegatedAdministratorsInput(v *ListDelegatedAdministratorsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - if v.ServicePrincipal != nil { - ok := object.Key("ServicePrincipal") - ok.String(*v.ServicePrincipal) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListDelegatedServicesForAccountInput(v *ListDelegatedServicesForAccountInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AccountId != nil { - ok := object.Key("AccountId") - ok.String(*v.AccountId) - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListEffectivePolicyValidationErrorsInput(v *ListEffectivePolicyValidationErrorsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AccountId != nil { - ok := object.Key("AccountId") - ok.String(*v.AccountId) - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - if len(v.PolicyType) > 0 { - ok := object.Key("PolicyType") - ok.String(string(v.PolicyType)) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListHandshakesForAccountInput(v *ListHandshakesForAccountInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Filter != nil { - ok := object.Key("Filter") - if err := awsAwsjson11_serializeDocumentHandshakeFilter(v.Filter, ok); err != nil { - return err - } - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListHandshakesForOrganizationInput(v *ListHandshakesForOrganizationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Filter != nil { - ok := object.Key("Filter") - if err := awsAwsjson11_serializeDocumentHandshakeFilter(v.Filter, ok); err != nil { - return err - } - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListInboundResponsibilityTransfersInput(v *ListInboundResponsibilityTransfersInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Id != nil { - ok := object.Key("Id") - ok.String(*v.Id) - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - if len(v.Type) > 0 { - ok := object.Key("Type") - ok.String(string(v.Type)) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListOrganizationalUnitsForParentInput(v *ListOrganizationalUnitsForParentInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - if v.ParentId != nil { - ok := object.Key("ParentId") - ok.String(*v.ParentId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListOutboundResponsibilityTransfersInput(v *ListOutboundResponsibilityTransfersInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - if len(v.Type) > 0 { - ok := object.Key("Type") - ok.String(string(v.Type)) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListParentsInput(v *ListParentsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ChildId != nil { - ok := object.Key("ChildId") - ok.String(*v.ChildId) - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListPoliciesForTargetInput(v *ListPoliciesForTargetInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.Filter) > 0 { - ok := object.Key("Filter") - ok.String(string(v.Filter)) - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - if v.TargetId != nil { - ok := object.Key("TargetId") - ok.String(*v.TargetId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListPoliciesInput(v *ListPoliciesInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.Filter) > 0 { - ok := object.Key("Filter") - ok.String(string(v.Filter)) - } - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListRootsInput(v *ListRootsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - if v.ResourceId != nil { - ok := object.Key("ResourceId") - ok.String(*v.ResourceId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListTargetsForPolicyInput(v *ListTargetsForPolicyInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("MaxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } - - if v.PolicyId != nil { - ok := object.Key("PolicyId") - ok.String(*v.PolicyId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentMoveAccountInput(v *MoveAccountInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AccountId != nil { - ok := object.Key("AccountId") - ok.String(*v.AccountId) - } - - if v.DestinationParentId != nil { - ok := object.Key("DestinationParentId") - ok.String(*v.DestinationParentId) - } - - if v.SourceParentId != nil { - ok := object.Key("SourceParentId") - ok.String(*v.SourceParentId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentPutResourcePolicyInput(v *PutResourcePolicyInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Content != nil { - ok := object.Key("Content") - ok.String(*v.Content) - } - - if v.Tags != nil { - ok := object.Key("Tags") - if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentRegisterDelegatedAdministratorInput(v *RegisterDelegatedAdministratorInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AccountId != nil { - ok := object.Key("AccountId") - ok.String(*v.AccountId) - } - - if v.ServicePrincipal != nil { - ok := object.Key("ServicePrincipal") - ok.String(*v.ServicePrincipal) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentRemoveAccountFromOrganizationInput(v *RemoveAccountFromOrganizationInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AccountId != nil { - ok := object.Key("AccountId") - ok.String(*v.AccountId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ResourceId != nil { - ok := object.Key("ResourceId") - ok.String(*v.ResourceId) - } - - if v.Tags != nil { - ok := object.Key("Tags") - if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentTerminateResponsibilityTransferInput(v *TerminateResponsibilityTransferInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.EndTimestamp != nil { - ok := object.Key("EndTimestamp") - ok.Double(smithytime.FormatEpochSeconds(*v.EndTimestamp)) - } - - if v.Id != nil { - ok := object.Key("Id") - ok.String(*v.Id) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.ResourceId != nil { - ok := object.Key("ResourceId") - ok.String(*v.ResourceId) - } - - if v.TagKeys != nil { - ok := object.Key("TagKeys") - if err := awsAwsjson11_serializeDocumentTagKeys(v.TagKeys, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentUpdateOrganizationalUnitInput(v *UpdateOrganizationalUnitInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Name != nil { - ok := object.Key("Name") - ok.String(*v.Name) - } - - if v.OrganizationalUnitId != nil { - ok := object.Key("OrganizationalUnitId") - ok.String(*v.OrganizationalUnitId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentUpdatePolicyInput(v *UpdatePolicyInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Content != nil { - ok := object.Key("Content") - ok.String(*v.Content) - } - - if v.Description != nil { - ok := object.Key("Description") - ok.String(*v.Description) - } - - if v.Name != nil { - ok := object.Key("Name") - ok.String(*v.Name) - } - - if v.PolicyId != nil { - ok := object.Key("PolicyId") - ok.String(*v.PolicyId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentUpdateResponsibilityTransferInput(v *UpdateResponsibilityTransferInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.Id != nil { - ok := object.Key("Id") - ok.String(*v.Id) - } - - if v.Name != nil { - ok := object.Key("Name") - ok.String(*v.Name) - } - - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/types/enums.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/types/enums.go deleted file mode 100644 index 084655b1d1..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/types/enums.go +++ /dev/null @@ -1,754 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -type AccessDeniedForDependencyExceptionReason string - -// Enum values for AccessDeniedForDependencyExceptionReason -const ( - AccessDeniedForDependencyExceptionReasonAccessDeniedDuringCreateServiceLinkedRole AccessDeniedForDependencyExceptionReason = "ACCESS_DENIED_DURING_CREATE_SERVICE_LINKED_ROLE" -) - -// Values returns all known values for AccessDeniedForDependencyExceptionReason. -// Note that this can be expanded in the future, and so it is only as up to date as -// the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AccessDeniedForDependencyExceptionReason) Values() []AccessDeniedForDependencyExceptionReason { - return []AccessDeniedForDependencyExceptionReason{ - "ACCESS_DENIED_DURING_CREATE_SERVICE_LINKED_ROLE", - } -} - -type AccountJoinedMethod string - -// Enum values for AccountJoinedMethod -const ( - AccountJoinedMethodInvited AccountJoinedMethod = "INVITED" - AccountJoinedMethodCreated AccountJoinedMethod = "CREATED" -) - -// Values returns all known values for AccountJoinedMethod. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AccountJoinedMethod) Values() []AccountJoinedMethod { - return []AccountJoinedMethod{ - "INVITED", - "CREATED", - } -} - -type AccountState string - -// Enum values for AccountState -const ( - AccountStatePendingActivation AccountState = "PENDING_ACTIVATION" - AccountStateActive AccountState = "ACTIVE" - AccountStateSuspended AccountState = "SUSPENDED" - AccountStatePendingClosure AccountState = "PENDING_CLOSURE" - AccountStateClosed AccountState = "CLOSED" -) - -// Values returns all known values for AccountState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AccountState) Values() []AccountState { - return []AccountState{ - "PENDING_ACTIVATION", - "ACTIVE", - "SUSPENDED", - "PENDING_CLOSURE", - "CLOSED", - } -} - -type AccountStatus string - -// Enum values for AccountStatus -const ( - AccountStatusActive AccountStatus = "ACTIVE" - AccountStatusSuspended AccountStatus = "SUSPENDED" - AccountStatusPendingClosure AccountStatus = "PENDING_CLOSURE" -) - -// Values returns all known values for AccountStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (AccountStatus) Values() []AccountStatus { - return []AccountStatus{ - "ACTIVE", - "SUSPENDED", - "PENDING_CLOSURE", - } -} - -type ActionType string - -// Enum values for ActionType -const ( - ActionTypeInviteAccountToOrganization ActionType = "INVITE" - ActionTypeEnableAllFeatures ActionType = "ENABLE_ALL_FEATURES" - ActionTypeApproveAllFeatures ActionType = "APPROVE_ALL_FEATURES" - ActionTypeAddOrganizationsServiceLinkedRole ActionType = "ADD_ORGANIZATIONS_SERVICE_LINKED_ROLE" - ActionTypeTransferResponsibility ActionType = "TRANSFER_RESPONSIBILITY" -) - -// Values returns all known values for ActionType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ActionType) Values() []ActionType { - return []ActionType{ - "INVITE", - "ENABLE_ALL_FEATURES", - "APPROVE_ALL_FEATURES", - "ADD_ORGANIZATIONS_SERVICE_LINKED_ROLE", - "TRANSFER_RESPONSIBILITY", - } -} - -type ChildType string - -// Enum values for ChildType -const ( - ChildTypeAccount ChildType = "ACCOUNT" - ChildTypeOrganizationalUnit ChildType = "ORGANIZATIONAL_UNIT" -) - -// Values returns all known values for ChildType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ChildType) Values() []ChildType { - return []ChildType{ - "ACCOUNT", - "ORGANIZATIONAL_UNIT", - } -} - -type ConstraintViolationExceptionReason string - -// Enum values for ConstraintViolationExceptionReason -const ( - ConstraintViolationExceptionReasonAccountNumberLimitExceeded ConstraintViolationExceptionReason = "ACCOUNT_NUMBER_LIMIT_EXCEEDED" - ConstraintViolationExceptionReasonHandshakeRateLimitExceeded ConstraintViolationExceptionReason = "HANDSHAKE_RATE_LIMIT_EXCEEDED" - ConstraintViolationExceptionReasonOuNumberLimitExceeded ConstraintViolationExceptionReason = "OU_NUMBER_LIMIT_EXCEEDED" - ConstraintViolationExceptionReasonOuDepthLimitExceeded ConstraintViolationExceptionReason = "OU_DEPTH_LIMIT_EXCEEDED" - ConstraintViolationExceptionReasonPolicyNumberLimitExceeded ConstraintViolationExceptionReason = "POLICY_NUMBER_LIMIT_EXCEEDED" - ConstraintViolationExceptionReasonPolicyContentLimitExceeded ConstraintViolationExceptionReason = "POLICY_CONTENT_LIMIT_EXCEEDED" - ConstraintViolationExceptionReasonMaxPolicyTypeAttachmentLimitExceeded ConstraintViolationExceptionReason = "MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED" - ConstraintViolationExceptionReasonMinPolicyTypeAttachmentLimitExceeded ConstraintViolationExceptionReason = "MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED" - ConstraintViolationExceptionReasonAccountCannotLeaveOrganization ConstraintViolationExceptionReason = "ACCOUNT_CANNOT_LEAVE_ORGANIZATION" - ConstraintViolationExceptionReasonAccountCannotLeaveWithoutEula ConstraintViolationExceptionReason = "ACCOUNT_CANNOT_LEAVE_WITHOUT_EULA" - ConstraintViolationExceptionReasonAccountCannotLeaveWithoutPhoneVerification ConstraintViolationExceptionReason = "ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION" - ConstraintViolationExceptionReasonMasterAccountPaymentInstrumentRequired ConstraintViolationExceptionReason = "MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED" - ConstraintViolationExceptionReasonMemberAccountPaymentInstrumentRequired ConstraintViolationExceptionReason = "MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED" - ConstraintViolationExceptionReasonAccountCreationRateLimitExceeded ConstraintViolationExceptionReason = "ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED" - ConstraintViolationExceptionReasonMasterAccountAddressDoesNotMatchMarketplace ConstraintViolationExceptionReason = "MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE" - ConstraintViolationExceptionReasonMasterAccountMissingContactInfo ConstraintViolationExceptionReason = "MASTER_ACCOUNT_MISSING_CONTACT_INFO" - ConstraintViolationExceptionReasonMasterAccountNotGovcloudEnabled ConstraintViolationExceptionReason = "MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED" - ConstraintViolationExceptionReasonOrganizationNotInAllFeaturesMode ConstraintViolationExceptionReason = "ORGANIZATION_NOT_IN_ALL_FEATURES_MODE" - ConstraintViolationExceptionReasonCreateOrganizationInBillingModeUnsupportedRegion ConstraintViolationExceptionReason = "CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION" - ConstraintViolationExceptionReasonEmailVerificationCodeExpired ConstraintViolationExceptionReason = "EMAIL_VERIFICATION_CODE_EXPIRED" - ConstraintViolationExceptionReasonWaitPeriodActive ConstraintViolationExceptionReason = "WAIT_PERIOD_ACTIVE" - ConstraintViolationExceptionReasonMaxTagLimitExceeded ConstraintViolationExceptionReason = "MAX_TAG_LIMIT_EXCEEDED" - ConstraintViolationExceptionReasonTagPolicyViolation ConstraintViolationExceptionReason = "TAG_POLICY_VIOLATION" - ConstraintViolationExceptionReasonMaxDelegatedAdministratorsForServiceLimitExceeded ConstraintViolationExceptionReason = "MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED" - ConstraintViolationExceptionReasonCannotRegisterMasterAsDelegatedAdministrator ConstraintViolationExceptionReason = "CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR" - ConstraintViolationExceptionReasonCannotRemoveDelegatedAdministratorFromOrg ConstraintViolationExceptionReason = "CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG" - ConstraintViolationExceptionReasonDelegatedAdministratorExistsForThisService ConstraintViolationExceptionReason = "DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE" - ConstraintViolationExceptionReasonPolicyTypeEnabledForThisService ConstraintViolationExceptionReason = "POLICY_TYPE_ENABLED_FOR_THIS_SERVICE" - ConstraintViolationExceptionReasonMasterAccountMissingBusinessLicense ConstraintViolationExceptionReason = "MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE" - ConstraintViolationExceptionReasonCannotCloseManagementAccount ConstraintViolationExceptionReason = "CANNOT_CLOSE_MANAGEMENT_ACCOUNT" - ConstraintViolationExceptionReasonCloseAccountQuotaExceeded ConstraintViolationExceptionReason = "CLOSE_ACCOUNT_QUOTA_EXCEEDED" - ConstraintViolationExceptionReasonCloseAccountRequestsLimitExceeded ConstraintViolationExceptionReason = "CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED" - ConstraintViolationExceptionReasonServiceAccessNotEnabled ConstraintViolationExceptionReason = "SERVICE_ACCESS_NOT_ENABLED" - ConstraintViolationExceptionReasonInvalidPaymentInstrument ConstraintViolationExceptionReason = "INVALID_PAYMENT_INSTRUMENT" - ConstraintViolationExceptionReasonAccountCreationNotComplete ConstraintViolationExceptionReason = "ACCOUNT_CREATION_NOT_COMPLETE" - ConstraintViolationExceptionReasonCannotRegisterSuspendedAccountAsDelegatedAdministrator ConstraintViolationExceptionReason = "CANNOT_REGISTER_SUSPENDED_ACCOUNT_AS_DELEGATED_ADMINISTRATOR" - ConstraintViolationExceptionReasonAllFeaturesMigrationOrganizationSizeLimitExceeded ConstraintViolationExceptionReason = "ALL_FEATURES_MIGRATION_ORGANIZATION_SIZE_LIMIT_EXCEEDED" - ConstraintViolationExceptionReasonResponsibilityTransferMaxLevelViolation ConstraintViolationExceptionReason = "RESPONSIBILITY_TRANSFER_MAX_LEVEL_VIOLATION" - ConstraintViolationExceptionReasonResponsibilityTransferMaxInboundQuotaViolation ConstraintViolationExceptionReason = "RESPONSIBILITY_TRANSFER_MAX_INBOUND_QUOTA_VIOLATION" - ConstraintViolationExceptionReasonResponsibilityTransferMaxOutboundQuotaViolation ConstraintViolationExceptionReason = "RESPONSIBILITY_TRANSFER_MAX_OUTBOUND_QUOTA_VIOLATION" - ConstraintViolationExceptionReasonResponsibilityTransferMaxTransfersQuotaViolation ConstraintViolationExceptionReason = "RESPONSIBILITY_TRANSFER_MAX_TRANSFERS_QUOTA_VIOLATION" - ConstraintViolationExceptionReasonActiveResponsibilityTransferProcess ConstraintViolationExceptionReason = "ACTIVE_RESPONSIBILITY_TRANSFER_PROCESS" - ConstraintViolationExceptionReasonTransferResponsibilityTargetDeletionInProgress ConstraintViolationExceptionReason = "TRANSFER_RESPONSIBILITY_TARGET_DELETION_IN_PROGRESS" - ConstraintViolationExceptionReasonTransferResponsibilitySourceDeletionInProgress ConstraintViolationExceptionReason = "TRANSFER_RESPONSIBILITY_SOURCE_DELETION_IN_PROGRESS" - ConstraintViolationExceptionReasonUnsupportedPricing ConstraintViolationExceptionReason = "UNSUPPORTED_PRICING" -) - -// Values returns all known values for ConstraintViolationExceptionReason. Note -// that this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ConstraintViolationExceptionReason) Values() []ConstraintViolationExceptionReason { - return []ConstraintViolationExceptionReason{ - "ACCOUNT_NUMBER_LIMIT_EXCEEDED", - "HANDSHAKE_RATE_LIMIT_EXCEEDED", - "OU_NUMBER_LIMIT_EXCEEDED", - "OU_DEPTH_LIMIT_EXCEEDED", - "POLICY_NUMBER_LIMIT_EXCEEDED", - "POLICY_CONTENT_LIMIT_EXCEEDED", - "MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED", - "MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED", - "ACCOUNT_CANNOT_LEAVE_ORGANIZATION", - "ACCOUNT_CANNOT_LEAVE_WITHOUT_EULA", - "ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION", - "MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED", - "MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED", - "ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED", - "MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE", - "MASTER_ACCOUNT_MISSING_CONTACT_INFO", - "MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED", - "ORGANIZATION_NOT_IN_ALL_FEATURES_MODE", - "CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION", - "EMAIL_VERIFICATION_CODE_EXPIRED", - "WAIT_PERIOD_ACTIVE", - "MAX_TAG_LIMIT_EXCEEDED", - "TAG_POLICY_VIOLATION", - "MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED", - "CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR", - "CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG", - "DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE", - "POLICY_TYPE_ENABLED_FOR_THIS_SERVICE", - "MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE", - "CANNOT_CLOSE_MANAGEMENT_ACCOUNT", - "CLOSE_ACCOUNT_QUOTA_EXCEEDED", - "CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED", - "SERVICE_ACCESS_NOT_ENABLED", - "INVALID_PAYMENT_INSTRUMENT", - "ACCOUNT_CREATION_NOT_COMPLETE", - "CANNOT_REGISTER_SUSPENDED_ACCOUNT_AS_DELEGATED_ADMINISTRATOR", - "ALL_FEATURES_MIGRATION_ORGANIZATION_SIZE_LIMIT_EXCEEDED", - "RESPONSIBILITY_TRANSFER_MAX_LEVEL_VIOLATION", - "RESPONSIBILITY_TRANSFER_MAX_INBOUND_QUOTA_VIOLATION", - "RESPONSIBILITY_TRANSFER_MAX_OUTBOUND_QUOTA_VIOLATION", - "RESPONSIBILITY_TRANSFER_MAX_TRANSFERS_QUOTA_VIOLATION", - "ACTIVE_RESPONSIBILITY_TRANSFER_PROCESS", - "TRANSFER_RESPONSIBILITY_TARGET_DELETION_IN_PROGRESS", - "TRANSFER_RESPONSIBILITY_SOURCE_DELETION_IN_PROGRESS", - "UNSUPPORTED_PRICING", - } -} - -type CreateAccountFailureReason string - -// Enum values for CreateAccountFailureReason -const ( - CreateAccountFailureReasonAccountLimitExceeded CreateAccountFailureReason = "ACCOUNT_LIMIT_EXCEEDED" - CreateAccountFailureReasonEmailAlreadyExists CreateAccountFailureReason = "EMAIL_ALREADY_EXISTS" - CreateAccountFailureReasonInvalidAddress CreateAccountFailureReason = "INVALID_ADDRESS" - CreateAccountFailureReasonInvalidEmail CreateAccountFailureReason = "INVALID_EMAIL" - CreateAccountFailureReasonConcurrentAccountModification CreateAccountFailureReason = "CONCURRENT_ACCOUNT_MODIFICATION" - CreateAccountFailureReasonInternalFailure CreateAccountFailureReason = "INTERNAL_FAILURE" - CreateAccountFailureReasonGovcloudAccountAlreadyExists CreateAccountFailureReason = "GOVCLOUD_ACCOUNT_ALREADY_EXISTS" - CreateAccountFailureReasonMissingBusinessValidation CreateAccountFailureReason = "MISSING_BUSINESS_VALIDATION" - CreateAccountFailureReasonFailedBusinessValidation CreateAccountFailureReason = "FAILED_BUSINESS_VALIDATION" - CreateAccountFailureReasonPendingBusinessVALIDATIONv CreateAccountFailureReason = "PENDING_BUSINESS_VALIDATION" - CreateAccountFailureReasonInvalidIdentityForBusinessValidation CreateAccountFailureReason = "INVALID_IDENTITY_FOR_BUSINESS_VALIDATION" - CreateAccountFailureReasonUnknownBusinessValidation CreateAccountFailureReason = "UNKNOWN_BUSINESS_VALIDATION" - CreateAccountFailureReasonMissingPaymentInstrument CreateAccountFailureReason = "MISSING_PAYMENT_INSTRUMENT" - CreateAccountFailureReasonInvalidPaymentInstrument CreateAccountFailureReason = "INVALID_PAYMENT_INSTRUMENT" - CreateAccountFailureReasonUpdateExistingResourcePolicyWithTagsNotSupported CreateAccountFailureReason = "UPDATE_EXISTING_RESOURCE_POLICY_WITH_TAGS_NOT_SUPPORTED" -) - -// Values returns all known values for CreateAccountFailureReason. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CreateAccountFailureReason) Values() []CreateAccountFailureReason { - return []CreateAccountFailureReason{ - "ACCOUNT_LIMIT_EXCEEDED", - "EMAIL_ALREADY_EXISTS", - "INVALID_ADDRESS", - "INVALID_EMAIL", - "CONCURRENT_ACCOUNT_MODIFICATION", - "INTERNAL_FAILURE", - "GOVCLOUD_ACCOUNT_ALREADY_EXISTS", - "MISSING_BUSINESS_VALIDATION", - "FAILED_BUSINESS_VALIDATION", - "PENDING_BUSINESS_VALIDATION", - "INVALID_IDENTITY_FOR_BUSINESS_VALIDATION", - "UNKNOWN_BUSINESS_VALIDATION", - "MISSING_PAYMENT_INSTRUMENT", - "INVALID_PAYMENT_INSTRUMENT", - "UPDATE_EXISTING_RESOURCE_POLICY_WITH_TAGS_NOT_SUPPORTED", - } -} - -type CreateAccountState string - -// Enum values for CreateAccountState -const ( - CreateAccountStateInProgress CreateAccountState = "IN_PROGRESS" - CreateAccountStateSucceeded CreateAccountState = "SUCCEEDED" - CreateAccountStateFailed CreateAccountState = "FAILED" -) - -// Values returns all known values for CreateAccountState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (CreateAccountState) Values() []CreateAccountState { - return []CreateAccountState{ - "IN_PROGRESS", - "SUCCEEDED", - "FAILED", - } -} - -type EffectivePolicyType string - -// Enum values for EffectivePolicyType -const ( - EffectivePolicyTypeTagPolicy EffectivePolicyType = "TAG_POLICY" - EffectivePolicyTypeBackupPolicy EffectivePolicyType = "BACKUP_POLICY" - EffectivePolicyTypeAiservicesOptOutPolicy EffectivePolicyType = "AISERVICES_OPT_OUT_POLICY" - EffectivePolicyTypeChatbotPolicy EffectivePolicyType = "CHATBOT_POLICY" - EffectivePolicyTypeDeclarativePolicyEc2 EffectivePolicyType = "DECLARATIVE_POLICY_EC2" - EffectivePolicyTypeSecurityhubPolicy EffectivePolicyType = "SECURITYHUB_POLICY" - EffectivePolicyTypeInspectorPolicy EffectivePolicyType = "INSPECTOR_POLICY" - EffectivePolicyTypeUpgradeRolloutPolicy EffectivePolicyType = "UPGRADE_ROLLOUT_POLICY" - EffectivePolicyTypeBedrockPolicy EffectivePolicyType = "BEDROCK_POLICY" - EffectivePolicyTypeS3Policy EffectivePolicyType = "S3_POLICY" - EffectivePolicyTypeNetworkSecurityDirectorPolicy EffectivePolicyType = "NETWORK_SECURITY_DIRECTOR_POLICY" -) - -// Values returns all known values for EffectivePolicyType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (EffectivePolicyType) Values() []EffectivePolicyType { - return []EffectivePolicyType{ - "TAG_POLICY", - "BACKUP_POLICY", - "AISERVICES_OPT_OUT_POLICY", - "CHATBOT_POLICY", - "DECLARATIVE_POLICY_EC2", - "SECURITYHUB_POLICY", - "INSPECTOR_POLICY", - "UPGRADE_ROLLOUT_POLICY", - "BEDROCK_POLICY", - "S3_POLICY", - "NETWORK_SECURITY_DIRECTOR_POLICY", - } -} - -type HandshakeConstraintViolationExceptionReason string - -// Enum values for HandshakeConstraintViolationExceptionReason -const ( - HandshakeConstraintViolationExceptionReasonAccountNumberLimitExceeded HandshakeConstraintViolationExceptionReason = "ACCOUNT_NUMBER_LIMIT_EXCEEDED" - HandshakeConstraintViolationExceptionReasonHandshakeRateLimitExceeded HandshakeConstraintViolationExceptionReason = "HANDSHAKE_RATE_LIMIT_EXCEEDED" - HandshakeConstraintViolationExceptionReasonAlreadyInAnOrganization HandshakeConstraintViolationExceptionReason = "ALREADY_IN_AN_ORGANIZATION" - HandshakeConstraintViolationExceptionReasonOrganizationAlreadyHasAllFeatures HandshakeConstraintViolationExceptionReason = "ORGANIZATION_ALREADY_HAS_ALL_FEATURES" - HandshakeConstraintViolationExceptionReasonOrganizationIsAlreadyPendingAllFeaturesMigration HandshakeConstraintViolationExceptionReason = "ORGANIZATION_IS_ALREADY_PENDING_ALL_FEATURES_MIGRATION" - HandshakeConstraintViolationExceptionReasonInviteDisabledDuringEnableAllFeatures HandshakeConstraintViolationExceptionReason = "INVITE_DISABLED_DURING_ENABLE_ALL_FEATURES" - HandshakeConstraintViolationExceptionReasonPaymentInstrumentRequired HandshakeConstraintViolationExceptionReason = "PAYMENT_INSTRUMENT_REQUIRED" - HandshakeConstraintViolationExceptionReasonOrganizationFromDifferentSellerOfRecord HandshakeConstraintViolationExceptionReason = "ORGANIZATION_FROM_DIFFERENT_SELLER_OF_RECORD" - HandshakeConstraintViolationExceptionReasonOrganizationMembershipChangeRateLimitExceeded HandshakeConstraintViolationExceptionReason = "ORGANIZATION_MEMBERSHIP_CHANGE_RATE_LIMIT_EXCEEDED" - HandshakeConstraintViolationExceptionReasonManagementAccountEmailNotVerified HandshakeConstraintViolationExceptionReason = "MANAGEMENT_ACCOUNT_EMAIL_NOT_VERIFIED" - HandshakeConstraintViolationExceptionReasonResponsibilityTransferAlreadyExists HandshakeConstraintViolationExceptionReason = "RESPONSIBILITY_TRANSFER_ALREADY_EXISTS" - HandshakeConstraintViolationExceptionReasonSourceAndTargetCannotMatch HandshakeConstraintViolationExceptionReason = "SOURCE_AND_TARGET_CANNOT_MATCH" - HandshakeConstraintViolationExceptionReasonUnusedPrepaymentBalance HandshakeConstraintViolationExceptionReason = "UNUSED_PREPAYMENT_BALANCE" - HandshakeConstraintViolationExceptionReasonLegacyPermissionsStillInUse HandshakeConstraintViolationExceptionReason = "LEGACY_PERMISSIONS_STILL_IN_USE" -) - -// Values returns all known values for -// HandshakeConstraintViolationExceptionReason. Note that this can be expanded in -// the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (HandshakeConstraintViolationExceptionReason) Values() []HandshakeConstraintViolationExceptionReason { - return []HandshakeConstraintViolationExceptionReason{ - "ACCOUNT_NUMBER_LIMIT_EXCEEDED", - "HANDSHAKE_RATE_LIMIT_EXCEEDED", - "ALREADY_IN_AN_ORGANIZATION", - "ORGANIZATION_ALREADY_HAS_ALL_FEATURES", - "ORGANIZATION_IS_ALREADY_PENDING_ALL_FEATURES_MIGRATION", - "INVITE_DISABLED_DURING_ENABLE_ALL_FEATURES", - "PAYMENT_INSTRUMENT_REQUIRED", - "ORGANIZATION_FROM_DIFFERENT_SELLER_OF_RECORD", - "ORGANIZATION_MEMBERSHIP_CHANGE_RATE_LIMIT_EXCEEDED", - "MANAGEMENT_ACCOUNT_EMAIL_NOT_VERIFIED", - "RESPONSIBILITY_TRANSFER_ALREADY_EXISTS", - "SOURCE_AND_TARGET_CANNOT_MATCH", - "UNUSED_PREPAYMENT_BALANCE", - "LEGACY_PERMISSIONS_STILL_IN_USE", - } -} - -type HandshakePartyType string - -// Enum values for HandshakePartyType -const ( - HandshakePartyTypeAccount HandshakePartyType = "ACCOUNT" - HandshakePartyTypeOrganization HandshakePartyType = "ORGANIZATION" - HandshakePartyTypeEmail HandshakePartyType = "EMAIL" -) - -// Values returns all known values for HandshakePartyType. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (HandshakePartyType) Values() []HandshakePartyType { - return []HandshakePartyType{ - "ACCOUNT", - "ORGANIZATION", - "EMAIL", - } -} - -type HandshakeResourceType string - -// Enum values for HandshakeResourceType -const ( - HandshakeResourceTypeAccount HandshakeResourceType = "ACCOUNT" - HandshakeResourceTypeOrganization HandshakeResourceType = "ORGANIZATION" - HandshakeResourceTypeOrganizationFeatureSet HandshakeResourceType = "ORGANIZATION_FEATURE_SET" - HandshakeResourceTypeEmail HandshakeResourceType = "EMAIL" - HandshakeResourceTypeMasterEmail HandshakeResourceType = "MASTER_EMAIL" - HandshakeResourceTypeMasterName HandshakeResourceType = "MASTER_NAME" - HandshakeResourceTypeNotes HandshakeResourceType = "NOTES" - HandshakeResourceTypeParentHandshake HandshakeResourceType = "PARENT_HANDSHAKE" - HandshakeResourceTypeResponsibilityTransfer HandshakeResourceType = "RESPONSIBILITY_TRANSFER" - HandshakeResourceTypeTransferStartTimestamp HandshakeResourceType = "TRANSFER_START_TIMESTAMP" - HandshakeResourceTypeTransferType HandshakeResourceType = "TRANSFER_TYPE" - HandshakeResourceTypeManagementAccount HandshakeResourceType = "MANAGEMENT_ACCOUNT" - HandshakeResourceTypeManagementEmail HandshakeResourceType = "MANAGEMENT_EMAIL" - HandshakeResourceTypeManagementName HandshakeResourceType = "MANAGEMENT_NAME" -) - -// Values returns all known values for HandshakeResourceType. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (HandshakeResourceType) Values() []HandshakeResourceType { - return []HandshakeResourceType{ - "ACCOUNT", - "ORGANIZATION", - "ORGANIZATION_FEATURE_SET", - "EMAIL", - "MASTER_EMAIL", - "MASTER_NAME", - "NOTES", - "PARENT_HANDSHAKE", - "RESPONSIBILITY_TRANSFER", - "TRANSFER_START_TIMESTAMP", - "TRANSFER_TYPE", - "MANAGEMENT_ACCOUNT", - "MANAGEMENT_EMAIL", - "MANAGEMENT_NAME", - } -} - -type HandshakeState string - -// Enum values for HandshakeState -const ( - HandshakeStateRequested HandshakeState = "REQUESTED" - HandshakeStateOpen HandshakeState = "OPEN" - HandshakeStateCanceled HandshakeState = "CANCELED" - HandshakeStateAccepted HandshakeState = "ACCEPTED" - HandshakeStateDeclined HandshakeState = "DECLINED" - HandshakeStateExpired HandshakeState = "EXPIRED" -) - -// Values returns all known values for HandshakeState. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (HandshakeState) Values() []HandshakeState { - return []HandshakeState{ - "REQUESTED", - "OPEN", - "CANCELED", - "ACCEPTED", - "DECLINED", - "EXPIRED", - } -} - -type IAMUserAccessToBilling string - -// Enum values for IAMUserAccessToBilling -const ( - IAMUserAccessToBillingAllow IAMUserAccessToBilling = "ALLOW" - IAMUserAccessToBillingDeny IAMUserAccessToBilling = "DENY" -) - -// Values returns all known values for IAMUserAccessToBilling. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (IAMUserAccessToBilling) Values() []IAMUserAccessToBilling { - return []IAMUserAccessToBilling{ - "ALLOW", - "DENY", - } -} - -type InvalidInputExceptionReason string - -// Enum values for InvalidInputExceptionReason -const ( - InvalidInputExceptionReasonInvalidPartyTypeTarget InvalidInputExceptionReason = "INVALID_PARTY_TYPE_TARGET" - InvalidInputExceptionReasonInvalidSyntaxOrganization InvalidInputExceptionReason = "INVALID_SYNTAX_ORGANIZATION_ARN" - InvalidInputExceptionReasonInvalidSyntaxPolicy InvalidInputExceptionReason = "INVALID_SYNTAX_POLICY_ID" - InvalidInputExceptionReasonInvalidEnum InvalidInputExceptionReason = "INVALID_ENUM" - InvalidInputExceptionReasonInvalidEnumPolicyType InvalidInputExceptionReason = "INVALID_ENUM_POLICY_TYPE" - InvalidInputExceptionReasonInvalidListMember InvalidInputExceptionReason = "INVALID_LIST_MEMBER" - InvalidInputExceptionReasonMaxLengthExceeded InvalidInputExceptionReason = "MAX_LENGTH_EXCEEDED" - InvalidInputExceptionReasonMaxValueExceeded InvalidInputExceptionReason = "MAX_VALUE_EXCEEDED" - InvalidInputExceptionReasonMinLengthExceeded InvalidInputExceptionReason = "MIN_LENGTH_EXCEEDED" - InvalidInputExceptionReasonMinValueExceeded InvalidInputExceptionReason = "MIN_VALUE_EXCEEDED" - InvalidInputExceptionReasonImmutablePolicy InvalidInputExceptionReason = "IMMUTABLE_POLICY" - InvalidInputExceptionReasonInvalidPattern InvalidInputExceptionReason = "INVALID_PATTERN" - InvalidInputExceptionReasonInvalidPatternTargetId InvalidInputExceptionReason = "INVALID_PATTERN_TARGET_ID" - InvalidInputExceptionReasonInputRequired InvalidInputExceptionReason = "INPUT_REQUIRED" - InvalidInputExceptionReasonInvalidPaginationToken InvalidInputExceptionReason = "INVALID_NEXT_TOKEN" - InvalidInputExceptionReasonMaxFilterLimitExceeded InvalidInputExceptionReason = "MAX_LIMIT_EXCEEDED_FILTER" - InvalidInputExceptionReasonMovingAccountBetweenDifferentRoots InvalidInputExceptionReason = "MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS" - InvalidInputExceptionReasonInvalidFullNameTarget InvalidInputExceptionReason = "INVALID_FULL_NAME_TARGET" - InvalidInputExceptionReasonUnrecognizedServicePrincipal InvalidInputExceptionReason = "UNRECOGNIZED_SERVICE_PRINCIPAL" - InvalidInputExceptionReasonInvalidRoleName InvalidInputExceptionReason = "INVALID_ROLE_NAME" - InvalidInputExceptionReasonInvalidSystemTagsParameter InvalidInputExceptionReason = "INVALID_SYSTEM_TAGS_PARAMETER" - InvalidInputExceptionReasonDuplicateTagKey InvalidInputExceptionReason = "DUPLICATE_TAG_KEY" - InvalidInputExceptionReasonTargetNotSupported InvalidInputExceptionReason = "TARGET_NOT_SUPPORTED" - InvalidInputExceptionReasonInvalidEmailAddressTarget InvalidInputExceptionReason = "INVALID_EMAIL_ADDRESS_TARGET" - InvalidInputExceptionReasonInvalidResourcePolicyJson InvalidInputExceptionReason = "INVALID_RESOURCE_POLICY_JSON" - InvalidInputExceptionReasonInvalidPrincipal InvalidInputExceptionReason = "INVALID_PRINCIPAL" - InvalidInputExceptionReasonUnsupportedActionInResourcePolicy InvalidInputExceptionReason = "UNSUPPORTED_ACTION_IN_RESOURCE_POLICY" - InvalidInputExceptionReasonUnsupportedPolicyTypeInResourcePolicy InvalidInputExceptionReason = "UNSUPPORTED_POLICY_TYPE_IN_RESOURCE_POLICY" - InvalidInputExceptionReasonUnsupportedResourceInResourcePolicy InvalidInputExceptionReason = "UNSUPPORTED_RESOURCE_IN_RESOURCE_POLICY" - InvalidInputExceptionReasonNonDetachablePolicy InvalidInputExceptionReason = "NON_DETACHABLE_POLICY" - InvalidInputExceptionReasonCallerRequiredFieldMissing InvalidInputExceptionReason = "CALLER_REQUIRED_FIELD_MISSING" - InvalidInputExceptionReasonUnsupportedActionInResponsibilityTransfer InvalidInputExceptionReason = "UNSUPPORTED_ACTION_IN_RESPONSIBILITY_TRANSFER" - InvalidInputExceptionReasonStartDateNotBeginningOfMonth InvalidInputExceptionReason = "START_DATE_NOT_BEGINNING_OF_MONTH" - InvalidInputExceptionReasonStartDateNotBeginningOfDay InvalidInputExceptionReason = "START_DATE_NOT_BEGINNING_OF_DAY" - InvalidInputExceptionReasonStartDateTooEarly InvalidInputExceptionReason = "START_DATE_TOO_EARLY" - InvalidInputExceptionReasonStartDateTooLate InvalidInputExceptionReason = "START_DATE_TOO_LATE" - InvalidInputExceptionReasonInvalidStartDate InvalidInputExceptionReason = "INVALID_START_DATE" - InvalidInputExceptionReasonEndDateNotEndOfMonth InvalidInputExceptionReason = "END_DATE_NOT_END_OF_MONTH" - InvalidInputExceptionReasonEndDateTooEarly InvalidInputExceptionReason = "END_DATE_TOO_EARLY" - InvalidInputExceptionReasonInvalidEndDate InvalidInputExceptionReason = "INVALID_END_DATE" -) - -// Values returns all known values for InvalidInputExceptionReason. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (InvalidInputExceptionReason) Values() []InvalidInputExceptionReason { - return []InvalidInputExceptionReason{ - "INVALID_PARTY_TYPE_TARGET", - "INVALID_SYNTAX_ORGANIZATION_ARN", - "INVALID_SYNTAX_POLICY_ID", - "INVALID_ENUM", - "INVALID_ENUM_POLICY_TYPE", - "INVALID_LIST_MEMBER", - "MAX_LENGTH_EXCEEDED", - "MAX_VALUE_EXCEEDED", - "MIN_LENGTH_EXCEEDED", - "MIN_VALUE_EXCEEDED", - "IMMUTABLE_POLICY", - "INVALID_PATTERN", - "INVALID_PATTERN_TARGET_ID", - "INPUT_REQUIRED", - "INVALID_NEXT_TOKEN", - "MAX_LIMIT_EXCEEDED_FILTER", - "MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS", - "INVALID_FULL_NAME_TARGET", - "UNRECOGNIZED_SERVICE_PRINCIPAL", - "INVALID_ROLE_NAME", - "INVALID_SYSTEM_TAGS_PARAMETER", - "DUPLICATE_TAG_KEY", - "TARGET_NOT_SUPPORTED", - "INVALID_EMAIL_ADDRESS_TARGET", - "INVALID_RESOURCE_POLICY_JSON", - "INVALID_PRINCIPAL", - "UNSUPPORTED_ACTION_IN_RESOURCE_POLICY", - "UNSUPPORTED_POLICY_TYPE_IN_RESOURCE_POLICY", - "UNSUPPORTED_RESOURCE_IN_RESOURCE_POLICY", - "NON_DETACHABLE_POLICY", - "CALLER_REQUIRED_FIELD_MISSING", - "UNSUPPORTED_ACTION_IN_RESPONSIBILITY_TRANSFER", - "START_DATE_NOT_BEGINNING_OF_MONTH", - "START_DATE_NOT_BEGINNING_OF_DAY", - "START_DATE_TOO_EARLY", - "START_DATE_TOO_LATE", - "INVALID_START_DATE", - "END_DATE_NOT_END_OF_MONTH", - "END_DATE_TOO_EARLY", - "INVALID_END_DATE", - } -} - -type OrganizationFeatureSet string - -// Enum values for OrganizationFeatureSet -const ( - OrganizationFeatureSetAll OrganizationFeatureSet = "ALL" - OrganizationFeatureSetConsolidatedBilling OrganizationFeatureSet = "CONSOLIDATED_BILLING" -) - -// Values returns all known values for OrganizationFeatureSet. Note that this can -// be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (OrganizationFeatureSet) Values() []OrganizationFeatureSet { - return []OrganizationFeatureSet{ - "ALL", - "CONSOLIDATED_BILLING", - } -} - -type ParentType string - -// Enum values for ParentType -const ( - ParentTypeRoot ParentType = "ROOT" - ParentTypeOrganizationalUnit ParentType = "ORGANIZATIONAL_UNIT" -) - -// Values returns all known values for ParentType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ParentType) Values() []ParentType { - return []ParentType{ - "ROOT", - "ORGANIZATIONAL_UNIT", - } -} - -type PolicyType string - -// Enum values for PolicyType -const ( - PolicyTypeServiceControlPolicy PolicyType = "SERVICE_CONTROL_POLICY" - PolicyTypeResourceControlPolicy PolicyType = "RESOURCE_CONTROL_POLICY" - PolicyTypeTagPolicy PolicyType = "TAG_POLICY" - PolicyTypeBackupPolicy PolicyType = "BACKUP_POLICY" - PolicyTypeAiservicesOptOutPolicy PolicyType = "AISERVICES_OPT_OUT_POLICY" - PolicyTypeChatbotPolicy PolicyType = "CHATBOT_POLICY" - PolicyTypeDeclarativePolicyEc2 PolicyType = "DECLARATIVE_POLICY_EC2" - PolicyTypeSecurityhubPolicy PolicyType = "SECURITYHUB_POLICY" - PolicyTypeInspectorPolicy PolicyType = "INSPECTOR_POLICY" - PolicyTypeUpgradeRolloutPolicy PolicyType = "UPGRADE_ROLLOUT_POLICY" - PolicyTypeBedrockPolicy PolicyType = "BEDROCK_POLICY" - PolicyTypeS3Policy PolicyType = "S3_POLICY" - PolicyTypeNetworkSecurityDirectorPolicy PolicyType = "NETWORK_SECURITY_DIRECTOR_POLICY" -) - -// Values returns all known values for PolicyType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (PolicyType) Values() []PolicyType { - return []PolicyType{ - "SERVICE_CONTROL_POLICY", - "RESOURCE_CONTROL_POLICY", - "TAG_POLICY", - "BACKUP_POLICY", - "AISERVICES_OPT_OUT_POLICY", - "CHATBOT_POLICY", - "DECLARATIVE_POLICY_EC2", - "SECURITYHUB_POLICY", - "INSPECTOR_POLICY", - "UPGRADE_ROLLOUT_POLICY", - "BEDROCK_POLICY", - "S3_POLICY", - "NETWORK_SECURITY_DIRECTOR_POLICY", - } -} - -type PolicyTypeStatus string - -// Enum values for PolicyTypeStatus -const ( - PolicyTypeStatusEnabled PolicyTypeStatus = "ENABLED" - PolicyTypeStatusPendingEnable PolicyTypeStatus = "PENDING_ENABLE" - PolicyTypeStatusPendingDisable PolicyTypeStatus = "PENDING_DISABLE" -) - -// Values returns all known values for PolicyTypeStatus. Note that this can be -// expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (PolicyTypeStatus) Values() []PolicyTypeStatus { - return []PolicyTypeStatus{ - "ENABLED", - "PENDING_ENABLE", - "PENDING_DISABLE", - } -} - -type ResponsibilityTransferStatus string - -// Enum values for ResponsibilityTransferStatus -const ( - ResponsibilityTransferStatusRequested ResponsibilityTransferStatus = "REQUESTED" - ResponsibilityTransferStatusDeclined ResponsibilityTransferStatus = "DECLINED" - ResponsibilityTransferStatusCanceled ResponsibilityTransferStatus = "CANCELED" - ResponsibilityTransferStatusExpired ResponsibilityTransferStatus = "EXPIRED" - ResponsibilityTransferStatusAccepted ResponsibilityTransferStatus = "ACCEPTED" - ResponsibilityTransferStatusWithdrawn ResponsibilityTransferStatus = "WITHDRAWN" -) - -// Values returns all known values for ResponsibilityTransferStatus. Note that -// this can be expanded in the future, and so it is only as up to date as the -// client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ResponsibilityTransferStatus) Values() []ResponsibilityTransferStatus { - return []ResponsibilityTransferStatus{ - "REQUESTED", - "DECLINED", - "CANCELED", - "EXPIRED", - "ACCEPTED", - "WITHDRAWN", - } -} - -type ResponsibilityTransferType string - -// Enum values for ResponsibilityTransferType -const ( - ResponsibilityTransferTypeBilling ResponsibilityTransferType = "BILLING" -) - -// Values returns all known values for ResponsibilityTransferType. Note that this -// can be expanded in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (ResponsibilityTransferType) Values() []ResponsibilityTransferType { - return []ResponsibilityTransferType{ - "BILLING", - } -} - -type TargetType string - -// Enum values for TargetType -const ( - TargetTypeAccount TargetType = "ACCOUNT" - TargetTypeOrganizationalUnit TargetType = "ORGANIZATIONAL_UNIT" - TargetTypeRoot TargetType = "ROOT" -) - -// Values returns all known values for TargetType. Note that this can be expanded -// in the future, and so it is only as up to date as the client. -// -// The ordering of this slice is not guaranteed to be stable across updates. -func (TargetType) Values() []TargetType { - return []TargetType{ - "ACCOUNT", - "ORGANIZATIONAL_UNIT", - "ROOT", - } -} diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/types/errors.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/types/errors.go deleted file mode 100644 index aa24c03663..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/types/errors.go +++ /dev/null @@ -1,1782 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - "fmt" - smithy "github.com/aws/smithy-go" -) - -// You don't have permissions to perform the requested operation. The user or role -// that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see [Access Management]in the -// IAM User Guide. -// -// [Access Management]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html -type AccessDeniedException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *AccessDeniedException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *AccessDeniedException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "AccessDeniedException" - } - return *e.ErrorCodeOverride -} -func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The operation that you attempted requires you to have the -// iam:CreateServiceLinkedRole for organizations.amazonaws.com permission so that -// Organizations can create the required service-linked role. You don't have that -// permission. -type AccessDeniedForDependencyException struct { - Message *string - - ErrorCodeOverride *string - - Reason AccessDeniedForDependencyExceptionReason - - noSmithyDocumentSerde -} - -func (e *AccessDeniedForDependencyException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *AccessDeniedForDependencyException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *AccessDeniedForDependencyException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "AccessDeniedForDependencyException" - } - return *e.ErrorCodeOverride -} -func (e *AccessDeniedForDependencyException) ErrorFault() smithy.ErrorFault { - return smithy.FaultClient -} - -// You attempted to close an account that is already closed. -type AccountAlreadyClosedException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *AccountAlreadyClosedException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *AccountAlreadyClosedException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *AccountAlreadyClosedException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "AccountAlreadyClosedException" - } - return *e.ErrorCodeOverride -} -func (e *AccountAlreadyClosedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The specified account is already a delegated administrator for this Amazon Web -// Services service. -type AccountAlreadyRegisteredException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *AccountAlreadyRegisteredException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *AccountAlreadyRegisteredException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *AccountAlreadyRegisteredException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "AccountAlreadyRegisteredException" - } - return *e.ErrorCodeOverride -} -func (e *AccountAlreadyRegisteredException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// We can't find an Amazon Web Services account with the AccountId that you -// -// specified, or the account whose credentials you used to make this request isn't -// a member of an organization. -type AccountNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *AccountNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *AccountNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *AccountNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "AccountNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *AccountNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The specified account is not a delegated administrator for this Amazon Web -// Services service. -type AccountNotRegisteredException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *AccountNotRegisteredException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *AccountNotRegisteredException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *AccountNotRegisteredException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "AccountNotRegisteredException" - } - return *e.ErrorCodeOverride -} -func (e *AccountNotRegisteredException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// You can't invite an existing account to your organization until you verify that -// you own the email address associated with the management account. For more -// information, see [Email address verification]in the Organizations User Guide. -// -// [Email address verification]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_create.html#about-email-verification -type AccountOwnerNotVerifiedException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *AccountOwnerNotVerifiedException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *AccountOwnerNotVerifiedException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *AccountOwnerNotVerifiedException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "AccountOwnerNotVerifiedException" - } - return *e.ErrorCodeOverride -} -func (e *AccountOwnerNotVerifiedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// This account is already a member of an organization. An account can belong to -// only one organization at a time. -type AlreadyInOrganizationException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *AlreadyInOrganizationException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *AlreadyInOrganizationException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *AlreadyInOrganizationException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "AlreadyInOrganizationException" - } - return *e.ErrorCodeOverride -} -func (e *AlreadyInOrganizationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Your account isn't a member of an organization. To make this request, you must -// use the credentials of an account that belongs to an organization. -type AWSOrganizationsNotInUseException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *AWSOrganizationsNotInUseException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *AWSOrganizationsNotInUseException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *AWSOrganizationsNotInUseException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "AWSOrganizationsNotInUseException" - } - return *e.ErrorCodeOverride -} -func (e *AWSOrganizationsNotInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// We can't find an organizational unit (OU) or Amazon Web Services account with -// the ChildId that you specified. -type ChildNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *ChildNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ChildNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ChildNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ChildNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *ChildNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The target of the operation is currently being modified by a different request. -// Try again later. -type ConcurrentModificationException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *ConcurrentModificationException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ConcurrentModificationException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ConcurrentModificationException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ConcurrentModificationException" - } - return *e.ErrorCodeOverride -} -func (e *ConcurrentModificationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The request failed because it conflicts with the current state of the specified -// resource. -type ConflictException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ConflictException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ConflictException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ConflictException" - } - return *e.ErrorCodeOverride -} -func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from an OU -// or root, inviting or creating too many accounts to the organization, or -// attaching too many policies to an account, OU, or root. This exception includes -// a reason that contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. Instead, -// after you remove all member accounts, delete the organization itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove an -// account from the organization that doesn't yet have enough information to exist -// as a standalone account. This account requires you to first complete phone -// verification. Follow the steps at [Removing a member account from your organization]in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// accounts that you can create in one day. -// -// - ACCOUNT_CREATION_NOT_COMPLETE: Your account setup isn't complete or your -// account isn't fully active. You must complete the account setup before you -// create an organization. -// -// - ACTIVE_RESPONSIBILITY_TRANSFER_PROCESS: You cannot delete organization due -// to an ongoing responsibility transfer process. For example, a pending invitation -// or an in-progress transfer. To delete the organization, you must resolve the -// current transfer process. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on the -// number of accounts in an organization. If you need more accounts, contact [Amazon Web Services Support]to -// request an increase in your limit. -// -// Or the number of invitations that you tried to send would cause you to exceed -// -// the limit of accounts in your organization. Send fewer invitations or contact -// Amazon Web Services Support to request an increase in the number of accounts. -// -// Deleted and closed accounts still count toward your limit. -// -// If you get this exception when running a command immediately after creating the -// -// organization, wait one hour and try again. After an hour, if the command -// continues to fail with this error, contact [Amazon Web Services Support]. -// -// - ALL_FEATURES_MIGRATION_ORGANIZATION_SIZE_LIMIT_EXCEEDED: Your organization -// has more than 5000 accounts, and you can only use the standard migration process -// for organizations with less than 5000 accounts. Use the assisted migration -// process to enable all features mode, or create a support case for assistance if -// you are unable to use assisted migration. -// -// - CANNOT_REGISTER_SUSPENDED_ACCOUNT_AS_DELEGATED_ADMINISTRATOR: You cannot -// register a suspended account as a delegated administrator. -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You can -// designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must first -// either remove or close all member accounts in the organization. Follow standard -// account closure process using root credentials. -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove an -// account that is registered as a delegated administrator for a service integrated -// with your organization. To complete this operation, you must first deregister -// this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota for the -// past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon Web -// Services service that already has a delegated administrator. To complete this -// operation, you must first deregister any existing delegated administrators for -// this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only valid -// for a limited period of time. You must resubmit the request and generate a new -// verification code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see [Managing your Amazon Web Services payments]. -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account in -// this organization, you first must migrate the organization's management account -// to the marketplace that corresponds to the management account's address. All -// accounts in an organization must be associated with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon Web -// Services Regions in China. To create an organization, the master must have a -// valid business license. For more information, contact customer support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you must -// first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see [Organizations]in the Amazon Web -// Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization with -// this management account, you first must associate a valid payment instrument, -// such as a credit card, with the account. For more information, see [Considerations before removing an account from an organization]in the -// Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted to -// register more delegated administrators than allowed for the service principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity at one -// time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed on -// this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation with -// this member account, you first must associate a valid payment instrument, such -// as a credit card, with the account. For more information, see [Considerations before removing an account from an organization]in the -// Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a policy -// from an entity that would cause the entity to have fewer than the minimum number -// of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an -// operation that requires the organization to be configured to support all -// features. An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is too -// many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs that -// you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that is -// larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - POLICY_TYPE_ENABLED_FOR_THIS_SERVICE: You attempted to disable service -// access before you disabled the policy type (for example, SECURITYHUB_POLICY). To -// complete this operation, you must first disable the policy type. -// -// - RESPONSIBILITY_TRANSFER_MAX_INBOUND_QUOTA_VIOLATION: You have exceeded your -// inbound transfers limit. -// -// - RESPONSIBILITY_TRANSFER_MAX_LEVEL_VIOLATION: You have exceeded the maximum -// length of your transfer chain. -// -// - RESPONSIBILITY_TRANSFER_MAX_OUTBOUND_QUOTA_VIOLATION: You have exceeded -// your outbound transfers limit. -// -// - RESPONSIBILITY_TRANSFER_MAX_TRANSFERS_QUOTA_VIOLATION: You have exceeded -// the maximum number of inbound transfers allowed in a transfer chain. -// -// - SERVICE_ACCESS_NOT_ENABLED: -// -// - You attempted to register a delegated administrator before you enabled -// service access. Call the EnableAWSServiceAccess API first. -// -// - You attempted to enable a policy type before you enabled service access. -// Call the EnableAWSServiceAccess API first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this account. -// -// - TRANSFER_RESPONSIBILITY_SOURCE_DELETION_IN_PROGRESS: The source -// organization cannot accept this transfer invitation because it is marked for -// deletion. -// -// - TRANSFER_RESPONSIBILITY_TARGET_DELETION_IN_PROGRESS: The source -// organization cannot accept this transfer invitation because target organization -// is marked for deletion. -// -// - UNSUPPORTED_PRICING: Your organization has a pricing contract that is -// unsupported. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, you -// must wait until at least four days after the account was created. Invited -// accounts aren't subject to this waiting period. -// -// [Amazon Web Services Support]: https://console.aws.amazon.com/support/home#/ -// [Removing a member account from your organization]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master -// -// [Managing your Amazon Web Services payments]: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html -// [Organizations]: https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html -// [Considerations before removing an account from an organization]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_account-before-remove.html -type ConstraintViolationException struct { - Message *string - - ErrorCodeOverride *string - - Reason ConstraintViolationExceptionReason - - noSmithyDocumentSerde -} - -func (e *ConstraintViolationException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ConstraintViolationException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ConstraintViolationException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ConstraintViolationException" - } - return *e.ErrorCodeOverride -} -func (e *ConstraintViolationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// We can't find an create account request with the CreateAccountRequestId that -// you specified. -type CreateAccountStatusNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *CreateAccountStatusNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *CreateAccountStatusNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *CreateAccountStatusNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "CreateAccountStatusNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *CreateAccountStatusNotFoundException) ErrorFault() smithy.ErrorFault { - return smithy.FaultClient -} - -// We can't find the destination container (a root or OU) with the ParentId that -// you specified. -type DestinationParentNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *DestinationParentNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *DestinationParentNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *DestinationParentNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "DestinationParentNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *DestinationParentNotFoundException) ErrorFault() smithy.ErrorFault { - return smithy.FaultClient -} - -// That account is already present in the specified destination. -type DuplicateAccountException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *DuplicateAccountException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *DuplicateAccountException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *DuplicateAccountException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "DuplicateAccountException" - } - return *e.ErrorCodeOverride -} -func (e *DuplicateAccountException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// A handshake with the same action and target already exists. For example, if you -// invited an account to join your organization, the invited account might already -// have a pending invitation from this organization. If you intend to resend an -// invitation to an account, ensure that existing handshakes that might be -// considered duplicates are canceled or declined. -type DuplicateHandshakeException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *DuplicateHandshakeException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *DuplicateHandshakeException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *DuplicateHandshakeException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "DuplicateHandshakeException" - } - return *e.ErrorCodeOverride -} -func (e *DuplicateHandshakeException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// An OU with the same name already exists. -type DuplicateOrganizationalUnitException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *DuplicateOrganizationalUnitException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *DuplicateOrganizationalUnitException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *DuplicateOrganizationalUnitException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "DuplicateOrganizationalUnitException" - } - return *e.ErrorCodeOverride -} -func (e *DuplicateOrganizationalUnitException) ErrorFault() smithy.ErrorFault { - return smithy.FaultClient -} - -// The selected policy is already attached to the specified target. -type DuplicatePolicyAttachmentException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *DuplicatePolicyAttachmentException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *DuplicatePolicyAttachmentException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *DuplicatePolicyAttachmentException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "DuplicatePolicyAttachmentException" - } - return *e.ErrorCodeOverride -} -func (e *DuplicatePolicyAttachmentException) ErrorFault() smithy.ErrorFault { - return smithy.FaultClient -} - -// A policy with the same name already exists. -type DuplicatePolicyException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *DuplicatePolicyException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *DuplicatePolicyException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *DuplicatePolicyException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "DuplicatePolicyException" - } - return *e.ErrorCodeOverride -} -func (e *DuplicatePolicyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// If you ran this action on the management account, this policy type is not -// enabled. If you ran the action on a member account, the account doesn't have an -// effective policy of this type. Contact the administrator of your organization -// about attaching a policy of this type to the account. -type EffectivePolicyNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *EffectivePolicyNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *EffectivePolicyNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *EffectivePolicyNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "EffectivePolicyNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *EffectivePolicyNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Organizations couldn't perform the operation because your organization hasn't -// finished initializing. This can take up to an hour. Try again later. If after -// one hour you continue to receive this error, contact [Amazon Web Services Support]. -// -// [Amazon Web Services Support]: https://console.aws.amazon.com/support/home#/ -type FinalizingOrganizationException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *FinalizingOrganizationException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *FinalizingOrganizationException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *FinalizingOrganizationException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "FinalizingOrganizationException" - } - return *e.ErrorCodeOverride -} -func (e *FinalizingOrganizationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The specified handshake is already in the requested state. For example, you -// can't accept a handshake that was already accepted. -type HandshakeAlreadyInStateException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *HandshakeAlreadyInStateException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *HandshakeAlreadyInStateException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *HandshakeAlreadyInStateException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "HandshakeAlreadyInStateException" - } - return *e.ErrorCodeOverride -} -func (e *HandshakeAlreadyInStateException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The requested operation would violate the constraint identified in the reason -// code. -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation: -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on the -// number of accounts in an organization. Note that deleted and closed accounts -// still count toward your limit. -// -// If you get this exception immediately after creating the organization, wait one -// -// hour and try again. If after an hour it continues to fail with this error, -// contact [Amazon Web Services Support]. -// -// - ALREADY_IN_AN_ORGANIZATION: The handshake request is invalid because the -// invited account is already a member of an organization. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVITE_DISABLED_DURING_ENABLE_ALL_FEATURES: You can't issue new invitations -// to join an organization while it's in the process of enabling all features. You -// can resume inviting accounts after you finalize the process when all accounts -// have agreed to the change. -// -// - LEGACY_PERMISSIONS_STILL_IN_USE: Your organization must migrate to use the -// new IAM fine-grained actions for billing, cost management, and accounts. -// -// - ORGANIZATION_ALREADY_HAS_ALL_FEATURES: The handshake request is invalid -// because the organization has already enabled all features. -// -// - ORGANIZATION_FROM_DIFFERENT_SELLER_OF_RECORD: The request failed because -// the account is from a different marketplace than the accounts in the -// organization. -// -// - ORGANIZATION_IS_ALREADY_PENDING_ALL_FEATURES_MIGRATION: The handshake -// request is invalid because the organization has already started the process to -// enable all features. -// -// - ORGANIZATION_MEMBERSHIP_CHANGE_RATE_LIMIT_EXCEEDED: You attempted to change -// the membership of an account too quickly after its previous change. -// -// - PAYMENT_INSTRUMENT_REQUIRED: You can't complete the operation with an -// account that doesn't have a payment instrument, such as a credit card, -// associated with it. -// -// - RESPONSIBILITY_TRANSFER_ALREADY_EXISTS: You cannot perform this operation -// with the current transfer. -// -// - SOURCE_AND_TARGET_CANNOT_MATCH: An account can't accept a transfer -// invitation if it is both the sender and recipient of the invitation. -// -// - UNUSED_PREPAYMENT_BALANCE: Your organization has an outstanding pre-payment -// balance. -// -// [Amazon Web Services Support]: https://console.aws.amazon.com/support/home#/ -type HandshakeConstraintViolationException struct { - Message *string - - ErrorCodeOverride *string - - Reason HandshakeConstraintViolationExceptionReason - - noSmithyDocumentSerde -} - -func (e *HandshakeConstraintViolationException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *HandshakeConstraintViolationException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *HandshakeConstraintViolationException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "HandshakeConstraintViolationException" - } - return *e.ErrorCodeOverride -} -func (e *HandshakeConstraintViolationException) ErrorFault() smithy.ErrorFault { - return smithy.FaultClient -} - -// We can't find a handshake with the HandshakeId that you specified. -type HandshakeNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *HandshakeNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *HandshakeNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *HandshakeNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "HandshakeNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *HandshakeNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// You can't perform the operation on the handshake in its current state. For -// example, you can't cancel a handshake that was already accepted or accept a -// handshake that was already declined. -type InvalidHandshakeTransitionException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *InvalidHandshakeTransitionException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InvalidHandshakeTransitionException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InvalidHandshakeTransitionException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InvalidHandshakeTransitionException" - } - return *e.ErrorCodeOverride -} -func (e *InvalidHandshakeTransitionException) ErrorFault() smithy.ErrorFault { - return smithy.FaultClient -} - -// The requested operation failed because you provided invalid values for one or -// more of the request parameters. This exception includes a reason that contains -// additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - CALLER_REQUIRED_FIELD_MISSING: At least one of the required field is -// missing: Caller Account Id, Management Account Id or Organization Id. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to the -// same entity. -// -// - END_DATE_NOT_END_OF_MONTH: You provided an invalid end date. The end date -// must be the end of the last day of the month (23.59.59.999). -// -// - END_DATE_TOO_EARLY: You provided an invalid end date. It is too early for -// the transfer to end. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address for -// the invited account owner. -// -// - INVALID_END_DATE: The selected withdrawal date doesn't meet the terms of -// your partner agreement. Visit Amazon Web Services Partner Central to view your -// partner agreements or contact your Amazon Web Services Partner for help. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains at -// least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter from the -// response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_PRINCIPAL: You specified an invalid principal element in the policy. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role name -// can't begin with the reserved prefix AWSServiceRoleFor . -// -// - INVALID_START_DATE: The start date doesn't meet the minimum requirements. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're reserved for -// Amazon Web Services use. System tags don’t count against your tags per resource -// limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter for -// the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer than -// allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter than -// allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - NON_DETACHABLE_POLICY: You can't detach this Amazon Web Services Managed -// Policy. -// -// - START_DATE_NOT_BEGINNING_OF_DAY: You provided an invalid start date. The -// start date must be the beginning of the day (00:00:00.000). -// -// - START_DATE_NOT_BEGINNING_OF_MONTH: You provided an invalid start date. The -// start date must be the first day of the month. -// -// - START_DATE_TOO_EARLY: You provided an invalid start date. The start date is -// too early. -// -// - START_DATE_TOO_LATE: You provided an invalid start date. The start date is -// too late. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - UNSUPPORTED_ACTION_IN_RESPONSIBILITY_TRANSFER: You provided a value that is -// not supported by this operation. -type InvalidInputException struct { - Message *string - - ErrorCodeOverride *string - - Reason InvalidInputExceptionReason - - noSmithyDocumentSerde -} - -func (e *InvalidInputException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InvalidInputException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InvalidInputException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InvalidInputException" - } - return *e.ErrorCodeOverride -} -func (e *InvalidInputException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The responsibility transfer can't transition to the requested state because -// it's not in a valid state for this operation. -type InvalidResponsibilityTransferTransitionException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *InvalidResponsibilityTransferTransitionException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InvalidResponsibilityTransferTransitionException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InvalidResponsibilityTransferTransitionException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InvalidResponsibilityTransferTransitionException" - } - return *e.ErrorCodeOverride -} -func (e *InvalidResponsibilityTransferTransitionException) ErrorFault() smithy.ErrorFault { - return smithy.FaultClient -} - -// The provided policy document doesn't meet the requirements of the specified -// policy type. For example, the syntax might be incorrect. For details about -// service control policy syntax, see [SCP syntax]in the Organizations User Guide. -// -// [SCP syntax]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scps_syntax.html -type MalformedPolicyDocumentException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *MalformedPolicyDocumentException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *MalformedPolicyDocumentException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *MalformedPolicyDocumentException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "MalformedPolicyDocumentException" - } - return *e.ErrorCodeOverride -} -func (e *MalformedPolicyDocumentException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// You can't remove a management account from an organization. If you want the -// management account to become a member account in another organization, you must -// first delete the current organization of the management account. -type MasterCannotLeaveOrganizationException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *MasterCannotLeaveOrganizationException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *MasterCannotLeaveOrganizationException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *MasterCannotLeaveOrganizationException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "MasterCannotLeaveOrganizationException" - } - return *e.ErrorCodeOverride -} -func (e *MasterCannotLeaveOrganizationException) ErrorFault() smithy.ErrorFault { - return smithy.FaultClient -} - -// The specified OU is not empty. Move all accounts to another root or to other -// OUs, remove all child OUs, and try the operation again. -type OrganizationalUnitNotEmptyException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *OrganizationalUnitNotEmptyException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *OrganizationalUnitNotEmptyException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *OrganizationalUnitNotEmptyException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "OrganizationalUnitNotEmptyException" - } - return *e.ErrorCodeOverride -} -func (e *OrganizationalUnitNotEmptyException) ErrorFault() smithy.ErrorFault { - return smithy.FaultClient -} - -// We can't find an OU with the OrganizationalUnitId that you specified. -type OrganizationalUnitNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *OrganizationalUnitNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *OrganizationalUnitNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *OrganizationalUnitNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "OrganizationalUnitNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *OrganizationalUnitNotFoundException) ErrorFault() smithy.ErrorFault { - return smithy.FaultClient -} - -// The organization isn't empty. To delete an organization, you must first remove -// all accounts except the management account. -type OrganizationNotEmptyException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *OrganizationNotEmptyException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *OrganizationNotEmptyException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *OrganizationNotEmptyException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "OrganizationNotEmptyException" - } - return *e.ErrorCodeOverride -} -func (e *OrganizationNotEmptyException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// We can't find a root or OU with the ParentId that you specified. -type ParentNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *ParentNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ParentNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ParentNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ParentNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *ParentNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Changes to the effective policy are in progress, and its contents can't be -// returned. Try the operation again later. -type PolicyChangesInProgressException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *PolicyChangesInProgressException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *PolicyChangesInProgressException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *PolicyChangesInProgressException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "PolicyChangesInProgressException" - } - return *e.ErrorCodeOverride -} -func (e *PolicyChangesInProgressException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The policy is attached to one or more entities. You must detach it from all -// roots, OUs, and accounts before performing this operation. -type PolicyInUseException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *PolicyInUseException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *PolicyInUseException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *PolicyInUseException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "PolicyInUseException" - } - return *e.ErrorCodeOverride -} -func (e *PolicyInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The policy isn't attached to the specified target in the specified root. -type PolicyNotAttachedException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *PolicyNotAttachedException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *PolicyNotAttachedException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *PolicyNotAttachedException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "PolicyNotAttachedException" - } - return *e.ErrorCodeOverride -} -func (e *PolicyNotAttachedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// We can't find a policy with the PolicyId that you specified. -type PolicyNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *PolicyNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *PolicyNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *PolicyNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "PolicyNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *PolicyNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The specified policy type is already enabled in the specified root. -type PolicyTypeAlreadyEnabledException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *PolicyTypeAlreadyEnabledException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *PolicyTypeAlreadyEnabledException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *PolicyTypeAlreadyEnabledException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "PolicyTypeAlreadyEnabledException" - } - return *e.ErrorCodeOverride -} -func (e *PolicyTypeAlreadyEnabledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// You can't use the specified policy type with the feature set currently enabled -// for this organization. For example, you can enable SCPs only after you enable -// all features in the organization. For more information, see [Managing Organizations policies]in the -// Organizations User Guide. -// -// [Managing Organizations policies]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html#enable_policies_on_root -type PolicyTypeNotAvailableForOrganizationException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *PolicyTypeNotAvailableForOrganizationException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *PolicyTypeNotAvailableForOrganizationException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *PolicyTypeNotAvailableForOrganizationException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "PolicyTypeNotAvailableForOrganizationException" - } - return *e.ErrorCodeOverride -} -func (e *PolicyTypeNotAvailableForOrganizationException) ErrorFault() smithy.ErrorFault { - return smithy.FaultClient -} - -// The specified policy type isn't currently enabled in this root. You can't -// attach policies of the specified type to entities in a root until you enable -// that type in the root. For more information, see [Enabling all features in your organization]in the Organizations User -// Guide. -// -// [Enabling all features in your organization]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html -type PolicyTypeNotEnabledException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *PolicyTypeNotEnabledException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *PolicyTypeNotEnabledException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *PolicyTypeNotEnabledException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "PolicyTypeNotEnabledException" - } - return *e.ErrorCodeOverride -} -func (e *PolicyTypeNotEnabledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// We can't find a resource policy request with the parameter that you specified. -type ResourcePolicyNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *ResourcePolicyNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ResourcePolicyNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ResourcePolicyNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ResourcePolicyNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *ResourcePolicyNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// The responsibility transfer is already in the status that you specified. -type ResponsibilityTransferAlreadyInStatusException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *ResponsibilityTransferAlreadyInStatusException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ResponsibilityTransferAlreadyInStatusException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ResponsibilityTransferAlreadyInStatusException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ResponsibilityTransferAlreadyInStatusException" - } - return *e.ErrorCodeOverride -} -func (e *ResponsibilityTransferAlreadyInStatusException) ErrorFault() smithy.ErrorFault { - return smithy.FaultClient -} - -// We can't find a transfer that you specified. -type ResponsibilityTransferNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *ResponsibilityTransferNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ResponsibilityTransferNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ResponsibilityTransferNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ResponsibilityTransferNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *ResponsibilityTransferNotFoundException) ErrorFault() smithy.ErrorFault { - return smithy.FaultClient -} - -// We can't find a root with the RootId that you specified. -type RootNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *RootNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *RootNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *RootNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "RootNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *RootNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// Organizations can't complete your request because of an internal service error. -// Try again later. -type ServiceException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *ServiceException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *ServiceException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *ServiceException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "ServiceException" - } - return *e.ErrorCodeOverride -} -func (e *ServiceException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } - -// We can't find a source root or OU with the ParentId that you specified. -type SourceParentNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *SourceParentNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *SourceParentNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *SourceParentNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "SourceParentNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *SourceParentNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// We can't find a root, OU, account, or policy with the TargetId that you -// specified. -type TargetNotFoundException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *TargetNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *TargetNotFoundException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *TargetNotFoundException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "TargetNotFoundException" - } - return *e.ErrorCodeOverride -} -func (e *TargetNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// You have sent too many requests in too short a period of time. The quota helps -// protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see [Quotas for Organizations] in the -// Organizations User Guide. -// -// [Quotas for Organizations]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html -type TooManyRequestsException struct { - Message *string - - ErrorCodeOverride *string - - Type *string - - noSmithyDocumentSerde -} - -func (e *TooManyRequestsException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *TooManyRequestsException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *TooManyRequestsException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "TooManyRequestsException" - } - return *e.ErrorCodeOverride -} -func (e *TooManyRequestsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// This action isn't available in the current Amazon Web Services Region. -type UnsupportedAPIEndpointException struct { - Message *string - - ErrorCodeOverride *string - - noSmithyDocumentSerde -} - -func (e *UnsupportedAPIEndpointException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *UnsupportedAPIEndpointException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *UnsupportedAPIEndpointException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "UnsupportedAPIEndpointException" - } - return *e.ErrorCodeOverride -} -func (e *UnsupportedAPIEndpointException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/types/types.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/types/types.go deleted file mode 100644 index 203af0b686..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/types/types.go +++ /dev/null @@ -1,838 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - smithydocument "github.com/aws/smithy-go/document" - "time" -) - -// Contains information about an Amazon Web Services account that is a member of -// an organization. -type Account struct { - - // The Amazon Resource Name (ARN) of the account. - // - // For more information about ARNs in Organizations, see [ARN Formats Supported by Organizations] in the Amazon Web - // Services Service Authorization Reference. - // - // [ARN Formats Supported by Organizations]: https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies - Arn *string - - // The email address associated with the Amazon Web Services account. - // - // The [regex pattern] for this parameter is a string of characters that represents a standard - // internet email address. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - Email *string - - // The unique identifier (ID) of the account. - // - // The [regex pattern] for an account ID string requires exactly 12 digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - Id *string - - // The method by which the account joined the organization. - JoinedMethod AccountJoinedMethod - - // The date the account became a part of the organization. - JoinedTimestamp *time.Time - - // The friendly name of the account. - // - // The [regex pattern] that is used to validate this parameter is a string of any of the - // characters in the ASCII character range. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - Name *string - - // The paths in the organization where the account exists. - Paths []string - - // Each state represents a specific phase in the account lifecycle. Use this - // information to manage account access, automate workflows, or trigger actions - // based on account state changes. - // - // For more information about account states and their implications, see [Monitor the state of your Amazon Web Services accounts] in the - // Organizations User Guide. - // - // [Monitor the state of your Amazon Web Services accounts]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_account_state.html - State AccountState - - // The status of the account in the organization. - // - // The Status parameter in the Account object will be retired on September 9, - // 2026. Although both the account State and account Status parameters are - // currently available in the Organizations APIs ( DescribeAccount , ListAccounts , - // ListAccountsForParent ), we recommend that you update your scripts or other code - // to use the State parameter instead of Status before September 9, 2026. - Status AccountStatus - - noSmithyDocumentSerde -} - -// Contains a list of child entities, either OUs or accounts. -type Child struct { - - // The unique identifier (ID) of this child entity. - // - // The [regex pattern] for a child ID string requires one of the following: - // - // - Account - A string that consists of exactly 12 digits. - // - // - Organizational unit (OU) - A string that begins with "ou-" followed by from - // 4 to 32 lowercase letters or digits (the ID of the root that contains the OU). - // This string is followed by a second "-" dash and from 8 to 32 additional - // lowercase letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - Id *string - - // The type of this child entity. - Type ChildType - - noSmithyDocumentSerde -} - -// Contains the status about a CreateAccount or CreateGovCloudAccount request to create an Amazon Web Services -// account or an Amazon Web Services GovCloud (US) account in an organization. -type CreateAccountStatus struct { - - // If the account was created successfully, the unique identifier (ID) of the new - // account. - // - // The [regex pattern] for an account ID string requires exactly 12 digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - AccountId *string - - // The account name given to the account when it was created. - AccountName *string - - // The date and time that the account was created and the request completed. - CompletedTimestamp *time.Time - - // If the request failed, a description of the reason for the failure. - // - // - ACCOUNT_LIMIT_EXCEEDED: The account couldn't be created because you reached - // the limit on the number of accounts in your organization. - // - // - CONCURRENT_ACCOUNT_MODIFICATION: You already submitted a request with the - // same information. - // - // - EMAIL_ALREADY_EXISTS: The account could not be created because another - // Amazon Web Services account with that email address already exists. - // - // - FAILED_BUSINESS_VALIDATION: The Amazon Web Services account that owns your - // organization failed to receive business license validation. - // - // - GOVCLOUD_ACCOUNT_ALREADY_EXISTS: The account in the Amazon Web Services - // GovCloud (US) Region could not be created because this Region already includes - // an account with that email address. - // - // - IDENTITY_INVALID_BUSINESS_VALIDATION: The Amazon Web Services account that - // owns your organization can't complete business license validation because it - // doesn't have valid identity data. - // - // - INVALID_ADDRESS: The account could not be created because the address you - // provided is not valid. - // - // - INVALID_EMAIL: The account could not be created because the email address - // you provided is not valid. - // - // - INVALID_PAYMENT_INSTRUMENT: The Amazon Web Services account that owns your - // organization does not have a supported payment method associated with the - // account. Amazon Web Services does not support cards issued by financial - // institutions in Russia or Belarus. For more information, see [Managing your Amazon Web Services payments]. - // - // - INTERNAL_FAILURE: The account could not be created because of an internal - // failure. Try again later. If the problem persists, contact Amazon Web Services - // Customer Support. - // - // - MISSING_BUSINESS_VALIDATION: The Amazon Web Services account that owns your - // organization has not received Business Validation. - // - // - MISSING_PAYMENT_INSTRUMENT: You must configure the management account with - // a valid payment method, such as a credit card. - // - // - PENDING_BUSINESS_VALIDATION: The Amazon Web Services account that owns your - // organization is still in the process of completing business license validation. - // - // - UNKNOWN_BUSINESS_VALIDATION: The Amazon Web Services account that owns your - // organization has an unknown issue with business license validation. - // - // [Managing your Amazon Web Services payments]: https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html - FailureReason CreateAccountFailureReason - - // If the account was created successfully, the ID for the new account in the - // Amazon Web Services GovCloud (US) Region. - GovCloudAccountId *string - - // The unique identifier (ID) that references this request. You get this value - // from the response of the initial CreateAccountrequest to create the account. - // - // The [regex pattern] for a create account request ID string requires "car-" followed by from 8 - // to 32 lowercase letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - Id *string - - // The date and time that the request was made for the account creation. - RequestedTimestamp *time.Time - - // The status of the asynchronous request to create an Amazon Web Services account. - State CreateAccountState - - noSmithyDocumentSerde -} - -// Contains information about the delegated administrator. -type DelegatedAdministrator struct { - - // The Amazon Resource Name (ARN) of the delegated administrator's account. - Arn *string - - // The date when the account was made a delegated administrator. - DelegationEnabledDate *time.Time - - // The email address that is associated with the delegated administrator's Amazon - // Web Services account. - Email *string - - // The unique identifier (ID) of the delegated administrator's account. - Id *string - - // The method by which the delegated administrator's account joined the - // organization. - JoinedMethod AccountJoinedMethod - - // The date when the delegated administrator's account became a part of the - // organization. - JoinedTimestamp *time.Time - - // The friendly name of the delegated administrator's account. - Name *string - - // Each state represents a specific phase in the account lifecycle. Use this - // information to manage account access, automate workflows, or trigger actions - // based on account state changes. - // - // For more information about account states and their implications, see [Monitor the state of your Amazon Web Services accounts] in the - // Organizations User Guide. - // - // [Monitor the state of your Amazon Web Services accounts]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_account_state.html - State AccountState - - // The status of the delegated administrator's account in the organization. - Status AccountStatus - - noSmithyDocumentSerde -} - -// Contains information about the Amazon Web Services service for which the -// account is a delegated administrator. -type DelegatedService struct { - - // The date that the account became a delegated administrator for this service. - DelegationEnabledDate *time.Time - - // The name of an Amazon Web Services service that can request an operation for - // the specified service. This is typically in the form of a URL, such as: - // servicename.amazonaws.com . - ServicePrincipal *string - - noSmithyDocumentSerde -} - -// Contains rules to be applied to the affected accounts. The effective policy is -// the aggregation of any policies the account inherits, plus any policy directly -// attached to the account. -type EffectivePolicy struct { - - // The time of the last update to this policy. - LastUpdatedTimestamp *time.Time - - // The text content of the policy. - PolicyContent *string - - // The policy type. - PolicyType EffectivePolicyType - - // The account ID of the policy target. - TargetId *string - - noSmithyDocumentSerde -} - -// Contains details about the validation errors that occurred when generating or -// enforcing an [effective policy], such as which policies contributed to the error and location of -// the error. -// -// [effective policy]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_effective.html -type EffectivePolicyValidationError struct { - - // The individual policies [inherited] and [attached] to the account which contributed to the - // validation error. - // - // [inherited]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_inheritance_mgmt.html - // [attached]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_policies_attach.html - ContributingPolicies []string - - // The error code for the validation error. For example, ELEMENTS_TOO_MANY . - ErrorCode *string - - // The error message for the validation error. - ErrorMessage *string - - // The path within the effective policy where the validation error occurred. - PathToError *string - - noSmithyDocumentSerde -} - -// A structure that contains details of a service principal that represents an -// Amazon Web Services service that is enabled to integrate with Organizations. -type EnabledServicePrincipal struct { - - // The date that the service principal was enabled for integration with - // Organizations. - DateEnabled *time.Time - - // The name of the service principal. This is typically in the form of a URL, such - // as: servicename.amazonaws.com . - ServicePrincipal *string - - noSmithyDocumentSerde -} - -// Contains details for a handshake. A handshake is the secure exchange of -// information between two Amazon Web Services accounts: a sender and a recipient. -// -// Note: Handshakes that are CANCELED , ACCEPTED , DECLINED , or EXPIRED show up -// in lists for only 30 days after entering that state After that they are deleted. -type Handshake struct { - - // The type of handshake: - // - // - INVITE: Handshake sent to a standalone account requesting that it to join - // the sender's organization. - // - // - ENABLE_ALL_FEATURES: Handshake sent to invited member accounts to enable - // all features for the organization. - // - // - APPROVE_ALL_FEATURES: Handshake sent to the management account when all - // invited member accounts have approved to enable all features. - // - // - TRANSFER_RESPONSIBILITY: Handshake sent to another organization's - // management account requesting that it designate the sender with the specified - // responsibilities for recipient's organization. - Action ActionType - - // Amazon Resource Name (ARN) for the handshake. - // - // For more information about ARNs in Organizations, see [ARN Formats Supported by Organizations] in the Amazon Web - // Services Service Authorization Reference. - // - // [ARN Formats Supported by Organizations]: https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies - Arn *string - - // Timestamp when the handshake expires. - ExpirationTimestamp *time.Time - - // ID for the handshake. - // - // The [regex pattern] for handshake ID string requires "h-" followed by from 8 to 32 lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - Id *string - - // An array of HandshakeParty objects. Contains details for participant in a - // handshake. - Parties []HandshakeParty - - // Timestamp when the handshake request was made. - RequestedTimestamp *time.Time - - // An array of HandshakeResource objects. When needed, contains additional details - // for a handshake. For example, the email address for the sender. - Resources []HandshakeResource - - // Current state for the handshake. - // - // - REQUESTED: Handshake awaiting a response from the recipient. - // - // - OPEN: Handshake sent to multiple recipients and all recipients have - // responded. The sender can now complete the handshake action. - // - // - CANCELED: Handshake canceled by the sender. - // - // - ACCEPTED: Handshake accepted by the recipient. - // - // - DECLINED: Handshake declined by the recipient. - // - // - EXPIRED: Handshake has expired. - State HandshakeState - - noSmithyDocumentSerde -} - -// Contains the filter used to select the handshakes for an operation. -type HandshakeFilter struct { - - // The type of handshake. - // - // If you specify ActionType , you cannot also specify ParentHandshakeId . - ActionType ActionType - - // The parent handshake. Only used for handshake types that are a child of another - // type. - // - // If you specify ParentHandshakeId , you cannot also specify ActionType . - // - // The [regex pattern] for handshake ID string requires "h-" followed by from 8 to 32 lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - ParentHandshakeId *string - - noSmithyDocumentSerde -} - -// Contains details for a participant in a handshake. -type HandshakeParty struct { - - // ID for the participant: Acccount ID, organization ID, or email address. - // - // The [regex pattern] for handshake ID string requires "h-" followed by from 8 to 32 lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - // - // This member is required. - Id *string - - // The type of ID for the participant. - // - // This member is required. - Type HandshakePartyType - - noSmithyDocumentSerde -} - -// Contains additional details for a handshake. -type HandshakeResource struct { - - // An array of HandshakeResource objects. When needed, contains additional details - // for a handshake. For example, the email address for the sender. - Resources []HandshakeResource - - // The type of information being passed, specifying how the value is to be - // interpreted by the other party: - // - // - ACCOUNT: ID for an Amazon Web Services account. - // - // - ORGANIZATION: ID for an organization. - // - // - EMAIL: Email address for the recipient. - // - // - OWNER_EMAIL: Email address for the sender. - // - // - OWNER_NAME: Name of the sender. - // - // - NOTES: Additional text included by the sender for the recipient. - Type HandshakeResourceType - - // Additional information for the handshake. The format of the value string must - // match the requirements of the specified type. - Value *string - - noSmithyDocumentSerde -} - -// Contains details about an organization. An organization is a collection of -// accounts that are centrally managed together using consolidated billing, -// organized hierarchically with organizational units (OUs), and controlled with -// policies . -type Organization struct { - - // The Amazon Resource Name (ARN) of an organization. - // - // For more information about ARNs in Organizations, see [ARN Formats Supported by Organizations] in the Amazon Web - // Services Service Authorization Reference. - // - // [ARN Formats Supported by Organizations]: https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies - Arn *string - - // Do not use. This field is deprecated and doesn't provide complete information - // about the policies in your organization. - // - // To determine the policies that are enabled and available for use in your - // organization, use the ListRootsoperation instead. - AvailablePolicyTypes []PolicyTypeSummary - - // Specifies the functionality that currently is available to the organization. If - // set to "ALL", then all features are enabled and policies can be applied to - // accounts in the organization. If set to "CONSOLIDATED_BILLING", then only - // consolidated billing functionality is available. For more information, see [Enabling all features in your organization]in - // the Organizations User Guide. - // - // [Enabling all features in your organization]: https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html - FeatureSet OrganizationFeatureSet - - // The unique identifier (ID) of an organization. - // - // The [regex pattern] for an organization ID string requires "o-" followed by from 10 to 32 - // lowercase letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - Id *string - - // The Amazon Resource Name (ARN) of the account that is designated as the - // management account for the organization. - // - // For more information about ARNs in Organizations, see [ARN Formats Supported by Organizations] in the Amazon Web - // Services Service Authorization Reference. - // - // [ARN Formats Supported by Organizations]: https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies - MasterAccountArn *string - - // The email address that is associated with the Amazon Web Services account that - // is designated as the management account for the organization. - MasterAccountEmail *string - - // The unique identifier (ID) of the management account of an organization. - // - // The [regex pattern] for an account ID string requires exactly 12 digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - MasterAccountId *string - - noSmithyDocumentSerde -} - -// Contains details about an organizational unit (OU). An OU is a container of -// Amazon Web Services accounts within a root of an organization. Policies that are -// attached to an OU apply to all accounts contained in that OU and in any child -// OUs. -type OrganizationalUnit struct { - - // The Amazon Resource Name (ARN) of this OU. - // - // For more information about ARNs in Organizations, see [ARN Formats Supported by Organizations] in the Amazon Web - // Services Service Authorization Reference. - // - // [ARN Formats Supported by Organizations]: https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies - Arn *string - - // The unique identifier (ID) associated with this OU. The ID is unique to the - // organization only. - // - // The [regex pattern] for an organizational unit ID string requires "ou-" followed by from 4 to - // 32 lowercase letters or digits (the ID of the root that contains the OU). This - // string is followed by a second "-" dash and from 8 to 32 additional lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - Id *string - - // The friendly name of this OU. - // - // The [regex pattern] that is used to validate this parameter is a string of any of the - // characters in the ASCII character range. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - Name *string - - // The path in the organization where this OU exists. - Path *string - - noSmithyDocumentSerde -} - -// Contains information about either a root or an organizational unit (OU) that -// can contain OUs or accounts in an organization. -type Parent struct { - - // The unique identifier (ID) of the parent entity. - // - // The [regex pattern] for a parent ID string requires one of the following: - // - // - Root - A string that begins with "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // - Organizational unit (OU) - A string that begins with "ou-" followed by from - // 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This - // string is followed by a second "-" dash and from 8 to 32 additional lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - Id *string - - // The type of the parent entity. - Type ParentType - - noSmithyDocumentSerde -} - -// Contains rules to be applied to the affected accounts. Policies can be attached -// directly to accounts, or to roots and OUs to affect all accounts in those -// hierarchies. -type Policy struct { - - // The text content of the policy. - Content *string - - // A structure that contains additional details about the policy. - PolicySummary *PolicySummary - - noSmithyDocumentSerde -} - -// Contains information about a policy, but does not include the content. To see -// the content of a policy, see DescribePolicy. -type PolicySummary struct { - - // The Amazon Resource Name (ARN) of the policy. - // - // For more information about ARNs in Organizations, see [ARN Formats Supported by Organizations] in the Amazon Web - // Services Service Authorization Reference. - // - // [ARN Formats Supported by Organizations]: https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies - Arn *string - - // A boolean value that indicates whether the specified policy is an Amazon Web - // Services managed policy. If true, then you can attach the policy to roots, OUs, - // or accounts, but you cannot edit it. - AwsManaged bool - - // The description of the policy. - Description *string - - // The unique identifier (ID) of the policy. - // - // The [regex pattern] for a policy ID string requires "p-" followed by from 8 to 128 lowercase - // or uppercase letters, digits, or the underscore character (_). - // - // [regex pattern]: http://wikipedia.org/wiki/regex - Id *string - - // The friendly name of the policy. - // - // The [regex pattern] that is used to validate this parameter is a string of any of the - // characters in the ASCII character range. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - Name *string - - // The type of policy. - Type PolicyType - - noSmithyDocumentSerde -} - -// Contains information about a root, OU, or account that a policy is attached to. -type PolicyTargetSummary struct { - - // The Amazon Resource Name (ARN) of the policy target. - // - // For more information about ARNs in Organizations, see [ARN Formats Supported by Organizations] in the Amazon Web - // Services Service Authorization Reference. - // - // [ARN Formats Supported by Organizations]: https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies - Arn *string - - // The friendly name of the policy target. - // - // The [regex pattern] that is used to validate this parameter is a string of any of the - // characters in the ASCII character range. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - Name *string - - // The unique identifier (ID) of the policy target. - // - // The [regex pattern] for a target ID string requires one of the following: - // - // - Root - A string that begins with "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // - Account - A string that consists of exactly 12 digits. - // - // - Organizational unit (OU) - A string that begins with "ou-" followed by from - // 4 to 32 lowercase letters or digits (the ID of the root that the OU is in). This - // string is followed by a second "-" dash and from 8 to 32 additional lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - TargetId *string - - // The type of the policy target. - Type TargetType - - noSmithyDocumentSerde -} - -// Contains information about a policy type and its status in the associated root. -type PolicyTypeSummary struct { - - // The status of the policy type as it relates to the associated root. To attach a - // policy of the specified type to a root or to an OU or account in that root, it - // must be available in the organization and enabled for that root. - Status PolicyTypeStatus - - // The name of the policy type. - Type PolicyType - - noSmithyDocumentSerde -} - -// A structure that contains details about a resource policy. -type ResourcePolicy struct { - - // The policy text of the resource policy. - Content *string - - // A structure that contains resource policy ID and Amazon Resource Name (ARN). - ResourcePolicySummary *ResourcePolicySummary - - noSmithyDocumentSerde -} - -// A structure that contains resource policy ID and Amazon Resource Name (ARN). -type ResourcePolicySummary struct { - - // The Amazon Resource Name (ARN) of the resource policy. - Arn *string - - // The unique identifier (ID) of the resource policy. - Id *string - - noSmithyDocumentSerde -} - -// Contains details for a transfer. A transfer is the arrangement between two -// management accounts where one account designates the other with specified -// responsibilities for their organization. -type ResponsibilityTransfer struct { - - // ID for the handshake of the transfer. - ActiveHandshakeId *string - - // Amazon Resource Name (ARN) for the transfer. - Arn *string - - // Timestamp when the transfer ends. - EndTimestamp *time.Time - - // ID for the transfer. - Id *string - - // Name assigned to the transfer. - Name *string - - // Account that allows another account external to its organization to manage the - // specified responsibilities for the organization. - Source *TransferParticipant - - // Timestamp when the transfer starts. - StartTimestamp *time.Time - - // Status for the transfer. - Status ResponsibilityTransferStatus - - // Account that manages the specified responsibilities for another organization. - Target *TransferParticipant - - // The type of transfer. Currently, only BILLING is supported. - Type ResponsibilityTransferType - - noSmithyDocumentSerde -} - -// Contains details about a root. A root is a top-level parent node in the -// hierarchy of an organization that can contain organizational units (OUs) and -// accounts. The root contains every Amazon Web Services account in the -// organization. -type Root struct { - - // The Amazon Resource Name (ARN) of the root. - // - // For more information about ARNs in Organizations, see [ARN Formats Supported by Organizations] in the Amazon Web - // Services Service Authorization Reference. - // - // [ARN Formats Supported by Organizations]: https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies - Arn *string - - // The unique identifier (ID) for the root. The ID is unique to the organization - // only. - // - // The [regex pattern] for a root ID string requires "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - Id *string - - // The friendly name of the root. - // - // The [regex pattern] that is used to validate this parameter is a string of any of the - // characters in the ASCII character range. - // - // [regex pattern]: http://wikipedia.org/wiki/regex - Name *string - - // The types of policies that are currently enabled for the root and therefore can - // be attached to the root or to its OUs or accounts. - // - // Even if a policy type is shown as available in the organization, you can - // separately enable and disable them at the root level by using EnablePolicyTypeand DisablePolicyType. Use DescribeOrganization to see - // the availability of the policy types in that organization. - PolicyTypes []PolicyTypeSummary - - noSmithyDocumentSerde -} - -// A custom key-value pair associated with a resource within your organization. -// -// You can attach tags to any of the following organization resources. -// -// - Amazon Web Services account -// -// - Organizational unit (OU) -// -// - Organization root -// -// - Policy -type Tag struct { - - // The key identifier, or name, of the tag. - // - // This member is required. - Key *string - - // The string value that's associated with the key of the tag. You can set the - // value of a tag to an empty string, but you can't set the value of a tag to null. - // - // This member is required. - Value *string - - noSmithyDocumentSerde -} - -// Contains details for a participant in a transfer. A transfer is the arrangement -// between two management accounts where one account designates the other with -// specified responsibilities for their organization. -type TransferParticipant struct { - - // Email address for the management account. - ManagementAccountEmail *string - - // ID for the management account. - ManagementAccountId *string - - noSmithyDocumentSerde -} - -type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/validators.go b/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/validators.go deleted file mode 100644 index 50c9264afb..0000000000 --- a/vendor/github.com/aws/aws-sdk-go-v2/service/organizations/validators.go +++ /dev/null @@ -1,2091 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package organizations - -import ( - "context" - "fmt" - "github.com/aws/aws-sdk-go-v2/service/organizations/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" -) - -type validateOpAcceptHandshake struct { -} - -func (*validateOpAcceptHandshake) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAcceptHandshake) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AcceptHandshakeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAcceptHandshakeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAttachPolicy struct { -} - -func (*validateOpAttachPolicy) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAttachPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AttachPolicyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAttachPolicyInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCancelHandshake struct { -} - -func (*validateOpCancelHandshake) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCancelHandshake) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CancelHandshakeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCancelHandshakeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCloseAccount struct { -} - -func (*validateOpCloseAccount) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCloseAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CloseAccountInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCloseAccountInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateAccount struct { -} - -func (*validateOpCreateAccount) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateAccountInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateAccountInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateGovCloudAccount struct { -} - -func (*validateOpCreateGovCloudAccount) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateGovCloudAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateGovCloudAccountInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateGovCloudAccountInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreateOrganizationalUnit struct { -} - -func (*validateOpCreateOrganizationalUnit) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreateOrganizationalUnit) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreateOrganizationalUnitInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreateOrganizationalUnitInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpCreatePolicy struct { -} - -func (*validateOpCreatePolicy) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpCreatePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*CreatePolicyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpCreatePolicyInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeclineHandshake struct { -} - -func (*validateOpDeclineHandshake) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeclineHandshake) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeclineHandshakeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeclineHandshakeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeleteOrganizationalUnit struct { -} - -func (*validateOpDeleteOrganizationalUnit) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeleteOrganizationalUnit) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeleteOrganizationalUnitInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeleteOrganizationalUnitInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeletePolicy struct { -} - -func (*validateOpDeletePolicy) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeletePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeletePolicyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeletePolicyInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDeregisterDelegatedAdministrator struct { -} - -func (*validateOpDeregisterDelegatedAdministrator) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDeregisterDelegatedAdministrator) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DeregisterDelegatedAdministratorInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDeregisterDelegatedAdministratorInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeAccount struct { -} - -func (*validateOpDescribeAccount) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeAccountInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeAccountInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeCreateAccountStatus struct { -} - -func (*validateOpDescribeCreateAccountStatus) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeCreateAccountStatus) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeCreateAccountStatusInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeCreateAccountStatusInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeEffectivePolicy struct { -} - -func (*validateOpDescribeEffectivePolicy) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeEffectivePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeEffectivePolicyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeEffectivePolicyInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeHandshake struct { -} - -func (*validateOpDescribeHandshake) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeHandshake) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeHandshakeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeHandshakeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeOrganizationalUnit struct { -} - -func (*validateOpDescribeOrganizationalUnit) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeOrganizationalUnit) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeOrganizationalUnitInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeOrganizationalUnitInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribePolicy struct { -} - -func (*validateOpDescribePolicy) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribePolicyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribePolicyInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDescribeResponsibilityTransfer struct { -} - -func (*validateOpDescribeResponsibilityTransfer) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDescribeResponsibilityTransfer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DescribeResponsibilityTransferInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDescribeResponsibilityTransferInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDetachPolicy struct { -} - -func (*validateOpDetachPolicy) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDetachPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DetachPolicyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDetachPolicyInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisableAWSServiceAccess struct { -} - -func (*validateOpDisableAWSServiceAccess) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisableAWSServiceAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisableAWSServiceAccessInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisableAWSServiceAccessInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisablePolicyType struct { -} - -func (*validateOpDisablePolicyType) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisablePolicyType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisablePolicyTypeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisablePolicyTypeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpEnableAWSServiceAccess struct { -} - -func (*validateOpEnableAWSServiceAccess) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpEnableAWSServiceAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*EnableAWSServiceAccessInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpEnableAWSServiceAccessInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpEnablePolicyType struct { -} - -func (*validateOpEnablePolicyType) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpEnablePolicyType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*EnablePolicyTypeInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpEnablePolicyTypeInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpInviteAccountToOrganization struct { -} - -func (*validateOpInviteAccountToOrganization) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpInviteAccountToOrganization) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*InviteAccountToOrganizationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpInviteAccountToOrganizationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpInviteOrganizationToTransferResponsibility struct { -} - -func (*validateOpInviteOrganizationToTransferResponsibility) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpInviteOrganizationToTransferResponsibility) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*InviteOrganizationToTransferResponsibilityInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpInviteOrganizationToTransferResponsibilityInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListAccountsForParent struct { -} - -func (*validateOpListAccountsForParent) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListAccountsForParent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListAccountsForParentInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListAccountsForParentInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListAccountsWithInvalidEffectivePolicy struct { -} - -func (*validateOpListAccountsWithInvalidEffectivePolicy) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListAccountsWithInvalidEffectivePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListAccountsWithInvalidEffectivePolicyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListAccountsWithInvalidEffectivePolicyInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListChildren struct { -} - -func (*validateOpListChildren) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListChildren) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListChildrenInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListChildrenInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListDelegatedServicesForAccount struct { -} - -func (*validateOpListDelegatedServicesForAccount) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListDelegatedServicesForAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListDelegatedServicesForAccountInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListDelegatedServicesForAccountInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListEffectivePolicyValidationErrors struct { -} - -func (*validateOpListEffectivePolicyValidationErrors) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListEffectivePolicyValidationErrors) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListEffectivePolicyValidationErrorsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListEffectivePolicyValidationErrorsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListInboundResponsibilityTransfers struct { -} - -func (*validateOpListInboundResponsibilityTransfers) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListInboundResponsibilityTransfers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListInboundResponsibilityTransfersInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListInboundResponsibilityTransfersInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListOrganizationalUnitsForParent struct { -} - -func (*validateOpListOrganizationalUnitsForParent) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListOrganizationalUnitsForParent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListOrganizationalUnitsForParentInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListOrganizationalUnitsForParentInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListOutboundResponsibilityTransfers struct { -} - -func (*validateOpListOutboundResponsibilityTransfers) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListOutboundResponsibilityTransfers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListOutboundResponsibilityTransfersInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListOutboundResponsibilityTransfersInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListParents struct { -} - -func (*validateOpListParents) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListParents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListParentsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListParentsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListPoliciesForTarget struct { -} - -func (*validateOpListPoliciesForTarget) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListPoliciesForTarget) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListPoliciesForTargetInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListPoliciesForTargetInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListPolicies struct { -} - -func (*validateOpListPolicies) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListPolicies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListPoliciesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListPoliciesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListTagsForResource struct { -} - -func (*validateOpListTagsForResource) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListTagsForResourceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListTagsForResourceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpListTargetsForPolicy struct { -} - -func (*validateOpListTargetsForPolicy) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpListTargetsForPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*ListTargetsForPolicyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpListTargetsForPolicyInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpMoveAccount struct { -} - -func (*validateOpMoveAccount) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpMoveAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*MoveAccountInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpMoveAccountInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpPutResourcePolicy struct { -} - -func (*validateOpPutResourcePolicy) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpPutResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*PutResourcePolicyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpPutResourcePolicyInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRegisterDelegatedAdministrator struct { -} - -func (*validateOpRegisterDelegatedAdministrator) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRegisterDelegatedAdministrator) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RegisterDelegatedAdministratorInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRegisterDelegatedAdministratorInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpRemoveAccountFromOrganization struct { -} - -func (*validateOpRemoveAccountFromOrganization) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpRemoveAccountFromOrganization) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*RemoveAccountFromOrganizationInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpRemoveAccountFromOrganizationInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpTagResource struct { -} - -func (*validateOpTagResource) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*TagResourceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpTagResourceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpTerminateResponsibilityTransfer struct { -} - -func (*validateOpTerminateResponsibilityTransfer) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpTerminateResponsibilityTransfer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*TerminateResponsibilityTransferInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpTerminateResponsibilityTransferInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUntagResource struct { -} - -func (*validateOpUntagResource) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UntagResourceInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUntagResourceInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateOrganizationalUnit struct { -} - -func (*validateOpUpdateOrganizationalUnit) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateOrganizationalUnit) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateOrganizationalUnitInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateOrganizationalUnitInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdatePolicy struct { -} - -func (*validateOpUpdatePolicy) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdatePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdatePolicyInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdatePolicyInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateResponsibilityTransfer struct { -} - -func (*validateOpUpdateResponsibilityTransfer) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateResponsibilityTransfer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateResponsibilityTransferInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateResponsibilityTransferInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -func addOpAcceptHandshakeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAcceptHandshake{}, middleware.After) -} - -func addOpAttachPolicyValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAttachPolicy{}, middleware.After) -} - -func addOpCancelHandshakeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCancelHandshake{}, middleware.After) -} - -func addOpCloseAccountValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCloseAccount{}, middleware.After) -} - -func addOpCreateAccountValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateAccount{}, middleware.After) -} - -func addOpCreateGovCloudAccountValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateGovCloudAccount{}, middleware.After) -} - -func addOpCreateOrganizationalUnitValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreateOrganizationalUnit{}, middleware.After) -} - -func addOpCreatePolicyValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpCreatePolicy{}, middleware.After) -} - -func addOpDeclineHandshakeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeclineHandshake{}, middleware.After) -} - -func addOpDeleteOrganizationalUnitValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeleteOrganizationalUnit{}, middleware.After) -} - -func addOpDeletePolicyValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeletePolicy{}, middleware.After) -} - -func addOpDeregisterDelegatedAdministratorValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDeregisterDelegatedAdministrator{}, middleware.After) -} - -func addOpDescribeAccountValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeAccount{}, middleware.After) -} - -func addOpDescribeCreateAccountStatusValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeCreateAccountStatus{}, middleware.After) -} - -func addOpDescribeEffectivePolicyValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeEffectivePolicy{}, middleware.After) -} - -func addOpDescribeHandshakeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeHandshake{}, middleware.After) -} - -func addOpDescribeOrganizationalUnitValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeOrganizationalUnit{}, middleware.After) -} - -func addOpDescribePolicyValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribePolicy{}, middleware.After) -} - -func addOpDescribeResponsibilityTransferValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDescribeResponsibilityTransfer{}, middleware.After) -} - -func addOpDetachPolicyValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDetachPolicy{}, middleware.After) -} - -func addOpDisableAWSServiceAccessValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisableAWSServiceAccess{}, middleware.After) -} - -func addOpDisablePolicyTypeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisablePolicyType{}, middleware.After) -} - -func addOpEnableAWSServiceAccessValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpEnableAWSServiceAccess{}, middleware.After) -} - -func addOpEnablePolicyTypeValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpEnablePolicyType{}, middleware.After) -} - -func addOpInviteAccountToOrganizationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpInviteAccountToOrganization{}, middleware.After) -} - -func addOpInviteOrganizationToTransferResponsibilityValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpInviteOrganizationToTransferResponsibility{}, middleware.After) -} - -func addOpListAccountsForParentValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListAccountsForParent{}, middleware.After) -} - -func addOpListAccountsWithInvalidEffectivePolicyValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListAccountsWithInvalidEffectivePolicy{}, middleware.After) -} - -func addOpListChildrenValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListChildren{}, middleware.After) -} - -func addOpListDelegatedServicesForAccountValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListDelegatedServicesForAccount{}, middleware.After) -} - -func addOpListEffectivePolicyValidationErrorsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListEffectivePolicyValidationErrors{}, middleware.After) -} - -func addOpListInboundResponsibilityTransfersValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListInboundResponsibilityTransfers{}, middleware.After) -} - -func addOpListOrganizationalUnitsForParentValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListOrganizationalUnitsForParent{}, middleware.After) -} - -func addOpListOutboundResponsibilityTransfersValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListOutboundResponsibilityTransfers{}, middleware.After) -} - -func addOpListParentsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListParents{}, middleware.After) -} - -func addOpListPoliciesForTargetValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListPoliciesForTarget{}, middleware.After) -} - -func addOpListPoliciesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListPolicies{}, middleware.After) -} - -func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) -} - -func addOpListTargetsForPolicyValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListTargetsForPolicy{}, middleware.After) -} - -func addOpMoveAccountValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpMoveAccount{}, middleware.After) -} - -func addOpPutResourcePolicyValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpPutResourcePolicy{}, middleware.After) -} - -func addOpRegisterDelegatedAdministratorValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRegisterDelegatedAdministrator{}, middleware.After) -} - -func addOpRemoveAccountFromOrganizationValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpRemoveAccountFromOrganization{}, middleware.After) -} - -func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) -} - -func addOpTerminateResponsibilityTransferValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpTerminateResponsibilityTransfer{}, middleware.After) -} - -func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) -} - -func addOpUpdateOrganizationalUnitValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateOrganizationalUnit{}, middleware.After) -} - -func addOpUpdatePolicyValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdatePolicy{}, middleware.After) -} - -func addOpUpdateResponsibilityTransferValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateResponsibilityTransfer{}, middleware.After) -} - -func validateHandshakeParty(v *types.HandshakeParty) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "HandshakeParty"} - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if len(v.Type) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Type")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateTag(v *types.Tag) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "Tag"} - if v.Key == nil { - invalidParams.Add(smithy.NewErrParamRequired("Key")) - } - if v.Value == nil { - invalidParams.Add(smithy.NewErrParamRequired("Value")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateTags(v []types.Tag) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "Tags"} - for i := range v { - if err := validateTag(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAcceptHandshakeInput(v *AcceptHandshakeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AcceptHandshakeInput"} - if v.HandshakeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("HandshakeId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAttachPolicyInput(v *AttachPolicyInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AttachPolicyInput"} - if v.PolicyId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PolicyId")) - } - if v.TargetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TargetId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCancelHandshakeInput(v *CancelHandshakeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CancelHandshakeInput"} - if v.HandshakeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("HandshakeId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCloseAccountInput(v *CloseAccountInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CloseAccountInput"} - if v.AccountId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AccountId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateAccountInput(v *CreateAccountInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateAccountInput"} - if v.Email == nil { - invalidParams.Add(smithy.NewErrParamRequired("Email")) - } - if v.AccountName == nil { - invalidParams.Add(smithy.NewErrParamRequired("AccountName")) - } - if v.Tags != nil { - if err := validateTags(v.Tags); err != nil { - invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateGovCloudAccountInput(v *CreateGovCloudAccountInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateGovCloudAccountInput"} - if v.Email == nil { - invalidParams.Add(smithy.NewErrParamRequired("Email")) - } - if v.AccountName == nil { - invalidParams.Add(smithy.NewErrParamRequired("AccountName")) - } - if v.Tags != nil { - if err := validateTags(v.Tags); err != nil { - invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreateOrganizationalUnitInput(v *CreateOrganizationalUnitInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreateOrganizationalUnitInput"} - if v.ParentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ParentId")) - } - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if v.Tags != nil { - if err := validateTags(v.Tags); err != nil { - invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpCreatePolicyInput(v *CreatePolicyInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "CreatePolicyInput"} - if v.Content == nil { - invalidParams.Add(smithy.NewErrParamRequired("Content")) - } - if v.Description == nil { - invalidParams.Add(smithy.NewErrParamRequired("Description")) - } - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if len(v.Type) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Type")) - } - if v.Tags != nil { - if err := validateTags(v.Tags); err != nil { - invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeclineHandshakeInput(v *DeclineHandshakeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeclineHandshakeInput"} - if v.HandshakeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("HandshakeId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeleteOrganizationalUnitInput(v *DeleteOrganizationalUnitInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeleteOrganizationalUnitInput"} - if v.OrganizationalUnitId == nil { - invalidParams.Add(smithy.NewErrParamRequired("OrganizationalUnitId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeletePolicyInput(v *DeletePolicyInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeletePolicyInput"} - if v.PolicyId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PolicyId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDeregisterDelegatedAdministratorInput(v *DeregisterDelegatedAdministratorInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DeregisterDelegatedAdministratorInput"} - if v.AccountId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AccountId")) - } - if v.ServicePrincipal == nil { - invalidParams.Add(smithy.NewErrParamRequired("ServicePrincipal")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeAccountInput(v *DescribeAccountInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeAccountInput"} - if v.AccountId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AccountId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeCreateAccountStatusInput(v *DescribeCreateAccountStatusInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeCreateAccountStatusInput"} - if v.CreateAccountRequestId == nil { - invalidParams.Add(smithy.NewErrParamRequired("CreateAccountRequestId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeEffectivePolicyInput(v *DescribeEffectivePolicyInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeEffectivePolicyInput"} - if len(v.PolicyType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("PolicyType")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeHandshakeInput(v *DescribeHandshakeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeHandshakeInput"} - if v.HandshakeId == nil { - invalidParams.Add(smithy.NewErrParamRequired("HandshakeId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeOrganizationalUnitInput(v *DescribeOrganizationalUnitInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeOrganizationalUnitInput"} - if v.OrganizationalUnitId == nil { - invalidParams.Add(smithy.NewErrParamRequired("OrganizationalUnitId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribePolicyInput(v *DescribePolicyInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribePolicyInput"} - if v.PolicyId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PolicyId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDescribeResponsibilityTransferInput(v *DescribeResponsibilityTransferInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DescribeResponsibilityTransferInput"} - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDetachPolicyInput(v *DetachPolicyInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DetachPolicyInput"} - if v.PolicyId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PolicyId")) - } - if v.TargetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TargetId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisableAWSServiceAccessInput(v *DisableAWSServiceAccessInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisableAWSServiceAccessInput"} - if v.ServicePrincipal == nil { - invalidParams.Add(smithy.NewErrParamRequired("ServicePrincipal")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisablePolicyTypeInput(v *DisablePolicyTypeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisablePolicyTypeInput"} - if v.RootId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RootId")) - } - if len(v.PolicyType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("PolicyType")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpEnableAWSServiceAccessInput(v *EnableAWSServiceAccessInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "EnableAWSServiceAccessInput"} - if v.ServicePrincipal == nil { - invalidParams.Add(smithy.NewErrParamRequired("ServicePrincipal")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpEnablePolicyTypeInput(v *EnablePolicyTypeInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "EnablePolicyTypeInput"} - if v.RootId == nil { - invalidParams.Add(smithy.NewErrParamRequired("RootId")) - } - if len(v.PolicyType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("PolicyType")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpInviteAccountToOrganizationInput(v *InviteAccountToOrganizationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "InviteAccountToOrganizationInput"} - if v.Target == nil { - invalidParams.Add(smithy.NewErrParamRequired("Target")) - } else if v.Target != nil { - if err := validateHandshakeParty(v.Target); err != nil { - invalidParams.AddNested("Target", err.(smithy.InvalidParamsError)) - } - } - if v.Tags != nil { - if err := validateTags(v.Tags); err != nil { - invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpInviteOrganizationToTransferResponsibilityInput(v *InviteOrganizationToTransferResponsibilityInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "InviteOrganizationToTransferResponsibilityInput"} - if len(v.Type) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Type")) - } - if v.Target == nil { - invalidParams.Add(smithy.NewErrParamRequired("Target")) - } else if v.Target != nil { - if err := validateHandshakeParty(v.Target); err != nil { - invalidParams.AddNested("Target", err.(smithy.InvalidParamsError)) - } - } - if v.StartTimestamp == nil { - invalidParams.Add(smithy.NewErrParamRequired("StartTimestamp")) - } - if v.SourceName == nil { - invalidParams.Add(smithy.NewErrParamRequired("SourceName")) - } - if v.Tags != nil { - if err := validateTags(v.Tags); err != nil { - invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListAccountsForParentInput(v *ListAccountsForParentInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListAccountsForParentInput"} - if v.ParentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ParentId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListAccountsWithInvalidEffectivePolicyInput(v *ListAccountsWithInvalidEffectivePolicyInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListAccountsWithInvalidEffectivePolicyInput"} - if len(v.PolicyType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("PolicyType")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListChildrenInput(v *ListChildrenInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListChildrenInput"} - if v.ParentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ParentId")) - } - if len(v.ChildType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("ChildType")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListDelegatedServicesForAccountInput(v *ListDelegatedServicesForAccountInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListDelegatedServicesForAccountInput"} - if v.AccountId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AccountId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListEffectivePolicyValidationErrorsInput(v *ListEffectivePolicyValidationErrorsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListEffectivePolicyValidationErrorsInput"} - if v.AccountId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AccountId")) - } - if len(v.PolicyType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("PolicyType")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListInboundResponsibilityTransfersInput(v *ListInboundResponsibilityTransfersInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListInboundResponsibilityTransfersInput"} - if len(v.Type) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Type")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListOrganizationalUnitsForParentInput(v *ListOrganizationalUnitsForParentInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListOrganizationalUnitsForParentInput"} - if v.ParentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ParentId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListOutboundResponsibilityTransfersInput(v *ListOutboundResponsibilityTransfersInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListOutboundResponsibilityTransfersInput"} - if len(v.Type) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Type")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListParentsInput(v *ListParentsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListParentsInput"} - if v.ChildId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ChildId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListPoliciesForTargetInput(v *ListPoliciesForTargetInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListPoliciesForTargetInput"} - if v.TargetId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TargetId")) - } - if len(v.Filter) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Filter")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListPoliciesInput(v *ListPoliciesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListPoliciesInput"} - if len(v.Filter) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Filter")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} - if v.ResourceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpListTargetsForPolicyInput(v *ListTargetsForPolicyInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ListTargetsForPolicyInput"} - if v.PolicyId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PolicyId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpMoveAccountInput(v *MoveAccountInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "MoveAccountInput"} - if v.AccountId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AccountId")) - } - if v.SourceParentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("SourceParentId")) - } - if v.DestinationParentId == nil { - invalidParams.Add(smithy.NewErrParamRequired("DestinationParentId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpPutResourcePolicyInput(v *PutResourcePolicyInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "PutResourcePolicyInput"} - if v.Content == nil { - invalidParams.Add(smithy.NewErrParamRequired("Content")) - } - if v.Tags != nil { - if err := validateTags(v.Tags); err != nil { - invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRegisterDelegatedAdministratorInput(v *RegisterDelegatedAdministratorInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RegisterDelegatedAdministratorInput"} - if v.AccountId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AccountId")) - } - if v.ServicePrincipal == nil { - invalidParams.Add(smithy.NewErrParamRequired("ServicePrincipal")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpRemoveAccountFromOrganizationInput(v *RemoveAccountFromOrganizationInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "RemoveAccountFromOrganizationInput"} - if v.AccountId == nil { - invalidParams.Add(smithy.NewErrParamRequired("AccountId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpTagResourceInput(v *TagResourceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} - if v.ResourceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceId")) - } - if v.Tags == nil { - invalidParams.Add(smithy.NewErrParamRequired("Tags")) - } else if v.Tags != nil { - if err := validateTags(v.Tags); err != nil { - invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpTerminateResponsibilityTransferInput(v *TerminateResponsibilityTransferInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "TerminateResponsibilityTransferInput"} - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUntagResourceInput(v *UntagResourceInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} - if v.ResourceId == nil { - invalidParams.Add(smithy.NewErrParamRequired("ResourceId")) - } - if v.TagKeys == nil { - invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateOrganizationalUnitInput(v *UpdateOrganizationalUnitInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateOrganizationalUnitInput"} - if v.OrganizationalUnitId == nil { - invalidParams.Add(smithy.NewErrParamRequired("OrganizationalUnitId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdatePolicyInput(v *UpdatePolicyInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdatePolicyInput"} - if v.PolicyId == nil { - invalidParams.Add(smithy.NewErrParamRequired("PolicyId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateResponsibilityTransferInput(v *UpdateResponsibilityTransferInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateResponsibilityTransferInput"} - if v.Id == nil { - invalidParams.Add(smithy.NewErrParamRequired("Id")) - } - if v.Name == nil { - invalidParams.Add(smithy.NewErrParamRequired("Name")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/aws/arn/arn.go b/vendor/github.com/aws/aws-sdk-go/aws/arn/arn.go deleted file mode 100644 index 1c49674290..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/aws/arn/arn.go +++ /dev/null @@ -1,93 +0,0 @@ -// Package arn provides a parser for interacting with Amazon Resource Names. -package arn - -import ( - "errors" - "strings" -) - -const ( - arnDelimiter = ":" - arnSections = 6 - arnPrefix = "arn:" - - // zero-indexed - sectionPartition = 1 - sectionService = 2 - sectionRegion = 3 - sectionAccountID = 4 - sectionResource = 5 - - // errors - invalidPrefix = "arn: invalid prefix" - invalidSections = "arn: not enough sections" -) - -// ARN captures the individual fields of an Amazon Resource Name. -// See http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html for more information. -type ARN struct { - // The partition that the resource is in. For standard AWS regions, the partition is "aws". If you have resources in - // other partitions, the partition is "aws-partitionname". For example, the partition for resources in the China - // (Beijing) region is "aws-cn". - Partition string - - // The service namespace that identifies the AWS product (for example, Amazon S3, IAM, or Amazon RDS). For a list of - // namespaces, see - // http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces. - Service string - - // The region the resource resides in. Note that the ARNs for some resources do not require a region, so this - // component might be omitted. - Region string - - // The ID of the AWS account that owns the resource, without the hyphens. For example, 123456789012. Note that the - // ARNs for some resources don't require an account number, so this component might be omitted. - AccountID string - - // The content of this part of the ARN varies by service. It often includes an indicator of the type of resource — - // for example, an IAM user or Amazon RDS database - followed by a slash (/) or a colon (:), followed by the - // resource name itself. Some services allows paths for resource names, as described in - // http://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arns-paths. - Resource string -} - -// Parse parses an ARN into its constituent parts. -// -// Some example ARNs: -// arn:aws:elasticbeanstalk:us-east-1:123456789012:environment/My App/MyEnvironment -// arn:aws:iam::123456789012:user/David -// arn:aws:rds:eu-west-1:123456789012:db:mysql-db -// arn:aws:s3:::my_corporate_bucket/exampleobject.png -func Parse(arn string) (ARN, error) { - if !strings.HasPrefix(arn, arnPrefix) { - return ARN{}, errors.New(invalidPrefix) - } - sections := strings.SplitN(arn, arnDelimiter, arnSections) - if len(sections) != arnSections { - return ARN{}, errors.New(invalidSections) - } - return ARN{ - Partition: sections[sectionPartition], - Service: sections[sectionService], - Region: sections[sectionRegion], - AccountID: sections[sectionAccountID], - Resource: sections[sectionResource], - }, nil -} - -// IsARN returns whether the given string is an ARN by looking for -// whether the string starts with "arn:" and contains the correct number -// of sections delimited by colons(:). -func IsARN(arn string) bool { - return strings.HasPrefix(arn, arnPrefix) && strings.Count(arn, ":") >= arnSections-1 -} - -// String returns the canonical representation of the ARN -func (arn ARN) String() string { - return arnPrefix + - arn.Partition + arnDelimiter + - arn.Service + arnDelimiter + - arn.Region + arnDelimiter + - arn.AccountID + arnDelimiter + - arn.Resource -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/accesspoint_arn.go b/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/accesspoint_arn.go deleted file mode 100644 index bf18031a38..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/accesspoint_arn.go +++ /dev/null @@ -1,50 +0,0 @@ -package arn - -import ( - "strings" - - "github.com/aws/aws-sdk-go/aws/arn" -) - -// AccessPointARN provides representation -type AccessPointARN struct { - arn.ARN - AccessPointName string -} - -// GetARN returns the base ARN for the Access Point resource -func (a AccessPointARN) GetARN() arn.ARN { - return a.ARN -} - -// ParseAccessPointResource attempts to parse the ARN's resource as an -// AccessPoint resource. -// -// Supported Access point resource format: -// - Access point format: arn:{partition}:s3:{region}:{accountId}:accesspoint/{accesspointName} -// - example: arn.aws.s3.us-west-2.012345678901:accesspoint/myaccesspoint -// -func ParseAccessPointResource(a arn.ARN, resParts []string) (AccessPointARN, error) { - if len(a.Region) == 0 { - return AccessPointARN{}, InvalidARNError{ARN: a, Reason: "region not set"} - } - if len(a.AccountID) == 0 { - return AccessPointARN{}, InvalidARNError{ARN: a, Reason: "account-id not set"} - } - if len(resParts) == 0 { - return AccessPointARN{}, InvalidARNError{ARN: a, Reason: "resource-id not set"} - } - if len(resParts) > 1 { - return AccessPointARN{}, InvalidARNError{ARN: a, Reason: "sub resource not supported"} - } - - resID := resParts[0] - if len(strings.TrimSpace(resID)) == 0 { - return AccessPointARN{}, InvalidARNError{ARN: a, Reason: "resource-id not set"} - } - - return AccessPointARN{ - ARN: a, - AccessPointName: resID, - }, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/arn.go b/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/arn.go deleted file mode 100644 index 216c4baabf..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/arn.go +++ /dev/null @@ -1,94 +0,0 @@ -package arn - -import ( - "fmt" - "strings" - - "github.com/aws/aws-sdk-go/aws/arn" -) - -var supportedServiceARN = []string{ - "s3", - "s3-outposts", - "s3-object-lambda", -} - -func isSupportedServiceARN(service string) bool { - for _, name := range supportedServiceARN { - if name == service { - return true - } - } - return false -} - -// Resource provides the interfaces abstracting ARNs of specific resource -// types. -type Resource interface { - GetARN() arn.ARN - String() string -} - -// ResourceParser provides the function for parsing an ARN's resource -// component into a typed resource. -type ResourceParser func(arn.ARN) (Resource, error) - -// ParseResource parses an AWS ARN into a typed resource for the S3 API. -func ParseResource(s string, resParser ResourceParser) (resARN Resource, err error) { - a, err := arn.Parse(s) - if err != nil { - return nil, err - } - - if len(a.Partition) == 0 { - return nil, InvalidARNError{ARN: a, Reason: "partition not set"} - } - - if !isSupportedServiceARN(a.Service) { - return nil, InvalidARNError{ARN: a, Reason: "service is not supported"} - } - - if strings.HasPrefix(a.Region, "fips-") || strings.HasSuffix(a.Region, "-fips") { - return nil, InvalidARNError{ARN: a, Reason: "FIPS region not allowed in ARN"} - } - - if len(a.Resource) == 0 { - return nil, InvalidARNError{ARN: a, Reason: "resource not set"} - } - - return resParser(a) -} - -// SplitResource splits the resource components by the ARN resource delimiters. -func SplitResource(v string) []string { - var parts []string - var offset int - - for offset <= len(v) { - idx := strings.IndexAny(v[offset:], "/:") - if idx < 0 { - parts = append(parts, v[offset:]) - break - } - parts = append(parts, v[offset:idx+offset]) - offset += idx + 1 - } - - return parts -} - -// IsARN returns whether the given string is an ARN -func IsARN(s string) bool { - return arn.IsARN(s) -} - -// InvalidARNError provides the error for an invalid ARN error. -type InvalidARNError struct { - ARN arn.ARN - Reason string -} - -// Error returns a string denoting the occurred InvalidARNError -func (e InvalidARNError) Error() string { - return fmt.Sprintf("invalid Amazon %s ARN, %s, %s", e.ARN.Service, e.Reason, e.ARN.String()) -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/outpost_arn.go b/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/outpost_arn.go deleted file mode 100644 index 1e10f8de00..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/outpost_arn.go +++ /dev/null @@ -1,126 +0,0 @@ -package arn - -import ( - "strings" - - "github.com/aws/aws-sdk-go/aws/arn" -) - -// OutpostARN interface that should be satisfied by outpost ARNs -type OutpostARN interface { - Resource - GetOutpostID() string -} - -// ParseOutpostARNResource will parse a provided ARNs resource using the appropriate ARN format -// and return a specific OutpostARN type -// -// Currently supported outpost ARN formats: -// * Outpost AccessPoint ARN format: -// - ARN format: arn:{partition}:s3-outposts:{region}:{accountId}:outpost/{outpostId}/accesspoint/{accesspointName} -// - example: arn:aws:s3-outposts:us-west-2:012345678901:outpost/op-1234567890123456/accesspoint/myaccesspoint -// -// * Outpost Bucket ARN format: -// - ARN format: arn:{partition}:s3-outposts:{region}:{accountId}:outpost/{outpostId}/bucket/{bucketName} -// - example: arn:aws:s3-outposts:us-west-2:012345678901:outpost/op-1234567890123456/bucket/mybucket -// -// Other outpost ARN formats may be supported and added in the future. -// -func ParseOutpostARNResource(a arn.ARN, resParts []string) (OutpostARN, error) { - if len(a.Region) == 0 { - return nil, InvalidARNError{ARN: a, Reason: "region not set"} - } - - if len(a.AccountID) == 0 { - return nil, InvalidARNError{ARN: a, Reason: "account-id not set"} - } - - // verify if outpost id is present and valid - if len(resParts) == 0 || len(strings.TrimSpace(resParts[0])) == 0 { - return nil, InvalidARNError{ARN: a, Reason: "outpost resource-id not set"} - } - - // verify possible resource type exists - if len(resParts) < 3 { - return nil, InvalidARNError{ - ARN: a, Reason: "incomplete outpost resource type. Expected bucket or access-point resource to be present", - } - } - - // Since we know this is a OutpostARN fetch outpostID - outpostID := strings.TrimSpace(resParts[0]) - - switch resParts[1] { - case "accesspoint": - accesspointARN, err := ParseAccessPointResource(a, resParts[2:]) - if err != nil { - return OutpostAccessPointARN{}, err - } - return OutpostAccessPointARN{ - AccessPointARN: accesspointARN, - OutpostID: outpostID, - }, nil - - case "bucket": - bucketName, err := parseBucketResource(a, resParts[2:]) - if err != nil { - return nil, err - } - return OutpostBucketARN{ - ARN: a, - BucketName: bucketName, - OutpostID: outpostID, - }, nil - - default: - return nil, InvalidARNError{ARN: a, Reason: "unknown resource set for outpost ARN"} - } -} - -// OutpostAccessPointARN represents outpost access point ARN. -type OutpostAccessPointARN struct { - AccessPointARN - OutpostID string -} - -// GetOutpostID returns the outpost id of outpost access point arn -func (o OutpostAccessPointARN) GetOutpostID() string { - return o.OutpostID -} - -// OutpostBucketARN represents the outpost bucket ARN. -type OutpostBucketARN struct { - arn.ARN - BucketName string - OutpostID string -} - -// GetOutpostID returns the outpost id of outpost bucket arn -func (o OutpostBucketARN) GetOutpostID() string { - return o.OutpostID -} - -// GetARN retrives the base ARN from outpost bucket ARN resource -func (o OutpostBucketARN) GetARN() arn.ARN { - return o.ARN -} - -// parseBucketResource attempts to parse the ARN's bucket resource and retrieve the -// bucket resource id. -// -// parseBucketResource only parses the bucket resource id. -// -func parseBucketResource(a arn.ARN, resParts []string) (bucketName string, err error) { - if len(resParts) == 0 { - return bucketName, InvalidARNError{ARN: a, Reason: "bucket resource-id not set"} - } - if len(resParts) > 1 { - return bucketName, InvalidARNError{ARN: a, Reason: "sub resource not supported"} - } - - bucketName = strings.TrimSpace(resParts[0]) - if len(bucketName) == 0 { - return bucketName, InvalidARNError{ARN: a, Reason: "bucket resource-id not set"} - } - return bucketName, err -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/s3_object_lambda_arn.go b/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/s3_object_lambda_arn.go deleted file mode 100644 index 513154cc0e..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/s3shared/arn/s3_object_lambda_arn.go +++ /dev/null @@ -1,15 +0,0 @@ -package arn - -// S3ObjectLambdaARN represents an ARN for the s3-object-lambda service -type S3ObjectLambdaARN interface { - Resource - - isS3ObjectLambdasARN() -} - -// S3ObjectLambdaAccessPointARN is an S3ObjectLambdaARN for the Access Point resource type -type S3ObjectLambdaAccessPointARN struct { - AccessPointARN -} - -func (s S3ObjectLambdaAccessPointARN) isS3ObjectLambdasARN() {} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/s3shared/endpoint_errors.go b/vendor/github.com/aws/aws-sdk-go/internal/s3shared/endpoint_errors.go deleted file mode 100644 index 4290ff6760..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/s3shared/endpoint_errors.go +++ /dev/null @@ -1,202 +0,0 @@ -package s3shared - -import ( - "fmt" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/internal/s3shared/arn" -) - -const ( - invalidARNErrorErrCode = "InvalidARNError" - configurationErrorErrCode = "ConfigurationError" -) - -// InvalidARNError denotes the error for Invalid ARN -type InvalidARNError struct { - message string - resource arn.Resource - origErr error -} - -// Error returns the InvalidARNError -func (e InvalidARNError) Error() string { - var extra string - if e.resource != nil { - extra = "ARN: " + e.resource.String() - } - return awserr.SprintError(e.Code(), e.Message(), extra, e.origErr) -} - -// Code returns the invalid ARN error code -func (e InvalidARNError) Code() string { - return invalidARNErrorErrCode -} - -// Message returns the message for Invalid ARN error -func (e InvalidARNError) Message() string { - return e.message -} - -// OrigErr is the original error wrapped by Invalid ARN Error -func (e InvalidARNError) OrigErr() error { - return e.origErr -} - -// NewInvalidARNError denotes invalid arn error -func NewInvalidARNError(resource arn.Resource, err error) InvalidARNError { - return InvalidARNError{ - message: "invalid ARN", - origErr: err, - resource: resource, - } -} - -// NewInvalidARNWithCustomEndpointError ARN not supported for custom clients endpoints -func NewInvalidARNWithCustomEndpointError(resource arn.Resource, err error) InvalidARNError { - return InvalidARNError{ - message: "resource ARN not supported with custom client endpoints", - origErr: err, - resource: resource, - } -} - -// NewInvalidARNWithUnsupportedPartitionError ARN not supported for the target partition -func NewInvalidARNWithUnsupportedPartitionError(resource arn.Resource, err error) InvalidARNError { - return InvalidARNError{ - message: "resource ARN not supported for the target ARN partition", - origErr: err, - resource: resource, - } -} - -// NewInvalidARNWithFIPSError ARN not supported for FIPS region -// -// Deprecated: FIPS will not appear in the ARN region component. -func NewInvalidARNWithFIPSError(resource arn.Resource, err error) InvalidARNError { - return InvalidARNError{ - message: "resource ARN not supported for FIPS region", - resource: resource, - origErr: err, - } -} - -// ConfigurationError is used to denote a client configuration error -type ConfigurationError struct { - message string - resource arn.Resource - clientPartitionID string - clientRegion string - origErr error -} - -// Error returns the Configuration error string -func (e ConfigurationError) Error() string { - extra := fmt.Sprintf("ARN: %s, client partition: %s, client region: %s", - e.resource, e.clientPartitionID, e.clientRegion) - - return awserr.SprintError(e.Code(), e.Message(), extra, e.origErr) -} - -// Code returns configuration error's error-code -func (e ConfigurationError) Code() string { - return configurationErrorErrCode -} - -// Message returns the configuration error message -func (e ConfigurationError) Message() string { - return e.message -} - -// OrigErr is the original error wrapped by Configuration Error -func (e ConfigurationError) OrigErr() error { - return e.origErr -} - -// NewClientPartitionMismatchError stub -func NewClientPartitionMismatchError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError { - return ConfigurationError{ - message: "client partition does not match provided ARN partition", - origErr: err, - resource: resource, - clientPartitionID: clientPartitionID, - clientRegion: clientRegion, - } -} - -// NewClientRegionMismatchError denotes cross region access error -func NewClientRegionMismatchError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError { - return ConfigurationError{ - message: "client region does not match provided ARN region", - origErr: err, - resource: resource, - clientPartitionID: clientPartitionID, - clientRegion: clientRegion, - } -} - -// NewFailedToResolveEndpointError denotes endpoint resolving error -func NewFailedToResolveEndpointError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError { - return ConfigurationError{ - message: "endpoint resolver failed to find an endpoint for the provided ARN region", - origErr: err, - resource: resource, - clientPartitionID: clientPartitionID, - clientRegion: clientRegion, - } -} - -// NewClientConfiguredForFIPSError denotes client config error for unsupported cross region FIPS access -func NewClientConfiguredForFIPSError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError { - return ConfigurationError{ - message: "client configured for fips but cross-region resource ARN provided", - origErr: err, - resource: resource, - clientPartitionID: clientPartitionID, - clientRegion: clientRegion, - } -} - -// NewFIPSConfigurationError denotes a configuration error when a client or request is configured for FIPS -func NewFIPSConfigurationError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError { - return ConfigurationError{ - message: "use of ARN is not supported when client or request is configured for FIPS", - origErr: err, - resource: resource, - clientPartitionID: clientPartitionID, - clientRegion: clientRegion, - } -} - -// NewClientConfiguredForAccelerateError denotes client config error for unsupported S3 accelerate -func NewClientConfiguredForAccelerateError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError { - return ConfigurationError{ - message: "client configured for S3 Accelerate but is not supported with resource ARN", - origErr: err, - resource: resource, - clientPartitionID: clientPartitionID, - clientRegion: clientRegion, - } -} - -// NewClientConfiguredForCrossRegionFIPSError denotes client config error for unsupported cross region FIPS request -func NewClientConfiguredForCrossRegionFIPSError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError { - return ConfigurationError{ - message: "client configured for FIPS with cross-region enabled but is supported with cross-region resource ARN", - origErr: err, - resource: resource, - clientPartitionID: clientPartitionID, - clientRegion: clientRegion, - } -} - -// NewClientConfiguredForDualStackError denotes client config error for unsupported S3 Dual-stack -func NewClientConfiguredForDualStackError(resource arn.Resource, clientPartitionID, clientRegion string, err error) ConfigurationError { - return ConfigurationError{ - message: "client configured for S3 Dual-stack but is not supported with resource ARN", - origErr: err, - resource: resource, - clientPartitionID: clientPartitionID, - clientRegion: clientRegion, - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/s3shared/resource_request.go b/vendor/github.com/aws/aws-sdk-go/internal/s3shared/resource_request.go deleted file mode 100644 index ef43d6c589..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/s3shared/resource_request.go +++ /dev/null @@ -1,45 +0,0 @@ -package s3shared - -import ( - "github.com/aws/aws-sdk-go/aws" - awsarn "github.com/aws/aws-sdk-go/aws/arn" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/internal/s3shared/arn" -) - -// ResourceRequest represents the request and arn resource -type ResourceRequest struct { - Resource arn.Resource - Request *request.Request -} - -// ARN returns the resource ARN -func (r ResourceRequest) ARN() awsarn.ARN { - return r.Resource.GetARN() -} - -// AllowCrossRegion returns a bool value to denote if S3UseARNRegion flag is set -func (r ResourceRequest) AllowCrossRegion() bool { - return aws.BoolValue(r.Request.Config.S3UseARNRegion) -} - -// IsCrossPartition returns true if client is configured for another partition, than -// the partition that resource ARN region resolves to. -func (r ResourceRequest) IsCrossPartition() bool { - return r.Request.ClientInfo.PartitionID != r.Resource.GetARN().Partition -} - -// IsCrossRegion returns true if ARN region is different than client configured region -func (r ResourceRequest) IsCrossRegion() bool { - return IsCrossRegion(r.Request, r.Resource.GetARN().Region) -} - -// HasCustomEndpoint returns true if custom client endpoint is provided -func (r ResourceRequest) HasCustomEndpoint() bool { - return len(aws.StringValue(r.Request.Config.Endpoint)) > 0 -} - -// IsCrossRegion returns true if request signing region is not same as configured region -func IsCrossRegion(req *request.Request, otherRegion string) bool { - return req.ClientInfo.SigningRegion != otherRegion -} diff --git a/vendor/github.com/aws/aws-sdk-go/internal/s3shared/s3err/error.go b/vendor/github.com/aws/aws-sdk-go/internal/s3shared/s3err/error.go deleted file mode 100644 index 0b9b0dfce0..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/internal/s3shared/s3err/error.go +++ /dev/null @@ -1,57 +0,0 @@ -package s3err - -import ( - "fmt" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" -) - -// RequestFailure provides additional S3 specific metadata for the request -// failure. -type RequestFailure struct { - awserr.RequestFailure - - hostID string -} - -// NewRequestFailure returns a request failure error decordated with S3 -// specific metadata. -func NewRequestFailure(err awserr.RequestFailure, hostID string) *RequestFailure { - return &RequestFailure{RequestFailure: err, hostID: hostID} -} - -func (r RequestFailure) Error() string { - extra := fmt.Sprintf("status code: %d, request id: %s, host id: %s", - r.StatusCode(), r.RequestID(), r.hostID) - return awserr.SprintError(r.Code(), r.Message(), extra, r.OrigErr()) -} -func (r RequestFailure) String() string { - return r.Error() -} - -// HostID returns the HostID request response value. -func (r RequestFailure) HostID() string { - return r.hostID -} - -// RequestFailureWrapperHandler returns a handler to rap an -// awserr.RequestFailure with the S3 request ID 2 from the response. -func RequestFailureWrapperHandler() request.NamedHandler { - return request.NamedHandler{ - Name: "awssdk.s3.errorHandler", - Fn: func(req *request.Request) { - reqErr, ok := req.Error.(awserr.RequestFailure) - if !ok || reqErr == nil { - return - } - - hostID := req.HTTPResponse.Header.Get("X-Amz-Id-2") - if req.Error == nil { - return - } - - req.Error = NewRequestFailure(reqErr, hostID) - }, - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/checksum/content_md5.go b/vendor/github.com/aws/aws-sdk-go/private/checksum/content_md5.go deleted file mode 100644 index e045f38d83..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/checksum/content_md5.go +++ /dev/null @@ -1,53 +0,0 @@ -package checksum - -import ( - "crypto/md5" - "encoding/base64" - "fmt" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" -) - -const contentMD5Header = "Content-Md5" - -// AddBodyContentMD5Handler computes and sets the HTTP Content-MD5 header for requests that -// require it. -func AddBodyContentMD5Handler(r *request.Request) { - // if Content-MD5 header is already present, return - if v := r.HTTPRequest.Header.Get(contentMD5Header); len(v) != 0 { - return - } - - // if S3DisableContentMD5Validation flag is set, return - if aws.BoolValue(r.Config.S3DisableContentMD5Validation) { - return - } - - // if request is presigned, return - if r.IsPresigned() { - return - } - - // if body is not seekable, return - if !aws.IsReaderSeekable(r.Body) { - if r.Config.Logger != nil { - r.Config.Logger.Log(fmt.Sprintf( - "Unable to compute Content-MD5 for unseekable body, S3.%s", - r.Operation.Name)) - } - return - } - - h := md5.New() - - if _, err := aws.CopySeekableBody(h, r.Body); err != nil { - r.Error = awserr.New("ContentMD5", "failed to compute body MD5", err) - return - } - - // encode the md5 checksum in base64 and set the request header. - v := base64.StdEncoding.EncodeToString(h.Sum(nil)) - r.HTTPRequest.Header.Set(contentMD5Header, v) -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/debug.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/debug.go deleted file mode 100644 index 151054971a..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/debug.go +++ /dev/null @@ -1,144 +0,0 @@ -package eventstream - -import ( - "bytes" - "encoding/base64" - "encoding/json" - "fmt" - "strconv" -) - -type decodedMessage struct { - rawMessage - Headers decodedHeaders `json:"headers"` -} -type jsonMessage struct { - Length json.Number `json:"total_length"` - HeadersLen json.Number `json:"headers_length"` - PreludeCRC json.Number `json:"prelude_crc"` - Headers decodedHeaders `json:"headers"` - Payload []byte `json:"payload"` - CRC json.Number `json:"message_crc"` -} - -func (d *decodedMessage) UnmarshalJSON(b []byte) (err error) { - var jsonMsg jsonMessage - if err = json.Unmarshal(b, &jsonMsg); err != nil { - return err - } - - d.Length, err = numAsUint32(jsonMsg.Length) - if err != nil { - return err - } - d.HeadersLen, err = numAsUint32(jsonMsg.HeadersLen) - if err != nil { - return err - } - d.PreludeCRC, err = numAsUint32(jsonMsg.PreludeCRC) - if err != nil { - return err - } - d.Headers = jsonMsg.Headers - d.Payload = jsonMsg.Payload - d.CRC, err = numAsUint32(jsonMsg.CRC) - if err != nil { - return err - } - - return nil -} - -func (d *decodedMessage) MarshalJSON() ([]byte, error) { - jsonMsg := jsonMessage{ - Length: json.Number(strconv.Itoa(int(d.Length))), - HeadersLen: json.Number(strconv.Itoa(int(d.HeadersLen))), - PreludeCRC: json.Number(strconv.Itoa(int(d.PreludeCRC))), - Headers: d.Headers, - Payload: d.Payload, - CRC: json.Number(strconv.Itoa(int(d.CRC))), - } - - return json.Marshal(jsonMsg) -} - -func numAsUint32(n json.Number) (uint32, error) { - v, err := n.Int64() - if err != nil { - return 0, fmt.Errorf("failed to get int64 json number, %v", err) - } - - return uint32(v), nil -} - -func (d decodedMessage) Message() Message { - return Message{ - Headers: Headers(d.Headers), - Payload: d.Payload, - } -} - -type decodedHeaders Headers - -func (hs *decodedHeaders) UnmarshalJSON(b []byte) error { - var jsonHeaders []struct { - Name string `json:"name"` - Type valueType `json:"type"` - Value interface{} `json:"value"` - } - - decoder := json.NewDecoder(bytes.NewReader(b)) - decoder.UseNumber() - if err := decoder.Decode(&jsonHeaders); err != nil { - return err - } - - var headers Headers - for _, h := range jsonHeaders { - value, err := valueFromType(h.Type, h.Value) - if err != nil { - return err - } - headers.Set(h.Name, value) - } - *hs = decodedHeaders(headers) - - return nil -} - -func valueFromType(typ valueType, val interface{}) (Value, error) { - switch typ { - case trueValueType: - return BoolValue(true), nil - case falseValueType: - return BoolValue(false), nil - case int8ValueType: - v, err := val.(json.Number).Int64() - return Int8Value(int8(v)), err - case int16ValueType: - v, err := val.(json.Number).Int64() - return Int16Value(int16(v)), err - case int32ValueType: - v, err := val.(json.Number).Int64() - return Int32Value(int32(v)), err - case int64ValueType: - v, err := val.(json.Number).Int64() - return Int64Value(v), err - case bytesValueType: - v, err := base64.StdEncoding.DecodeString(val.(string)) - return BytesValue(v), err - case stringValueType: - v, err := base64.StdEncoding.DecodeString(val.(string)) - return StringValue(string(v)), err - case timestampValueType: - v, err := val.(json.Number).Int64() - return TimestampValue(timeFromEpochMilli(v)), err - case uuidValueType: - v, err := base64.StdEncoding.DecodeString(val.(string)) - var tv UUIDValue - copy(tv[:], v) - return tv, err - default: - panic(fmt.Sprintf("unknown type, %s, %T", typ.String(), val)) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/decode.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/decode.go deleted file mode 100644 index 4743393918..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/decode.go +++ /dev/null @@ -1,216 +0,0 @@ -package eventstream - -import ( - "bytes" - "encoding/binary" - "encoding/hex" - "encoding/json" - "fmt" - "hash" - "hash/crc32" - "io" - - "github.com/aws/aws-sdk-go/aws" -) - -// Decoder provides decoding of an Event Stream messages. -type Decoder struct { - r io.Reader - logger aws.Logger -} - -// NewDecoder initializes and returns a Decoder for decoding event -// stream messages from the reader provided. -func NewDecoder(r io.Reader, opts ...func(*Decoder)) *Decoder { - d := &Decoder{ - r: r, - } - - for _, opt := range opts { - opt(d) - } - - return d -} - -// DecodeWithLogger adds a logger to be used by the decoder when decoding -// stream events. -func DecodeWithLogger(logger aws.Logger) func(*Decoder) { - return func(d *Decoder) { - d.logger = logger - } -} - -// Decode attempts to decode a single message from the event stream reader. -// Will return the event stream message, or error if Decode fails to read -// the message from the stream. -func (d *Decoder) Decode(payloadBuf []byte) (m Message, err error) { - reader := d.r - if d.logger != nil { - debugMsgBuf := bytes.NewBuffer(nil) - reader = io.TeeReader(reader, debugMsgBuf) - defer func() { - logMessageDecode(d.logger, debugMsgBuf, m, err) - }() - } - - m, err = Decode(reader, payloadBuf) - - return m, err -} - -// Decode attempts to decode a single message from the event stream reader. -// Will return the event stream message, or error if Decode fails to read -// the message from the reader. -func Decode(reader io.Reader, payloadBuf []byte) (m Message, err error) { - crc := crc32.New(crc32IEEETable) - hashReader := io.TeeReader(reader, crc) - - prelude, err := decodePrelude(hashReader, crc) - if err != nil { - return Message{}, err - } - - if prelude.HeadersLen > 0 { - lr := io.LimitReader(hashReader, int64(prelude.HeadersLen)) - m.Headers, err = decodeHeaders(lr) - if err != nil { - return Message{}, err - } - } - - if payloadLen := prelude.PayloadLen(); payloadLen > 0 { - buf, err := decodePayload(payloadBuf, io.LimitReader(hashReader, int64(payloadLen))) - if err != nil { - return Message{}, err - } - m.Payload = buf - } - - msgCRC := crc.Sum32() - if err := validateCRC(reader, msgCRC); err != nil { - return Message{}, err - } - - return m, nil -} - -func logMessageDecode(logger aws.Logger, msgBuf *bytes.Buffer, msg Message, decodeErr error) { - w := bytes.NewBuffer(nil) - defer func() { logger.Log(w.String()) }() - - fmt.Fprintf(w, "Raw message:\n%s\n", - hex.Dump(msgBuf.Bytes())) - - if decodeErr != nil { - fmt.Fprintf(w, "Decode error: %v\n", decodeErr) - return - } - - rawMsg, err := msg.rawMessage() - if err != nil { - fmt.Fprintf(w, "failed to create raw message, %v\n", err) - return - } - - decodedMsg := decodedMessage{ - rawMessage: rawMsg, - Headers: decodedHeaders(msg.Headers), - } - - fmt.Fprintf(w, "Decoded message:\n") - encoder := json.NewEncoder(w) - if err := encoder.Encode(decodedMsg); err != nil { - fmt.Fprintf(w, "failed to generate decoded message, %v\n", err) - } -} - -func decodePrelude(r io.Reader, crc hash.Hash32) (messagePrelude, error) { - var p messagePrelude - - var err error - p.Length, err = decodeUint32(r) - if err != nil { - return messagePrelude{}, err - } - - p.HeadersLen, err = decodeUint32(r) - if err != nil { - return messagePrelude{}, err - } - - if err := p.ValidateLens(); err != nil { - return messagePrelude{}, err - } - - preludeCRC := crc.Sum32() - if err := validateCRC(r, preludeCRC); err != nil { - return messagePrelude{}, err - } - - p.PreludeCRC = preludeCRC - - return p, nil -} - -func decodePayload(buf []byte, r io.Reader) ([]byte, error) { - w := bytes.NewBuffer(buf[0:0]) - - _, err := io.Copy(w, r) - return w.Bytes(), err -} - -func decodeUint8(r io.Reader) (uint8, error) { - type byteReader interface { - ReadByte() (byte, error) - } - - if br, ok := r.(byteReader); ok { - v, err := br.ReadByte() - return uint8(v), err - } - - var b [1]byte - _, err := io.ReadFull(r, b[:]) - return uint8(b[0]), err -} -func decodeUint16(r io.Reader) (uint16, error) { - var b [2]byte - bs := b[:] - _, err := io.ReadFull(r, bs) - if err != nil { - return 0, err - } - return binary.BigEndian.Uint16(bs), nil -} -func decodeUint32(r io.Reader) (uint32, error) { - var b [4]byte - bs := b[:] - _, err := io.ReadFull(r, bs) - if err != nil { - return 0, err - } - return binary.BigEndian.Uint32(bs), nil -} -func decodeUint64(r io.Reader) (uint64, error) { - var b [8]byte - bs := b[:] - _, err := io.ReadFull(r, bs) - if err != nil { - return 0, err - } - return binary.BigEndian.Uint64(bs), nil -} - -func validateCRC(r io.Reader, expect uint32) error { - msgCRC, err := decodeUint32(r) - if err != nil { - return err - } - - if msgCRC != expect { - return ChecksumError{} - } - - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/encode.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/encode.go deleted file mode 100644 index ffade3bc0c..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/encode.go +++ /dev/null @@ -1,162 +0,0 @@ -package eventstream - -import ( - "bytes" - "encoding/binary" - "encoding/hex" - "encoding/json" - "fmt" - "hash" - "hash/crc32" - "io" - - "github.com/aws/aws-sdk-go/aws" -) - -// Encoder provides EventStream message encoding. -type Encoder struct { - w io.Writer - logger aws.Logger - - headersBuf *bytes.Buffer -} - -// NewEncoder initializes and returns an Encoder to encode Event Stream -// messages to an io.Writer. -func NewEncoder(w io.Writer, opts ...func(*Encoder)) *Encoder { - e := &Encoder{ - w: w, - headersBuf: bytes.NewBuffer(nil), - } - - for _, opt := range opts { - opt(e) - } - - return e -} - -// EncodeWithLogger adds a logger to be used by the encode when decoding -// stream events. -func EncodeWithLogger(logger aws.Logger) func(*Encoder) { - return func(d *Encoder) { - d.logger = logger - } -} - -// Encode encodes a single EventStream message to the io.Writer the Encoder -// was created with. An error is returned if writing the message fails. -func (e *Encoder) Encode(msg Message) (err error) { - e.headersBuf.Reset() - - writer := e.w - if e.logger != nil { - encodeMsgBuf := bytes.NewBuffer(nil) - writer = io.MultiWriter(writer, encodeMsgBuf) - defer func() { - logMessageEncode(e.logger, encodeMsgBuf, msg, err) - }() - } - - if err = EncodeHeaders(e.headersBuf, msg.Headers); err != nil { - return err - } - - crc := crc32.New(crc32IEEETable) - hashWriter := io.MultiWriter(writer, crc) - - headersLen := uint32(e.headersBuf.Len()) - payloadLen := uint32(len(msg.Payload)) - - if err = encodePrelude(hashWriter, crc, headersLen, payloadLen); err != nil { - return err - } - - if headersLen > 0 { - if _, err = io.Copy(hashWriter, e.headersBuf); err != nil { - return err - } - } - - if payloadLen > 0 { - if _, err = hashWriter.Write(msg.Payload); err != nil { - return err - } - } - - msgCRC := crc.Sum32() - return binary.Write(writer, binary.BigEndian, msgCRC) -} - -func logMessageEncode(logger aws.Logger, msgBuf *bytes.Buffer, msg Message, encodeErr error) { - w := bytes.NewBuffer(nil) - defer func() { logger.Log(w.String()) }() - - fmt.Fprintf(w, "Message to encode:\n") - encoder := json.NewEncoder(w) - if err := encoder.Encode(msg); err != nil { - fmt.Fprintf(w, "Failed to get encoded message, %v\n", err) - } - - if encodeErr != nil { - fmt.Fprintf(w, "Encode error: %v\n", encodeErr) - return - } - - fmt.Fprintf(w, "Raw message:\n%s\n", hex.Dump(msgBuf.Bytes())) -} - -func encodePrelude(w io.Writer, crc hash.Hash32, headersLen, payloadLen uint32) error { - p := messagePrelude{ - Length: minMsgLen + headersLen + payloadLen, - HeadersLen: headersLen, - } - if err := p.ValidateLens(); err != nil { - return err - } - - err := binaryWriteFields(w, binary.BigEndian, - p.Length, - p.HeadersLen, - ) - if err != nil { - return err - } - - p.PreludeCRC = crc.Sum32() - err = binary.Write(w, binary.BigEndian, p.PreludeCRC) - if err != nil { - return err - } - - return nil -} - -// EncodeHeaders writes the header values to the writer encoded in the event -// stream format. Returns an error if a header fails to encode. -func EncodeHeaders(w io.Writer, headers Headers) error { - for _, h := range headers { - hn := headerName{ - Len: uint8(len(h.Name)), - } - copy(hn.Name[:hn.Len], h.Name) - if err := hn.encode(w); err != nil { - return err - } - - if err := h.Value.encode(w); err != nil { - return err - } - } - - return nil -} - -func binaryWriteFields(w io.Writer, order binary.ByteOrder, vs ...interface{}) error { - for _, v := range vs { - if err := binary.Write(w, order, v); err != nil { - return err - } - } - return nil -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/error.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/error.go deleted file mode 100644 index 5481ef3079..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/error.go +++ /dev/null @@ -1,23 +0,0 @@ -package eventstream - -import "fmt" - -// LengthError provides the error for items being larger than a maximum length. -type LengthError struct { - Part string - Want int - Have int - Value interface{} -} - -func (e LengthError) Error() string { - return fmt.Sprintf("%s length invalid, %d/%d, %v", - e.Part, e.Want, e.Have, e.Value) -} - -// ChecksumError provides the error for message checksum invalidation errors. -type ChecksumError struct{} - -func (e ChecksumError) Error() string { - return "message checksum mismatch" -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/error.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/error.go deleted file mode 100644 index 0a63340e41..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/error.go +++ /dev/null @@ -1,81 +0,0 @@ -package eventstreamapi - -import ( - "fmt" - "sync" -) - -// InputWriterCloseErrorCode is used to denote an error occurred -// while closing the event stream input writer. -const InputWriterCloseErrorCode = "EventStreamInputWriterCloseError" - -type messageError struct { - code string - msg string -} - -func (e messageError) Code() string { - return e.code -} - -func (e messageError) Message() string { - return e.msg -} - -func (e messageError) Error() string { - return fmt.Sprintf("%s: %s", e.code, e.msg) -} - -func (e messageError) OrigErr() error { - return nil -} - -// OnceError wraps the behavior of recording an error -// once and signal on a channel when this has occurred. -// Signaling is done by closing of the channel. -// -// Type is safe for concurrent usage. -type OnceError struct { - mu sync.RWMutex - err error - ch chan struct{} -} - -// NewOnceError return a new OnceError -func NewOnceError() *OnceError { - return &OnceError{ - ch: make(chan struct{}, 1), - } -} - -// Err acquires a read-lock and returns an -// error if one has been set. -func (e *OnceError) Err() error { - e.mu.RLock() - err := e.err - e.mu.RUnlock() - - return err -} - -// SetError acquires a write-lock and will set -// the underlying error value if one has not been set. -func (e *OnceError) SetError(err error) { - if err == nil { - return - } - - e.mu.Lock() - if e.err == nil { - e.err = err - close(e.ch) - } - e.mu.Unlock() -} - -// ErrorSet returns a channel that will be used to signal -// that an error has been set. This channel will be closed -// when the error value has been set for OnceError. -func (e *OnceError) ErrorSet() <-chan struct{} { - return e.ch -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/reader.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/reader.go deleted file mode 100644 index 0e4aa42f3e..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/reader.go +++ /dev/null @@ -1,173 +0,0 @@ -package eventstreamapi - -import ( - "fmt" - - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/eventstream" -) - -// Unmarshaler provides the interface for unmarshaling a EventStream -// message into a SDK type. -type Unmarshaler interface { - UnmarshalEvent(protocol.PayloadUnmarshaler, eventstream.Message) error -} - -// EventReader provides reading from the EventStream of an reader. -type EventReader struct { - decoder *eventstream.Decoder - - unmarshalerForEventType func(string) (Unmarshaler, error) - payloadUnmarshaler protocol.PayloadUnmarshaler - - payloadBuf []byte -} - -// NewEventReader returns a EventReader built from the reader and unmarshaler -// provided. Use ReadStream method to start reading from the EventStream. -func NewEventReader( - decoder *eventstream.Decoder, - payloadUnmarshaler protocol.PayloadUnmarshaler, - unmarshalerForEventType func(string) (Unmarshaler, error), -) *EventReader { - return &EventReader{ - decoder: decoder, - payloadUnmarshaler: payloadUnmarshaler, - unmarshalerForEventType: unmarshalerForEventType, - payloadBuf: make([]byte, 10*1024), - } -} - -// ReadEvent attempts to read a message from the EventStream and return the -// unmarshaled event value that the message is for. -// -// For EventStream API errors check if the returned error satisfies the -// awserr.Error interface to get the error's Code and Message components. -// -// EventUnmarshalers called with EventStream messages must take copies of the -// message's Payload. The payload will is reused between events read. -func (r *EventReader) ReadEvent() (event interface{}, err error) { - msg, err := r.decoder.Decode(r.payloadBuf) - if err != nil { - return nil, err - } - defer func() { - // Reclaim payload buffer for next message read. - r.payloadBuf = msg.Payload[0:0] - }() - - typ, err := GetHeaderString(msg, MessageTypeHeader) - if err != nil { - return nil, err - } - - switch typ { - case EventMessageType: - return r.unmarshalEventMessage(msg) - case ExceptionMessageType: - return nil, r.unmarshalEventException(msg) - case ErrorMessageType: - return nil, r.unmarshalErrorMessage(msg) - default: - return nil, &UnknownMessageTypeError{ - Type: typ, Message: msg.Clone(), - } - } -} - -// UnknownMessageTypeError provides an error when a message is received from -// the stream, but the reader is unable to determine what kind of message it is. -type UnknownMessageTypeError struct { - Type string - Message eventstream.Message -} - -func (e *UnknownMessageTypeError) Error() string { - return "unknown eventstream message type, " + e.Type -} - -func (r *EventReader) unmarshalEventMessage( - msg eventstream.Message, -) (event interface{}, err error) { - eventType, err := GetHeaderString(msg, EventTypeHeader) - if err != nil { - return nil, err - } - - ev, err := r.unmarshalerForEventType(eventType) - if err != nil { - return nil, err - } - - err = ev.UnmarshalEvent(r.payloadUnmarshaler, msg) - if err != nil { - return nil, err - } - - return ev, nil -} - -func (r *EventReader) unmarshalEventException( - msg eventstream.Message, -) (err error) { - eventType, err := GetHeaderString(msg, ExceptionTypeHeader) - if err != nil { - return err - } - - ev, err := r.unmarshalerForEventType(eventType) - if err != nil { - return err - } - - err = ev.UnmarshalEvent(r.payloadUnmarshaler, msg) - if err != nil { - return err - } - - var ok bool - err, ok = ev.(error) - if !ok { - err = messageError{ - code: "SerializationError", - msg: fmt.Sprintf( - "event stream exception %s mapped to non-error %T, %v", - eventType, ev, ev, - ), - } - } - - return err -} - -func (r *EventReader) unmarshalErrorMessage(msg eventstream.Message) (err error) { - var msgErr messageError - - msgErr.code, err = GetHeaderString(msg, ErrorCodeHeader) - if err != nil { - return err - } - - msgErr.msg, err = GetHeaderString(msg, ErrorMessageHeader) - if err != nil { - return err - } - - return msgErr -} - -// GetHeaderString returns the value of the header as a string. If the header -// is not set or the value is not a string an error will be returned. -func GetHeaderString(msg eventstream.Message, headerName string) (string, error) { - headerVal := msg.Headers.Get(headerName) - if headerVal == nil { - return "", fmt.Errorf("error header %s not present", headerName) - } - - v, ok := headerVal.Get().(string) - if !ok { - return "", fmt.Errorf("error header value is not a string, %T", headerVal) - } - - return v, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/shared.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/shared.go deleted file mode 100644 index e46b8acc20..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/shared.go +++ /dev/null @@ -1,23 +0,0 @@ -package eventstreamapi - -// EventStream headers with specific meaning to async API functionality. -const ( - ChunkSignatureHeader = `:chunk-signature` // chunk signature for message - DateHeader = `:date` // Date header for signature - - // Message header and values - MessageTypeHeader = `:message-type` // Identifies type of message. - EventMessageType = `event` - ErrorMessageType = `error` - ExceptionMessageType = `exception` - - // Message Events - EventTypeHeader = `:event-type` // Identifies message event type e.g. "Stats". - - // Message Error - ErrorCodeHeader = `:error-code` - ErrorMessageHeader = `:error-message` - - // Message Exception - ExceptionTypeHeader = `:exception-type` -) diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/signer.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/signer.go deleted file mode 100644 index 3a7ba5cd57..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/signer.go +++ /dev/null @@ -1,123 +0,0 @@ -package eventstreamapi - -import ( - "bytes" - "strings" - "time" - - "github.com/aws/aws-sdk-go/private/protocol/eventstream" -) - -var timeNow = time.Now - -// StreamSigner defines an interface for the implementation of signing of event stream payloads -type StreamSigner interface { - GetSignature(headers, payload []byte, date time.Time) ([]byte, error) -} - -// SignEncoder envelopes event stream messages -// into an event stream message payload with included -// signature headers using the provided signer and encoder. -type SignEncoder struct { - signer StreamSigner - encoder Encoder - bufEncoder *BufferEncoder - - closeErr error - closed bool -} - -// NewSignEncoder returns a new SignEncoder using the provided stream signer and -// event stream encoder. -func NewSignEncoder(signer StreamSigner, encoder Encoder) *SignEncoder { - // TODO: Need to pass down logging - - return &SignEncoder{ - signer: signer, - encoder: encoder, - bufEncoder: NewBufferEncoder(), - } -} - -// Close encodes a final event stream signing envelope with an empty event stream -// payload. This final end-frame is used to mark the conclusion of the stream. -func (s *SignEncoder) Close() error { - if s.closed { - return s.closeErr - } - - if err := s.encode([]byte{}); err != nil { - if strings.Contains(err.Error(), "on closed pipe") { - return nil - } - - s.closeErr = err - s.closed = true - return s.closeErr - } - - return nil -} - -// Encode takes the provided message and add envelopes the message -// with the required signature. -func (s *SignEncoder) Encode(msg eventstream.Message) error { - payload, err := s.bufEncoder.Encode(msg) - if err != nil { - return err - } - - return s.encode(payload) -} - -func (s SignEncoder) encode(payload []byte) error { - date := timeNow() - - var msg eventstream.Message - msg.Headers.Set(DateHeader, eventstream.TimestampValue(date)) - msg.Payload = payload - - var headers bytes.Buffer - if err := eventstream.EncodeHeaders(&headers, msg.Headers); err != nil { - return err - } - - sig, err := s.signer.GetSignature(headers.Bytes(), msg.Payload, date) - if err != nil { - return err - } - - msg.Headers.Set(ChunkSignatureHeader, eventstream.BytesValue(sig)) - - return s.encoder.Encode(msg) -} - -// BufferEncoder is a utility that provides a buffered -// event stream encoder -type BufferEncoder struct { - encoder Encoder - buffer *bytes.Buffer -} - -// NewBufferEncoder returns a new BufferEncoder initialized -// with a 1024 byte buffer. -func NewBufferEncoder() *BufferEncoder { - buf := bytes.NewBuffer(make([]byte, 1024)) - return &BufferEncoder{ - encoder: eventstream.NewEncoder(buf), - buffer: buf, - } -} - -// Encode returns the encoded message as a byte slice. -// The returned byte slice will be modified on the next encode call -// and should not be held onto. -func (e *BufferEncoder) Encode(msg eventstream.Message) ([]byte, error) { - e.buffer.Reset() - - if err := e.encoder.Encode(msg); err != nil { - return nil, err - } - - return e.buffer.Bytes(), nil -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/stream_writer.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/stream_writer.go deleted file mode 100644 index 433bb1630a..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/stream_writer.go +++ /dev/null @@ -1,129 +0,0 @@ -package eventstreamapi - -import ( - "fmt" - "io" - "sync" - - "github.com/aws/aws-sdk-go/aws" -) - -// StreamWriter provides concurrent safe writing to an event stream. -type StreamWriter struct { - eventWriter *EventWriter - stream chan eventWriteAsyncReport - - done chan struct{} - closeOnce sync.Once - err *OnceError - - streamCloser io.Closer -} - -// NewStreamWriter returns a StreamWriter for the event writer, and stream -// closer provided. -func NewStreamWriter(eventWriter *EventWriter, streamCloser io.Closer) *StreamWriter { - w := &StreamWriter{ - eventWriter: eventWriter, - streamCloser: streamCloser, - stream: make(chan eventWriteAsyncReport), - done: make(chan struct{}), - err: NewOnceError(), - } - go w.writeStream() - - return w -} - -// Close terminates the writers ability to write new events to the stream. Any -// future call to Send will fail with an error. -func (w *StreamWriter) Close() error { - w.closeOnce.Do(w.safeClose) - return w.Err() -} - -func (w *StreamWriter) safeClose() { - close(w.done) -} - -// ErrorSet returns a channel which will be closed -// if an error occurs. -func (w *StreamWriter) ErrorSet() <-chan struct{} { - return w.err.ErrorSet() -} - -// Err returns any error that occurred while attempting to write an event to the -// stream. -func (w *StreamWriter) Err() error { - return w.err.Err() -} - -// Send writes a single event to the stream returning an error if the write -// failed. -// -// Send may be called concurrently. Events will be written to the stream -// safely. -func (w *StreamWriter) Send(ctx aws.Context, event Marshaler) error { - if err := w.Err(); err != nil { - return err - } - - resultCh := make(chan error) - wrapped := eventWriteAsyncReport{ - Event: event, - Result: resultCh, - } - - select { - case w.stream <- wrapped: - case <-ctx.Done(): - return ctx.Err() - case <-w.done: - return fmt.Errorf("stream closed, unable to send event") - } - - select { - case err := <-resultCh: - return err - case <-ctx.Done(): - return ctx.Err() - case <-w.done: - return fmt.Errorf("stream closed, unable to send event") - } -} - -func (w *StreamWriter) writeStream() { - defer w.Close() - - for { - select { - case wrapper := <-w.stream: - err := w.eventWriter.WriteEvent(wrapper.Event) - wrapper.ReportResult(w.done, err) - if err != nil { - w.err.SetError(err) - return - } - - case <-w.done: - if err := w.streamCloser.Close(); err != nil { - w.err.SetError(err) - } - return - } - } -} - -type eventWriteAsyncReport struct { - Event Marshaler - Result chan<- error -} - -func (e eventWriteAsyncReport) ReportResult(cancel <-chan struct{}, err error) bool { - select { - case e.Result <- err: - return true - case <-cancel: - return false - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/transport.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/transport.go deleted file mode 100644 index 4bf2b27b2b..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/transport.go +++ /dev/null @@ -1,10 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -package eventstreamapi - -import "github.com/aws/aws-sdk-go/aws/request" - -// ApplyHTTPTransportFixes is a no-op for Go 1.18 and above. -func ApplyHTTPTransportFixes(r *request.Request) { -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/transport_go1.17.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/transport_go1.17.go deleted file mode 100644 index 2ee2c36fd3..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/transport_go1.17.go +++ /dev/null @@ -1,19 +0,0 @@ -//go:build !go1.18 -// +build !go1.18 - -package eventstreamapi - -import "github.com/aws/aws-sdk-go/aws/request" - -// ApplyHTTPTransportFixes applies fixes to the HTTP request for proper event -// stream functionality. Go 1.15 through 1.17 HTTP client could hang forever -// when an HTTP/2 connection failed with an non-200 status code and err. Using -// Expect 100-Continue, allows the HTTP client to gracefully handle the non-200 -// status code, and close the connection. -// -// This is a no-op for Go 1.18 and above. -func ApplyHTTPTransportFixes(r *request.Request) { - r.Handlers.Sign.PushBack(func(r *request.Request) { - r.HTTPRequest.Header.Set("Expect", "100-Continue") - }) -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/writer.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/writer.go deleted file mode 100644 index 7d7a793528..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi/writer.go +++ /dev/null @@ -1,63 +0,0 @@ -package eventstreamapi - -import ( - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/eventstream" -) - -// Marshaler provides a marshaling interface for event types to event stream -// messages. -type Marshaler interface { - MarshalEvent(protocol.PayloadMarshaler) (eventstream.Message, error) -} - -// Encoder is an stream encoder that will encode an event stream message for -// the transport. -type Encoder interface { - Encode(eventstream.Message) error -} - -// EventWriter provides a wrapper around the underlying event stream encoder -// for an io.WriteCloser. -type EventWriter struct { - encoder Encoder - payloadMarshaler protocol.PayloadMarshaler - eventTypeFor func(Marshaler) (string, error) -} - -// NewEventWriter returns a new event stream writer, that will write to the -// writer provided. Use the WriteEvent method to write an event to the stream. -func NewEventWriter(encoder Encoder, pm protocol.PayloadMarshaler, eventTypeFor func(Marshaler) (string, error), -) *EventWriter { - return &EventWriter{ - encoder: encoder, - payloadMarshaler: pm, - eventTypeFor: eventTypeFor, - } -} - -// WriteEvent writes an event to the stream. Returns an error if the event -// fails to marshal into a message, or writing to the underlying writer fails. -func (w *EventWriter) WriteEvent(event Marshaler) error { - msg, err := w.marshal(event) - if err != nil { - return err - } - - return w.encoder.Encode(msg) -} - -func (w *EventWriter) marshal(event Marshaler) (eventstream.Message, error) { - eventType, err := w.eventTypeFor(event) - if err != nil { - return eventstream.Message{}, err - } - - msg, err := event.MarshalEvent(w.payloadMarshaler) - if err != nil { - return eventstream.Message{}, err - } - - msg.Headers.Set(EventTypeHeader, eventstream.StringValue(eventType)) - return msg, nil -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header.go deleted file mode 100644 index f6f8c5674e..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header.go +++ /dev/null @@ -1,175 +0,0 @@ -package eventstream - -import ( - "encoding/binary" - "fmt" - "io" -) - -// Headers are a collection of EventStream header values. -type Headers []Header - -// Header is a single EventStream Key Value header pair. -type Header struct { - Name string - Value Value -} - -// Set associates the name with a value. If the header name already exists in -// the Headers the value will be replaced with the new one. -func (hs *Headers) Set(name string, value Value) { - var i int - for ; i < len(*hs); i++ { - if (*hs)[i].Name == name { - (*hs)[i].Value = value - return - } - } - - *hs = append(*hs, Header{ - Name: name, Value: value, - }) -} - -// Get returns the Value associated with the header. Nil is returned if the -// value does not exist. -func (hs Headers) Get(name string) Value { - for i := 0; i < len(hs); i++ { - if h := hs[i]; h.Name == name { - return h.Value - } - } - return nil -} - -// Del deletes the value in the Headers if it exists. -func (hs *Headers) Del(name string) { - for i := 0; i < len(*hs); i++ { - if (*hs)[i].Name == name { - copy((*hs)[i:], (*hs)[i+1:]) - (*hs) = (*hs)[:len(*hs)-1] - } - } -} - -// Clone returns a deep copy of the headers -func (hs Headers) Clone() Headers { - o := make(Headers, 0, len(hs)) - for _, h := range hs { - o.Set(h.Name, h.Value) - } - return o -} - -func decodeHeaders(r io.Reader) (Headers, error) { - hs := Headers{} - - for { - name, err := decodeHeaderName(r) - if err != nil { - if err == io.EOF { - // EOF while getting header name means no more headers - break - } - return nil, err - } - - value, err := decodeHeaderValue(r) - if err != nil { - return nil, err - } - - hs.Set(name, value) - } - - return hs, nil -} - -func decodeHeaderName(r io.Reader) (string, error) { - var n headerName - - var err error - n.Len, err = decodeUint8(r) - if err != nil { - return "", err - } - - name := n.Name[:n.Len] - if _, err := io.ReadFull(r, name); err != nil { - return "", err - } - - return string(name), nil -} - -func decodeHeaderValue(r io.Reader) (Value, error) { - var raw rawValue - - typ, err := decodeUint8(r) - if err != nil { - return nil, err - } - raw.Type = valueType(typ) - - var v Value - - switch raw.Type { - case trueValueType: - v = BoolValue(true) - case falseValueType: - v = BoolValue(false) - case int8ValueType: - var tv Int8Value - err = tv.decode(r) - v = tv - case int16ValueType: - var tv Int16Value - err = tv.decode(r) - v = tv - case int32ValueType: - var tv Int32Value - err = tv.decode(r) - v = tv - case int64ValueType: - var tv Int64Value - err = tv.decode(r) - v = tv - case bytesValueType: - var tv BytesValue - err = tv.decode(r) - v = tv - case stringValueType: - var tv StringValue - err = tv.decode(r) - v = tv - case timestampValueType: - var tv TimestampValue - err = tv.decode(r) - v = tv - case uuidValueType: - var tv UUIDValue - err = tv.decode(r) - v = tv - default: - panic(fmt.Sprintf("unknown value type %d", raw.Type)) - } - - // Error could be EOF, let caller deal with it - return v, err -} - -const maxHeaderNameLen = 255 - -type headerName struct { - Len uint8 - Name [maxHeaderNameLen]byte -} - -func (v headerName) encode(w io.Writer) error { - if err := binary.Write(w, binary.BigEndian, v.Len); err != nil { - return err - } - - _, err := w.Write(v.Name[:v.Len]) - return err -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header_value.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header_value.go deleted file mode 100644 index 9f509d8f6d..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/header_value.go +++ /dev/null @@ -1,506 +0,0 @@ -package eventstream - -import ( - "encoding/base64" - "encoding/binary" - "fmt" - "io" - "strconv" - "time" -) - -const maxHeaderValueLen = 1<<15 - 1 // 2^15-1 or 32KB - 1 - -// valueType is the EventStream header value type. -type valueType uint8 - -// Header value types -const ( - trueValueType valueType = iota - falseValueType - int8ValueType // Byte - int16ValueType // Short - int32ValueType // Integer - int64ValueType // Long - bytesValueType - stringValueType - timestampValueType - uuidValueType -) - -func (t valueType) String() string { - switch t { - case trueValueType: - return "bool" - case falseValueType: - return "bool" - case int8ValueType: - return "int8" - case int16ValueType: - return "int16" - case int32ValueType: - return "int32" - case int64ValueType: - return "int64" - case bytesValueType: - return "byte_array" - case stringValueType: - return "string" - case timestampValueType: - return "timestamp" - case uuidValueType: - return "uuid" - default: - return fmt.Sprintf("unknown value type %d", uint8(t)) - } -} - -type rawValue struct { - Type valueType - Len uint16 // Only set for variable length slices - Value []byte // byte representation of value, BigEndian encoding. -} - -func (r rawValue) encodeScalar(w io.Writer, v interface{}) error { - return binaryWriteFields(w, binary.BigEndian, - r.Type, - v, - ) -} - -func (r rawValue) encodeFixedSlice(w io.Writer, v []byte) error { - binary.Write(w, binary.BigEndian, r.Type) - - _, err := w.Write(v) - return err -} - -func (r rawValue) encodeBytes(w io.Writer, v []byte) error { - if len(v) > maxHeaderValueLen { - return LengthError{ - Part: "header value", - Want: maxHeaderValueLen, Have: len(v), - Value: v, - } - } - r.Len = uint16(len(v)) - - err := binaryWriteFields(w, binary.BigEndian, - r.Type, - r.Len, - ) - if err != nil { - return err - } - - _, err = w.Write(v) - return err -} - -func (r rawValue) encodeString(w io.Writer, v string) error { - if len(v) > maxHeaderValueLen { - return LengthError{ - Part: "header value", - Want: maxHeaderValueLen, Have: len(v), - Value: v, - } - } - r.Len = uint16(len(v)) - - type stringWriter interface { - WriteString(string) (int, error) - } - - err := binaryWriteFields(w, binary.BigEndian, - r.Type, - r.Len, - ) - if err != nil { - return err - } - - if sw, ok := w.(stringWriter); ok { - _, err = sw.WriteString(v) - } else { - _, err = w.Write([]byte(v)) - } - - return err -} - -func decodeFixedBytesValue(r io.Reader, buf []byte) error { - _, err := io.ReadFull(r, buf) - return err -} - -func decodeBytesValue(r io.Reader) ([]byte, error) { - var raw rawValue - var err error - raw.Len, err = decodeUint16(r) - if err != nil { - return nil, err - } - - buf := make([]byte, raw.Len) - _, err = io.ReadFull(r, buf) - if err != nil { - return nil, err - } - - return buf, nil -} - -func decodeStringValue(r io.Reader) (string, error) { - v, err := decodeBytesValue(r) - return string(v), err -} - -// Value represents the abstract header value. -type Value interface { - Get() interface{} - String() string - valueType() valueType - encode(io.Writer) error -} - -// An BoolValue provides eventstream encoding, and representation -// of a Go bool value. -type BoolValue bool - -// Get returns the underlying type -func (v BoolValue) Get() interface{} { - return bool(v) -} - -// valueType returns the EventStream header value type value. -func (v BoolValue) valueType() valueType { - if v { - return trueValueType - } - return falseValueType -} - -func (v BoolValue) String() string { - return strconv.FormatBool(bool(v)) -} - -// encode encodes the BoolValue into an eventstream binary value -// representation. -func (v BoolValue) encode(w io.Writer) error { - return binary.Write(w, binary.BigEndian, v.valueType()) -} - -// An Int8Value provides eventstream encoding, and representation of a Go -// int8 value. -type Int8Value int8 - -// Get returns the underlying value. -func (v Int8Value) Get() interface{} { - return int8(v) -} - -// valueType returns the EventStream header value type value. -func (Int8Value) valueType() valueType { - return int8ValueType -} - -func (v Int8Value) String() string { - return fmt.Sprintf("0x%02x", int8(v)) -} - -// encode encodes the Int8Value into an eventstream binary value -// representation. -func (v Int8Value) encode(w io.Writer) error { - raw := rawValue{ - Type: v.valueType(), - } - - return raw.encodeScalar(w, v) -} - -func (v *Int8Value) decode(r io.Reader) error { - n, err := decodeUint8(r) - if err != nil { - return err - } - - *v = Int8Value(n) - return nil -} - -// An Int16Value provides eventstream encoding, and representation of a Go -// int16 value. -type Int16Value int16 - -// Get returns the underlying value. -func (v Int16Value) Get() interface{} { - return int16(v) -} - -// valueType returns the EventStream header value type value. -func (Int16Value) valueType() valueType { - return int16ValueType -} - -func (v Int16Value) String() string { - return fmt.Sprintf("0x%04x", int16(v)) -} - -// encode encodes the Int16Value into an eventstream binary value -// representation. -func (v Int16Value) encode(w io.Writer) error { - raw := rawValue{ - Type: v.valueType(), - } - return raw.encodeScalar(w, v) -} - -func (v *Int16Value) decode(r io.Reader) error { - n, err := decodeUint16(r) - if err != nil { - return err - } - - *v = Int16Value(n) - return nil -} - -// An Int32Value provides eventstream encoding, and representation of a Go -// int32 value. -type Int32Value int32 - -// Get returns the underlying value. -func (v Int32Value) Get() interface{} { - return int32(v) -} - -// valueType returns the EventStream header value type value. -func (Int32Value) valueType() valueType { - return int32ValueType -} - -func (v Int32Value) String() string { - return fmt.Sprintf("0x%08x", int32(v)) -} - -// encode encodes the Int32Value into an eventstream binary value -// representation. -func (v Int32Value) encode(w io.Writer) error { - raw := rawValue{ - Type: v.valueType(), - } - return raw.encodeScalar(w, v) -} - -func (v *Int32Value) decode(r io.Reader) error { - n, err := decodeUint32(r) - if err != nil { - return err - } - - *v = Int32Value(n) - return nil -} - -// An Int64Value provides eventstream encoding, and representation of a Go -// int64 value. -type Int64Value int64 - -// Get returns the underlying value. -func (v Int64Value) Get() interface{} { - return int64(v) -} - -// valueType returns the EventStream header value type value. -func (Int64Value) valueType() valueType { - return int64ValueType -} - -func (v Int64Value) String() string { - return fmt.Sprintf("0x%016x", int64(v)) -} - -// encode encodes the Int64Value into an eventstream binary value -// representation. -func (v Int64Value) encode(w io.Writer) error { - raw := rawValue{ - Type: v.valueType(), - } - return raw.encodeScalar(w, v) -} - -func (v *Int64Value) decode(r io.Reader) error { - n, err := decodeUint64(r) - if err != nil { - return err - } - - *v = Int64Value(n) - return nil -} - -// An BytesValue provides eventstream encoding, and representation of a Go -// byte slice. -type BytesValue []byte - -// Get returns the underlying value. -func (v BytesValue) Get() interface{} { - return []byte(v) -} - -// valueType returns the EventStream header value type value. -func (BytesValue) valueType() valueType { - return bytesValueType -} - -func (v BytesValue) String() string { - return base64.StdEncoding.EncodeToString([]byte(v)) -} - -// encode encodes the BytesValue into an eventstream binary value -// representation. -func (v BytesValue) encode(w io.Writer) error { - raw := rawValue{ - Type: v.valueType(), - } - - return raw.encodeBytes(w, []byte(v)) -} - -func (v *BytesValue) decode(r io.Reader) error { - buf, err := decodeBytesValue(r) - if err != nil { - return err - } - - *v = BytesValue(buf) - return nil -} - -// An StringValue provides eventstream encoding, and representation of a Go -// string. -type StringValue string - -// Get returns the underlying value. -func (v StringValue) Get() interface{} { - return string(v) -} - -// valueType returns the EventStream header value type value. -func (StringValue) valueType() valueType { - return stringValueType -} - -func (v StringValue) String() string { - return string(v) -} - -// encode encodes the StringValue into an eventstream binary value -// representation. -func (v StringValue) encode(w io.Writer) error { - raw := rawValue{ - Type: v.valueType(), - } - - return raw.encodeString(w, string(v)) -} - -func (v *StringValue) decode(r io.Reader) error { - s, err := decodeStringValue(r) - if err != nil { - return err - } - - *v = StringValue(s) - return nil -} - -// An TimestampValue provides eventstream encoding, and representation of a Go -// timestamp. -type TimestampValue time.Time - -// Get returns the underlying value. -func (v TimestampValue) Get() interface{} { - return time.Time(v) -} - -// valueType returns the EventStream header value type value. -func (TimestampValue) valueType() valueType { - return timestampValueType -} - -func (v TimestampValue) epochMilli() int64 { - nano := time.Time(v).UnixNano() - msec := nano / int64(time.Millisecond) - return msec -} - -func (v TimestampValue) String() string { - msec := v.epochMilli() - return strconv.FormatInt(msec, 10) -} - -// encode encodes the TimestampValue into an eventstream binary value -// representation. -func (v TimestampValue) encode(w io.Writer) error { - raw := rawValue{ - Type: v.valueType(), - } - - msec := v.epochMilli() - return raw.encodeScalar(w, msec) -} - -func (v *TimestampValue) decode(r io.Reader) error { - n, err := decodeUint64(r) - if err != nil { - return err - } - - *v = TimestampValue(timeFromEpochMilli(int64(n))) - return nil -} - -// MarshalJSON implements the json.Marshaler interface -func (v TimestampValue) MarshalJSON() ([]byte, error) { - return []byte(v.String()), nil -} - -func timeFromEpochMilli(t int64) time.Time { - secs := t / 1e3 - msec := t % 1e3 - return time.Unix(secs, msec*int64(time.Millisecond)).UTC() -} - -// An UUIDValue provides eventstream encoding, and representation of a UUID -// value. -type UUIDValue [16]byte - -// Get returns the underlying value. -func (v UUIDValue) Get() interface{} { - return v[:] -} - -// valueType returns the EventStream header value type value. -func (UUIDValue) valueType() valueType { - return uuidValueType -} - -func (v UUIDValue) String() string { - return fmt.Sprintf(`%X-%X-%X-%X-%X`, v[0:4], v[4:6], v[6:8], v[8:10], v[10:]) -} - -// encode encodes the UUIDValue into an eventstream binary value -// representation. -func (v UUIDValue) encode(w io.Writer) error { - raw := rawValue{ - Type: v.valueType(), - } - - return raw.encodeFixedSlice(w, v[:]) -} - -func (v *UUIDValue) decode(r io.Reader) error { - tv := (*v)[:] - return decodeFixedBytesValue(r, tv) -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go deleted file mode 100644 index f7427da039..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/eventstream/message.go +++ /dev/null @@ -1,117 +0,0 @@ -package eventstream - -import ( - "bytes" - "encoding/binary" - "hash/crc32" -) - -const preludeLen = 8 -const preludeCRCLen = 4 -const msgCRCLen = 4 -const minMsgLen = preludeLen + preludeCRCLen + msgCRCLen -const maxPayloadLen = 1024 * 1024 * 16 // 16MB -const maxHeadersLen = 1024 * 128 // 128KB -const maxMsgLen = minMsgLen + maxHeadersLen + maxPayloadLen - -var crc32IEEETable = crc32.MakeTable(crc32.IEEE) - -// A Message provides the eventstream message representation. -type Message struct { - Headers Headers - Payload []byte -} - -func (m *Message) rawMessage() (rawMessage, error) { - var raw rawMessage - - if len(m.Headers) > 0 { - var headers bytes.Buffer - if err := EncodeHeaders(&headers, m.Headers); err != nil { - return rawMessage{}, err - } - raw.Headers = headers.Bytes() - raw.HeadersLen = uint32(len(raw.Headers)) - } - - raw.Length = raw.HeadersLen + uint32(len(m.Payload)) + minMsgLen - - hash := crc32.New(crc32IEEETable) - binaryWriteFields(hash, binary.BigEndian, raw.Length, raw.HeadersLen) - raw.PreludeCRC = hash.Sum32() - - binaryWriteFields(hash, binary.BigEndian, raw.PreludeCRC) - - if raw.HeadersLen > 0 { - hash.Write(raw.Headers) - } - - // Read payload bytes and update hash for it as well. - if len(m.Payload) > 0 { - raw.Payload = m.Payload - hash.Write(raw.Payload) - } - - raw.CRC = hash.Sum32() - - return raw, nil -} - -// Clone returns a deep copy of the message. -func (m Message) Clone() Message { - var payload []byte - if m.Payload != nil { - payload = make([]byte, len(m.Payload)) - copy(payload, m.Payload) - } - - return Message{ - Headers: m.Headers.Clone(), - Payload: payload, - } -} - -type messagePrelude struct { - Length uint32 - HeadersLen uint32 - PreludeCRC uint32 -} - -func (p messagePrelude) PayloadLen() uint32 { - return p.Length - p.HeadersLen - minMsgLen -} - -func (p messagePrelude) ValidateLens() error { - if p.Length == 0 || p.Length > maxMsgLen { - return LengthError{ - Part: "message prelude", - Want: maxMsgLen, - Have: int(p.Length), - } - } - if p.HeadersLen > maxHeadersLen { - return LengthError{ - Part: "message headers", - Want: maxHeadersLen, - Have: int(p.HeadersLen), - } - } - if payloadLen := p.PayloadLen(); payloadLen > maxPayloadLen { - return LengthError{ - Part: "message payload", - Want: maxPayloadLen, - Have: int(payloadLen), - } - } - - return nil -} - -type rawMessage struct { - messagePrelude - - Headers []byte - Payload []byte - - CRC uint32 -} diff --git a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go b/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go deleted file mode 100644 index b1ae364871..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/private/protocol/restxml/restxml.go +++ /dev/null @@ -1,79 +0,0 @@ -// Package restxml provides RESTful XML serialization of AWS -// requests and responses. -package restxml - -//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/input/rest-xml.json build_test.go -//go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/output/rest-xml.json unmarshal_test.go - -import ( - "bytes" - "encoding/xml" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol/query" - "github.com/aws/aws-sdk-go/private/protocol/rest" - "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" -) - -// BuildHandler is a named request handler for building restxml protocol requests -var BuildHandler = request.NamedHandler{Name: "awssdk.restxml.Build", Fn: Build} - -// UnmarshalHandler is a named request handler for unmarshaling restxml protocol requests -var UnmarshalHandler = request.NamedHandler{Name: "awssdk.restxml.Unmarshal", Fn: Unmarshal} - -// UnmarshalMetaHandler is a named request handler for unmarshaling restxml protocol request metadata -var UnmarshalMetaHandler = request.NamedHandler{Name: "awssdk.restxml.UnmarshalMeta", Fn: UnmarshalMeta} - -// UnmarshalErrorHandler is a named request handler for unmarshaling restxml protocol request errors -var UnmarshalErrorHandler = request.NamedHandler{Name: "awssdk.restxml.UnmarshalError", Fn: UnmarshalError} - -// Build builds a request payload for the REST XML protocol. -func Build(r *request.Request) { - rest.Build(r) - - if t := rest.PayloadType(r.Params); t == "structure" || t == "" { - var buf bytes.Buffer - err := xmlutil.BuildXML(r.Params, xml.NewEncoder(&buf)) - if err != nil { - r.Error = awserr.NewRequestFailure( - awserr.New(request.ErrCodeSerialization, - "failed to encode rest XML request", err), - 0, - r.RequestID, - ) - return - } - r.SetBufferBody(buf.Bytes()) - } -} - -// Unmarshal unmarshals a payload response for the REST XML protocol. -func Unmarshal(r *request.Request) { - if t := rest.PayloadType(r.Data); t == "structure" || t == "" { - defer r.HTTPResponse.Body.Close() - decoder := xml.NewDecoder(r.HTTPResponse.Body) - err := xmlutil.UnmarshalXML(r.Data, decoder, "") - if err != nil { - r.Error = awserr.NewRequestFailure( - awserr.New(request.ErrCodeSerialization, - "failed to decode REST XML response", err), - r.HTTPResponse.StatusCode, - r.RequestID, - ) - return - } - } else { - rest.Unmarshal(r) - } -} - -// UnmarshalMeta unmarshals response headers for the REST XML protocol. -func UnmarshalMeta(r *request.Request) { - rest.UnmarshalMeta(r) -} - -// UnmarshalError unmarshals a response error for the REST XML protocol. -func UnmarshalError(r *request.Request) { - query.UnmarshalError(r) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/api.go b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/api.go deleted file mode 100644 index 58fd8eb139..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/api.go +++ /dev/null @@ -1,19741 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package cloudtrail - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -const opAddTags = "AddTags" - -// AddTagsRequest generates a "aws/request.Request" representing the -// client's request for the AddTags operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AddTags for more information on using the AddTags -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the AddTagsRequest method. -// req, resp := client.AddTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/AddTags -func (c *CloudTrail) AddTagsRequest(input *AddTagsInput) (req *request.Request, output *AddTagsOutput) { - op := &request.Operation{ - Name: opAddTags, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AddTagsInput{} - } - - output = &AddTagsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// AddTags API operation for AWS CloudTrail. -// -// Adds one or more tags to a trail, event data store, or channel, up to a limit -// of 50. Overwrites an existing tag's value when a new value is specified for -// an existing tag key. Tag key names must be unique; you cannot have two keys -// with the same name but different values. If you specify a key without a value, -// the tag will be created with the specified key and a value of null. You can -// tag a trail or event data store that applies to all Amazon Web Services Regions -// only from the Region in which the trail or event data store was created (also -// known as its home region). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation AddTags for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// This exception is thrown when the specified resource is not found. -// -// - ARNInvalidException -// This exception is thrown when an operation is called with a trail ARN that -// is not valid. The following is the format of a trail ARN. -// -// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail -// -// This exception is also thrown when you call AddTags or RemoveTags on a trail, -// event data store, or channel with a resource ARN that is not valid. -// -// The following is the format of an event data store ARN: arn:aws:cloudtrail:us-east-2:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE -// -// The following is the format of a channel ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 -// -// - ResourceTypeNotSupportedException -// This exception is thrown when the specified resource type is not supported -// by CloudTrail. -// -// - TagsLimitExceededException -// The number of tags per trail, event data store, or channel has exceeded the -// permitted amount. Currently, the limit is 50. -// -// - InvalidTrailNameException -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// - Start with a letter or number, and end with a letter or number -// -// - Be between 3 and 128 characters -// -// - Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are not valid. -// -// - Not be in IP address format (for example, 192.168.5.4) -// -// - InvalidTagParameterException -// This exception is thrown when the specified tag key or values are not valid. -// It can also occur if there are duplicate tags or too many tags on the resource. -// -// - InactiveEventDataStoreException -// The event data store is inactive. -// -// - EventDataStoreNotFoundException -// The specified event data store was not found. -// -// - ChannelNotFoundException -// This exception is thrown when CloudTrail cannot find the specified channel. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - NotOrganizationMasterAccountException -// This exception is thrown when the Amazon Web Services account making the -// request to create or update an organization trail or event data store is -// not the management account for an organization in Organizations. For more -// information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// - ConflictException -// This exception is thrown when the specified resource is not ready for an -// operation. This can occur when you try to run an operation on a resource -// before CloudTrail has time to fully load the resource, or because another -// operation is modifying the resource. If this exception occurs, wait a few -// minutes, and then try the operation again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/AddTags -func (c *CloudTrail) AddTags(input *AddTagsInput) (*AddTagsOutput, error) { - req, out := c.AddTagsRequest(input) - return out, req.Send() -} - -// AddTagsWithContext is the same as AddTags with the addition of -// the ability to pass a context and additional request options. -// -// See AddTags for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) AddTagsWithContext(ctx aws.Context, input *AddTagsInput, opts ...request.Option) (*AddTagsOutput, error) { - req, out := c.AddTagsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelQuery = "CancelQuery" - -// CancelQueryRequest generates a "aws/request.Request" representing the -// client's request for the CancelQuery operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CancelQuery for more information on using the CancelQuery -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the CancelQueryRequest method. -// req, resp := client.CancelQueryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CancelQuery -func (c *CloudTrail) CancelQueryRequest(input *CancelQueryInput) (req *request.Request, output *CancelQueryOutput) { - op := &request.Operation{ - Name: opCancelQuery, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelQueryInput{} - } - - output = &CancelQueryOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelQuery API operation for AWS CloudTrail. -// -// Cancels a query if the query is not in a terminated state, such as CANCELLED, -// FAILED, TIMED_OUT, or FINISHED. You must specify an ARN value for EventDataStore. -// The ID of the query that you want to cancel is also required. When you run -// CancelQuery, the query status might show as CANCELLED even if the operation -// is not yet finished. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation CancelQuery for usage and error information. -// -// Returned Error Types: -// -// - EventDataStoreARNInvalidException -// The specified event data store ARN is not valid or does not map to an event -// data store in your account. -// -// - EventDataStoreNotFoundException -// The specified event data store was not found. -// -// - InactiveEventDataStoreException -// The event data store is inactive. -// -// - InactiveQueryException -// The specified query cannot be canceled because it is in the FINISHED, FAILED, -// TIMED_OUT, or CANCELLED state. -// -// - InvalidParameterException -// The request includes a parameter that is not valid. -// -// - QueryIdNotFoundException -// The query ID does not exist or does not map to a query. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// - ConflictException -// This exception is thrown when the specified resource is not ready for an -// operation. This can occur when you try to run an operation on a resource -// before CloudTrail has time to fully load the resource, or because another -// operation is modifying the resource. If this exception occurs, wait a few -// minutes, and then try the operation again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CancelQuery -func (c *CloudTrail) CancelQuery(input *CancelQueryInput) (*CancelQueryOutput, error) { - req, out := c.CancelQueryRequest(input) - return out, req.Send() -} - -// CancelQueryWithContext is the same as CancelQuery with the addition of -// the ability to pass a context and additional request options. -// -// See CancelQuery for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) CancelQueryWithContext(ctx aws.Context, input *CancelQueryInput, opts ...request.Option) (*CancelQueryOutput, error) { - req, out := c.CancelQueryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateChannel = "CreateChannel" - -// CreateChannelRequest generates a "aws/request.Request" representing the -// client's request for the CreateChannel operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateChannel for more information on using the CreateChannel -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the CreateChannelRequest method. -// req, resp := client.CreateChannelRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CreateChannel -func (c *CloudTrail) CreateChannelRequest(input *CreateChannelInput) (req *request.Request, output *CreateChannelOutput) { - op := &request.Operation{ - Name: opCreateChannel, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateChannelInput{} - } - - output = &CreateChannelOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateChannel API operation for AWS CloudTrail. -// -// Creates a channel for CloudTrail to ingest events from a partner or external -// source. After you create a channel, a CloudTrail Lake event data store can -// log events from the partner or source that you specify. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation CreateChannel for usage and error information. -// -// Returned Error Types: -// -// - ChannelMaxLimitExceededException -// This exception is thrown when the maximum number of channels limit is exceeded. -// -// - InvalidSourceException -// This exception is thrown when the specified value of Source is not valid. -// -// - ChannelAlreadyExistsException -// This exception is thrown when the provided channel already exists. -// -// - EventDataStoreARNInvalidException -// The specified event data store ARN is not valid or does not map to an event -// data store in your account. -// -// - EventDataStoreNotFoundException -// The specified event data store was not found. -// -// - InvalidEventDataStoreCategoryException -// This exception is thrown when event categories of specified event data stores -// are not valid. -// -// - InactiveEventDataStoreException -// The event data store is inactive. -// -// - InvalidParameterException -// The request includes a parameter that is not valid. -// -// - InvalidTagParameterException -// This exception is thrown when the specified tag key or values are not valid. -// It can also occur if there are duplicate tags or too many tags on the resource. -// -// - TagsLimitExceededException -// The number of tags per trail, event data store, or channel has exceeded the -// permitted amount. Currently, the limit is 50. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CreateChannel -func (c *CloudTrail) CreateChannel(input *CreateChannelInput) (*CreateChannelOutput, error) { - req, out := c.CreateChannelRequest(input) - return out, req.Send() -} - -// CreateChannelWithContext is the same as CreateChannel with the addition of -// the ability to pass a context and additional request options. -// -// See CreateChannel for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) CreateChannelWithContext(ctx aws.Context, input *CreateChannelInput, opts ...request.Option) (*CreateChannelOutput, error) { - req, out := c.CreateChannelRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateEventDataStore = "CreateEventDataStore" - -// CreateEventDataStoreRequest generates a "aws/request.Request" representing the -// client's request for the CreateEventDataStore operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateEventDataStore for more information on using the CreateEventDataStore -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the CreateEventDataStoreRequest method. -// req, resp := client.CreateEventDataStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CreateEventDataStore -func (c *CloudTrail) CreateEventDataStoreRequest(input *CreateEventDataStoreInput) (req *request.Request, output *CreateEventDataStoreOutput) { - op := &request.Operation{ - Name: opCreateEventDataStore, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateEventDataStoreInput{} - } - - output = &CreateEventDataStoreOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateEventDataStore API operation for AWS CloudTrail. -// -// Creates a new event data store. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation CreateEventDataStore for usage and error information. -// -// Returned Error Types: -// -// - EventDataStoreAlreadyExistsException -// An event data store with that name already exists. -// -// - EventDataStoreMaxLimitExceededException -// Your account has used the maximum number of event data stores. -// -// - InvalidEventSelectorsException -// This exception is thrown when the PutEventSelectors operation is called with -// a number of event selectors, advanced event selectors, or data resources -// that is not valid. The combination of event selectors or advanced event selectors -// and data resources is not valid. A trail can have up to 5 event selectors. -// If a trail uses advanced event selectors, a maximum of 500 total values for -// all conditions in all advanced event selectors is allowed. A trail is limited -// to 250 data resources. These data resources can be distributed across event -// selectors, but the overall total cannot exceed 250. -// -// You can: -// -// - Specify a valid number of event selectors (1 to 5) for a trail. -// -// - Specify a valid number of data resources (1 to 250) for an event selector. -// The limit of number of resources on an individual event selector is configurable -// up to 250. However, this upper limit is allowed only if the total number -// of data resources does not exceed 250 across all event selectors for a -// trail. -// -// - Specify up to 500 values for all conditions in all advanced event selectors -// for a trail. -// -// - Specify a valid value for a parameter. For example, specifying the ReadWriteType -// parameter with a value of read-only is not valid. -// -// - InvalidParameterException -// The request includes a parameter that is not valid. -// -// - InvalidTagParameterException -// This exception is thrown when the specified tag key or values are not valid. -// It can also occur if there are duplicate tags or too many tags on the resource. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - ConflictException -// This exception is thrown when the specified resource is not ready for an -// operation. This can occur when you try to run an operation on a resource -// before CloudTrail has time to fully load the resource, or because another -// operation is modifying the resource. If this exception occurs, wait a few -// minutes, and then try the operation again. -// -// - InsufficientEncryptionPolicyException -// This exception is thrown when the policy on the S3 bucket or KMS key does -// not have sufficient permissions for the operation. -// -// - InvalidKmsKeyIdException -// This exception is thrown when the KMS key ARN is not valid. -// -// - KmsKeyNotFoundException -// This exception is thrown when the KMS key does not exist, when the S3 bucket -// and the KMS key are not in the same region, or when the KMS key associated -// with the Amazon SNS topic either does not exist or is not in the same region. -// -// - KmsException -// This exception is thrown when there is an issue with the specified KMS key -// and the trail or event data store can't be updated. -// -// - AccessNotEnabledException -// This exception is thrown when trusted access has not been enabled between -// CloudTrail and Organizations. For more information, see Enabling Trusted -// Access with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). -// -// - InsufficientDependencyServiceAccessPermissionException -// This exception is thrown when the IAM user or role that is used to create -// the organization resource lacks one or more required permissions for creating -// an organization resource in a required service. -// -// - NotOrganizationMasterAccountException -// This exception is thrown when the Amazon Web Services account making the -// request to create or update an organization trail or event data store is -// not the management account for an organization in Organizations. For more -// information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). -// -// - OrganizationsNotInUseException -// This exception is thrown when the request is made from an Amazon Web Services -// account that is not a member of an organization. To make this request, sign -// in using the credentials of an account that belongs to an organization. -// -// - OrganizationNotInAllFeaturesModeException -// This exception is thrown when Organizations is not configured to support -// all features. All features must be enabled in Organizations to support creating -// an organization trail or event data store. -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CreateEventDataStore -func (c *CloudTrail) CreateEventDataStore(input *CreateEventDataStoreInput) (*CreateEventDataStoreOutput, error) { - req, out := c.CreateEventDataStoreRequest(input) - return out, req.Send() -} - -// CreateEventDataStoreWithContext is the same as CreateEventDataStore with the addition of -// the ability to pass a context and additional request options. -// -// See CreateEventDataStore for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) CreateEventDataStoreWithContext(ctx aws.Context, input *CreateEventDataStoreInput, opts ...request.Option) (*CreateEventDataStoreOutput, error) { - req, out := c.CreateEventDataStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateTrail = "CreateTrail" - -// CreateTrailRequest generates a "aws/request.Request" representing the -// client's request for the CreateTrail operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateTrail for more information on using the CreateTrail -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the CreateTrailRequest method. -// req, resp := client.CreateTrailRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CreateTrail -func (c *CloudTrail) CreateTrailRequest(input *CreateTrailInput) (req *request.Request, output *CreateTrailOutput) { - op := &request.Operation{ - Name: opCreateTrail, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateTrailInput{} - } - - output = &CreateTrailOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateTrail API operation for AWS CloudTrail. -// -// Creates a trail that specifies the settings for delivery of log data to an -// Amazon S3 bucket. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation CreateTrail for usage and error information. -// -// Returned Error Types: -// -// - MaximumNumberOfTrailsExceededException -// This exception is thrown when the maximum number of trails is reached. -// -// - TrailAlreadyExistsException -// This exception is thrown when the specified trail already exists. -// -// - S3BucketDoesNotExistException -// This exception is thrown when the specified S3 bucket does not exist. -// -// - InsufficientS3BucketPolicyException -// This exception is thrown when the policy on the S3 bucket is not sufficient. -// -// - InsufficientSnsTopicPolicyException -// This exception is thrown when the policy on the Amazon SNS topic is not sufficient. -// -// - InsufficientEncryptionPolicyException -// This exception is thrown when the policy on the S3 bucket or KMS key does -// not have sufficient permissions for the operation. -// -// - InvalidS3BucketNameException -// This exception is thrown when the provided S3 bucket name is not valid. -// -// - InvalidS3PrefixException -// This exception is thrown when the provided S3 prefix is not valid. -// -// - InvalidSnsTopicNameException -// This exception is thrown when the provided SNS topic name is not valid. -// -// - InvalidKmsKeyIdException -// This exception is thrown when the KMS key ARN is not valid. -// -// - InvalidTrailNameException -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// - Start with a letter or number, and end with a letter or number -// -// - Be between 3 and 128 characters -// -// - Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are not valid. -// -// - Not be in IP address format (for example, 192.168.5.4) -// -// - TrailNotProvidedException -// This exception is no longer in use. -// -// - TagsLimitExceededException -// The number of tags per trail, event data store, or channel has exceeded the -// permitted amount. Currently, the limit is 50. -// -// - InvalidParameterCombinationException -// This exception is thrown when the combination of parameters provided is not -// valid. -// -// - KmsKeyNotFoundException -// This exception is thrown when the KMS key does not exist, when the S3 bucket -// and the KMS key are not in the same region, or when the KMS key associated -// with the Amazon SNS topic either does not exist or is not in the same region. -// -// - KmsKeyDisabledException -// This exception is no longer in use. -// -// - KmsException -// This exception is thrown when there is an issue with the specified KMS key -// and the trail or event data store can't be updated. -// -// - InvalidCloudWatchLogsLogGroupArnException -// This exception is thrown when the provided CloudWatch Logs log group is not -// valid. -// -// - InvalidCloudWatchLogsRoleArnException -// This exception is thrown when the provided role is not valid. -// -// - CloudWatchLogsDeliveryUnavailableException -// Cannot set a CloudWatch Logs delivery for this region. -// -// - InvalidTagParameterException -// This exception is thrown when the specified tag key or values are not valid. -// It can also occur if there are duplicate tags or too many tags on the resource. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - AccessNotEnabledException -// This exception is thrown when trusted access has not been enabled between -// CloudTrail and Organizations. For more information, see Enabling Trusted -// Access with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). -// -// - InsufficientDependencyServiceAccessPermissionException -// This exception is thrown when the IAM user or role that is used to create -// the organization resource lacks one or more required permissions for creating -// an organization resource in a required service. -// -// - NotOrganizationMasterAccountException -// This exception is thrown when the Amazon Web Services account making the -// request to create or update an organization trail or event data store is -// not the management account for an organization in Organizations. For more -// information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). -// -// - OrganizationsNotInUseException -// This exception is thrown when the request is made from an Amazon Web Services -// account that is not a member of an organization. To make this request, sign -// in using the credentials of an account that belongs to an organization. -// -// - OrganizationNotInAllFeaturesModeException -// This exception is thrown when Organizations is not configured to support -// all features. All features must be enabled in Organizations to support creating -// an organization trail or event data store. -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// - CloudTrailInvalidClientTokenIdException -// This exception is thrown when a call results in the InvalidClientTokenId -// error code. This can occur when you are creating or updating a trail to send -// notifications to an Amazon SNS topic that is in a suspended Amazon Web Services -// account. -// -// - ConflictException -// This exception is thrown when the specified resource is not ready for an -// operation. This can occur when you try to run an operation on a resource -// before CloudTrail has time to fully load the resource, or because another -// operation is modifying the resource. If this exception occurs, wait a few -// minutes, and then try the operation again. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/CreateTrail -func (c *CloudTrail) CreateTrail(input *CreateTrailInput) (*CreateTrailOutput, error) { - req, out := c.CreateTrailRequest(input) - return out, req.Send() -} - -// CreateTrailWithContext is the same as CreateTrail with the addition of -// the ability to pass a context and additional request options. -// -// See CreateTrail for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) CreateTrailWithContext(ctx aws.Context, input *CreateTrailInput, opts ...request.Option) (*CreateTrailOutput, error) { - req, out := c.CreateTrailRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteChannel = "DeleteChannel" - -// DeleteChannelRequest generates a "aws/request.Request" representing the -// client's request for the DeleteChannel operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteChannel for more information on using the DeleteChannel -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteChannelRequest method. -// req, resp := client.DeleteChannelRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeleteChannel -func (c *CloudTrail) DeleteChannelRequest(input *DeleteChannelInput) (req *request.Request, output *DeleteChannelOutput) { - op := &request.Operation{ - Name: opDeleteChannel, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteChannelInput{} - } - - output = &DeleteChannelOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteChannel API operation for AWS CloudTrail. -// -// Deletes a channel. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation DeleteChannel for usage and error information. -// -// Returned Error Types: -// -// - ChannelARNInvalidException -// This exception is thrown when the specified value of ChannelARN is not valid. -// -// - ChannelNotFoundException -// This exception is thrown when CloudTrail cannot find the specified channel. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeleteChannel -func (c *CloudTrail) DeleteChannel(input *DeleteChannelInput) (*DeleteChannelOutput, error) { - req, out := c.DeleteChannelRequest(input) - return out, req.Send() -} - -// DeleteChannelWithContext is the same as DeleteChannel with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteChannel for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) DeleteChannelWithContext(ctx aws.Context, input *DeleteChannelInput, opts ...request.Option) (*DeleteChannelOutput, error) { - req, out := c.DeleteChannelRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteEventDataStore = "DeleteEventDataStore" - -// DeleteEventDataStoreRequest generates a "aws/request.Request" representing the -// client's request for the DeleteEventDataStore operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteEventDataStore for more information on using the DeleteEventDataStore -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteEventDataStoreRequest method. -// req, resp := client.DeleteEventDataStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeleteEventDataStore -func (c *CloudTrail) DeleteEventDataStoreRequest(input *DeleteEventDataStoreInput) (req *request.Request, output *DeleteEventDataStoreOutput) { - op := &request.Operation{ - Name: opDeleteEventDataStore, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteEventDataStoreInput{} - } - - output = &DeleteEventDataStoreOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteEventDataStore API operation for AWS CloudTrail. -// -// Disables the event data store specified by EventDataStore, which accepts -// an event data store ARN. After you run DeleteEventDataStore, the event data -// store enters a PENDING_DELETION state, and is automatically deleted after -// a wait period of seven days. TerminationProtectionEnabled must be set to -// False on the event data store; this operation cannot work if TerminationProtectionEnabled -// is True. -// -// After you run DeleteEventDataStore on an event data store, you cannot run -// ListQueries, DescribeQuery, or GetQueryResults on queries that are using -// an event data store in a PENDING_DELETION state. An event data store in the -// PENDING_DELETION state does not incur costs. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation DeleteEventDataStore for usage and error information. -// -// Returned Error Types: -// -// - EventDataStoreARNInvalidException -// The specified event data store ARN is not valid or does not map to an event -// data store in your account. -// -// - EventDataStoreNotFoundException -// The specified event data store was not found. -// -// - EventDataStoreTerminationProtectedException -// The event data store cannot be deleted because termination protection is -// enabled for it. -// -// - EventDataStoreHasOngoingImportException -// This exception is thrown when you try to update or delete an event data store -// that currently has an import in progress. -// -// - InactiveEventDataStoreException -// The event data store is inactive. -// -// - InvalidParameterException -// The request includes a parameter that is not valid. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - NotOrganizationMasterAccountException -// This exception is thrown when the Amazon Web Services account making the -// request to create or update an organization trail or event data store is -// not the management account for an organization in Organizations. For more -// information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// - ChannelExistsForEDSException -// This exception is thrown when the specified event data store cannot yet be -// deleted because it is in use by a channel. -// -// - InsufficientDependencyServiceAccessPermissionException -// This exception is thrown when the IAM user or role that is used to create -// the organization resource lacks one or more required permissions for creating -// an organization resource in a required service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeleteEventDataStore -func (c *CloudTrail) DeleteEventDataStore(input *DeleteEventDataStoreInput) (*DeleteEventDataStoreOutput, error) { - req, out := c.DeleteEventDataStoreRequest(input) - return out, req.Send() -} - -// DeleteEventDataStoreWithContext is the same as DeleteEventDataStore with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteEventDataStore for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) DeleteEventDataStoreWithContext(ctx aws.Context, input *DeleteEventDataStoreInput, opts ...request.Option) (*DeleteEventDataStoreOutput, error) { - req, out := c.DeleteEventDataStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteResourcePolicy = "DeleteResourcePolicy" - -// DeleteResourcePolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteResourcePolicy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteResourcePolicy for more information on using the DeleteResourcePolicy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteResourcePolicyRequest method. -// req, resp := client.DeleteResourcePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeleteResourcePolicy -func (c *CloudTrail) DeleteResourcePolicyRequest(input *DeleteResourcePolicyInput) (req *request.Request, output *DeleteResourcePolicyOutput) { - op := &request.Operation{ - Name: opDeleteResourcePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteResourcePolicyInput{} - } - - output = &DeleteResourcePolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteResourcePolicy API operation for AWS CloudTrail. -// -// Deletes the resource-based policy attached to the CloudTrail channel. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation DeleteResourcePolicy for usage and error information. -// -// Returned Error Types: -// -// - ResourceARNNotValidException -// This exception is thrown when the provided resource does not exist, or the -// ARN format of the resource is not valid. The following is the valid format -// for a resource ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/MyChannel. -// -// - ResourceNotFoundException -// This exception is thrown when the specified resource is not found. -// -// - ResourcePolicyNotFoundException -// This exception is thrown when the specified resource policy is not found. -// -// - ResourceTypeNotSupportedException -// This exception is thrown when the specified resource type is not supported -// by CloudTrail. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeleteResourcePolicy -func (c *CloudTrail) DeleteResourcePolicy(input *DeleteResourcePolicyInput) (*DeleteResourcePolicyOutput, error) { - req, out := c.DeleteResourcePolicyRequest(input) - return out, req.Send() -} - -// DeleteResourcePolicyWithContext is the same as DeleteResourcePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteResourcePolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) DeleteResourcePolicyWithContext(ctx aws.Context, input *DeleteResourcePolicyInput, opts ...request.Option) (*DeleteResourcePolicyOutput, error) { - req, out := c.DeleteResourcePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteTrail = "DeleteTrail" - -// DeleteTrailRequest generates a "aws/request.Request" representing the -// client's request for the DeleteTrail operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteTrail for more information on using the DeleteTrail -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteTrailRequest method. -// req, resp := client.DeleteTrailRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeleteTrail -func (c *CloudTrail) DeleteTrailRequest(input *DeleteTrailInput) (req *request.Request, output *DeleteTrailOutput) { - op := &request.Operation{ - Name: opDeleteTrail, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteTrailInput{} - } - - output = &DeleteTrailOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteTrail API operation for AWS CloudTrail. -// -// Deletes a trail. This operation must be called from the region in which the -// trail was created. DeleteTrail cannot be called on the shadow trails (replicated -// trails in other regions) of a trail that is enabled in all regions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation DeleteTrail for usage and error information. -// -// Returned Error Types: -// -// - TrailNotFoundException -// This exception is thrown when the trail with the given name is not found. -// -// - InvalidTrailNameException -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// - Start with a letter or number, and end with a letter or number -// -// - Be between 3 and 128 characters -// -// - Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are not valid. -// -// - Not be in IP address format (for example, 192.168.5.4) -// -// - ARNInvalidException -// This exception is thrown when an operation is called with a trail ARN that -// is not valid. The following is the format of a trail ARN. -// -// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail -// -// This exception is also thrown when you call AddTags or RemoveTags on a trail, -// event data store, or channel with a resource ARN that is not valid. -// -// The following is the format of an event data store ARN: arn:aws:cloudtrail:us-east-2:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE -// -// The following is the format of a channel ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 -// -// - ConflictException -// This exception is thrown when the specified resource is not ready for an -// operation. This can occur when you try to run an operation on a resource -// before CloudTrail has time to fully load the resource, or because another -// operation is modifying the resource. If this exception occurs, wait a few -// minutes, and then try the operation again. -// -// - InvalidHomeRegionException -// This exception is thrown when an operation is called on a trail from a region -// other than the region in which the trail was created. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - NotOrganizationMasterAccountException -// This exception is thrown when the Amazon Web Services account making the -// request to create or update an organization trail or event data store is -// not the management account for an organization in Organizations. For more -// information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// - InsufficientDependencyServiceAccessPermissionException -// This exception is thrown when the IAM user or role that is used to create -// the organization resource lacks one or more required permissions for creating -// an organization resource in a required service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeleteTrail -func (c *CloudTrail) DeleteTrail(input *DeleteTrailInput) (*DeleteTrailOutput, error) { - req, out := c.DeleteTrailRequest(input) - return out, req.Send() -} - -// DeleteTrailWithContext is the same as DeleteTrail with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteTrail for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) DeleteTrailWithContext(ctx aws.Context, input *DeleteTrailInput, opts ...request.Option) (*DeleteTrailOutput, error) { - req, out := c.DeleteTrailRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeregisterOrganizationDelegatedAdmin = "DeregisterOrganizationDelegatedAdmin" - -// DeregisterOrganizationDelegatedAdminRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterOrganizationDelegatedAdmin operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeregisterOrganizationDelegatedAdmin for more information on using the DeregisterOrganizationDelegatedAdmin -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeregisterOrganizationDelegatedAdminRequest method. -// req, resp := client.DeregisterOrganizationDelegatedAdminRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeregisterOrganizationDelegatedAdmin -func (c *CloudTrail) DeregisterOrganizationDelegatedAdminRequest(input *DeregisterOrganizationDelegatedAdminInput) (req *request.Request, output *DeregisterOrganizationDelegatedAdminOutput) { - op := &request.Operation{ - Name: opDeregisterOrganizationDelegatedAdmin, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterOrganizationDelegatedAdminInput{} - } - - output = &DeregisterOrganizationDelegatedAdminOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeregisterOrganizationDelegatedAdmin API operation for AWS CloudTrail. -// -// Removes CloudTrail delegated administrator permissions from a member account -// in an organization. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation DeregisterOrganizationDelegatedAdmin for usage and error information. -// -// Returned Error Types: -// -// - AccountNotFoundException -// This exception is thrown when the specified account is not found or not part -// of an organization. -// -// - AccountNotRegisteredException -// This exception is thrown when the specified account is not registered as -// the CloudTrail delegated administrator. -// -// - AccessNotEnabledException -// This exception is thrown when trusted access has not been enabled between -// CloudTrail and Organizations. For more information, see Enabling Trusted -// Access with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). -// -// - ConflictException -// This exception is thrown when the specified resource is not ready for an -// operation. This can occur when you try to run an operation on a resource -// before CloudTrail has time to fully load the resource, or because another -// operation is modifying the resource. If this exception occurs, wait a few -// minutes, and then try the operation again. -// -// - InsufficientDependencyServiceAccessPermissionException -// This exception is thrown when the IAM user or role that is used to create -// the organization resource lacks one or more required permissions for creating -// an organization resource in a required service. -// -// - InvalidParameterException -// The request includes a parameter that is not valid. -// -// - NotOrganizationManagementAccountException -// This exception is thrown when the account making the request is not the organization's -// management account. -// -// - OrganizationNotInAllFeaturesModeException -// This exception is thrown when Organizations is not configured to support -// all features. All features must be enabled in Organizations to support creating -// an organization trail or event data store. -// -// - OrganizationsNotInUseException -// This exception is thrown when the request is made from an Amazon Web Services -// account that is not a member of an organization. To make this request, sign -// in using the credentials of an account that belongs to an organization. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DeregisterOrganizationDelegatedAdmin -func (c *CloudTrail) DeregisterOrganizationDelegatedAdmin(input *DeregisterOrganizationDelegatedAdminInput) (*DeregisterOrganizationDelegatedAdminOutput, error) { - req, out := c.DeregisterOrganizationDelegatedAdminRequest(input) - return out, req.Send() -} - -// DeregisterOrganizationDelegatedAdminWithContext is the same as DeregisterOrganizationDelegatedAdmin with the addition of -// the ability to pass a context and additional request options. -// -// See DeregisterOrganizationDelegatedAdmin for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) DeregisterOrganizationDelegatedAdminWithContext(ctx aws.Context, input *DeregisterOrganizationDelegatedAdminInput, opts ...request.Option) (*DeregisterOrganizationDelegatedAdminOutput, error) { - req, out := c.DeregisterOrganizationDelegatedAdminRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeQuery = "DescribeQuery" - -// DescribeQueryRequest generates a "aws/request.Request" representing the -// client's request for the DescribeQuery operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeQuery for more information on using the DescribeQuery -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DescribeQueryRequest method. -// req, resp := client.DescribeQueryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DescribeQuery -func (c *CloudTrail) DescribeQueryRequest(input *DescribeQueryInput) (req *request.Request, output *DescribeQueryOutput) { - op := &request.Operation{ - Name: opDescribeQuery, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeQueryInput{} - } - - output = &DescribeQueryOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeQuery API operation for AWS CloudTrail. -// -// Returns metadata about a query, including query run time in milliseconds, -// number of events scanned and matched, and query status. You must specify -// an ARN for EventDataStore, and a value for QueryID. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation DescribeQuery for usage and error information. -// -// Returned Error Types: -// -// - EventDataStoreARNInvalidException -// The specified event data store ARN is not valid or does not map to an event -// data store in your account. -// -// - EventDataStoreNotFoundException -// The specified event data store was not found. -// -// - InactiveEventDataStoreException -// The event data store is inactive. -// -// - InvalidParameterException -// The request includes a parameter that is not valid. -// -// - QueryIdNotFoundException -// The query ID does not exist or does not map to a query. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DescribeQuery -func (c *CloudTrail) DescribeQuery(input *DescribeQueryInput) (*DescribeQueryOutput, error) { - req, out := c.DescribeQueryRequest(input) - return out, req.Send() -} - -// DescribeQueryWithContext is the same as DescribeQuery with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeQuery for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) DescribeQueryWithContext(ctx aws.Context, input *DescribeQueryInput, opts ...request.Option) (*DescribeQueryOutput, error) { - req, out := c.DescribeQueryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeTrails = "DescribeTrails" - -// DescribeTrailsRequest generates a "aws/request.Request" representing the -// client's request for the DescribeTrails operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeTrails for more information on using the DescribeTrails -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DescribeTrailsRequest method. -// req, resp := client.DescribeTrailsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DescribeTrails -func (c *CloudTrail) DescribeTrailsRequest(input *DescribeTrailsInput) (req *request.Request, output *DescribeTrailsOutput) { - op := &request.Operation{ - Name: opDescribeTrails, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeTrailsInput{} - } - - output = &DescribeTrailsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeTrails API operation for AWS CloudTrail. -// -// Retrieves settings for one or more trails associated with the current region -// for your account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation DescribeTrails for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - InvalidTrailNameException -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// - Start with a letter or number, and end with a letter or number -// -// - Be between 3 and 128 characters -// -// - Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are not valid. -// -// - Not be in IP address format (for example, 192.168.5.4) -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/DescribeTrails -func (c *CloudTrail) DescribeTrails(input *DescribeTrailsInput) (*DescribeTrailsOutput, error) { - req, out := c.DescribeTrailsRequest(input) - return out, req.Send() -} - -// DescribeTrailsWithContext is the same as DescribeTrails with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeTrails for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) DescribeTrailsWithContext(ctx aws.Context, input *DescribeTrailsInput, opts ...request.Option) (*DescribeTrailsOutput, error) { - req, out := c.DescribeTrailsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetChannel = "GetChannel" - -// GetChannelRequest generates a "aws/request.Request" representing the -// client's request for the GetChannel operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetChannel for more information on using the GetChannel -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetChannelRequest method. -// req, resp := client.GetChannelRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetChannel -func (c *CloudTrail) GetChannelRequest(input *GetChannelInput) (req *request.Request, output *GetChannelOutput) { - op := &request.Operation{ - Name: opGetChannel, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetChannelInput{} - } - - output = &GetChannelOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetChannel API operation for AWS CloudTrail. -// -// Returns information about a specific channel. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation GetChannel for usage and error information. -// -// Returned Error Types: -// -// - ChannelARNInvalidException -// This exception is thrown when the specified value of ChannelARN is not valid. -// -// - ChannelNotFoundException -// This exception is thrown when CloudTrail cannot find the specified channel. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetChannel -func (c *CloudTrail) GetChannel(input *GetChannelInput) (*GetChannelOutput, error) { - req, out := c.GetChannelRequest(input) - return out, req.Send() -} - -// GetChannelWithContext is the same as GetChannel with the addition of -// the ability to pass a context and additional request options. -// -// See GetChannel for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) GetChannelWithContext(ctx aws.Context, input *GetChannelInput, opts ...request.Option) (*GetChannelOutput, error) { - req, out := c.GetChannelRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetEventDataStore = "GetEventDataStore" - -// GetEventDataStoreRequest generates a "aws/request.Request" representing the -// client's request for the GetEventDataStore operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetEventDataStore for more information on using the GetEventDataStore -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetEventDataStoreRequest method. -// req, resp := client.GetEventDataStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetEventDataStore -func (c *CloudTrail) GetEventDataStoreRequest(input *GetEventDataStoreInput) (req *request.Request, output *GetEventDataStoreOutput) { - op := &request.Operation{ - Name: opGetEventDataStore, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetEventDataStoreInput{} - } - - output = &GetEventDataStoreOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetEventDataStore API operation for AWS CloudTrail. -// -// Returns information about an event data store specified as either an ARN -// or the ID portion of the ARN. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation GetEventDataStore for usage and error information. -// -// Returned Error Types: -// -// - EventDataStoreARNInvalidException -// The specified event data store ARN is not valid or does not map to an event -// data store in your account. -// -// - EventDataStoreNotFoundException -// The specified event data store was not found. -// -// - InvalidParameterException -// The request includes a parameter that is not valid. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetEventDataStore -func (c *CloudTrail) GetEventDataStore(input *GetEventDataStoreInput) (*GetEventDataStoreOutput, error) { - req, out := c.GetEventDataStoreRequest(input) - return out, req.Send() -} - -// GetEventDataStoreWithContext is the same as GetEventDataStore with the addition of -// the ability to pass a context and additional request options. -// -// See GetEventDataStore for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) GetEventDataStoreWithContext(ctx aws.Context, input *GetEventDataStoreInput, opts ...request.Option) (*GetEventDataStoreOutput, error) { - req, out := c.GetEventDataStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetEventSelectors = "GetEventSelectors" - -// GetEventSelectorsRequest generates a "aws/request.Request" representing the -// client's request for the GetEventSelectors operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetEventSelectors for more information on using the GetEventSelectors -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetEventSelectorsRequest method. -// req, resp := client.GetEventSelectorsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetEventSelectors -func (c *CloudTrail) GetEventSelectorsRequest(input *GetEventSelectorsInput) (req *request.Request, output *GetEventSelectorsOutput) { - op := &request.Operation{ - Name: opGetEventSelectors, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetEventSelectorsInput{} - } - - output = &GetEventSelectorsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetEventSelectors API operation for AWS CloudTrail. -// -// Describes the settings for the event selectors that you configured for your -// trail. The information returned for your event selectors includes the following: -// -// - If your event selector includes read-only events, write-only events, -// or all events. This applies to both management events and data events. -// -// - If your event selector includes management events. -// -// - If your event selector includes data events, the resources on which -// you are logging data events. -// -// For more information about logging management and data events, see the following -// topics in the CloudTrail User Guide: -// -// - Logging management events for trails (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html) -// -// - Logging data events for trails (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation GetEventSelectors for usage and error information. -// -// Returned Error Types: -// -// - TrailNotFoundException -// This exception is thrown when the trail with the given name is not found. -// -// - InvalidTrailNameException -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// - Start with a letter or number, and end with a letter or number -// -// - Be between 3 and 128 characters -// -// - Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are not valid. -// -// - Not be in IP address format (for example, 192.168.5.4) -// -// - ARNInvalidException -// This exception is thrown when an operation is called with a trail ARN that -// is not valid. The following is the format of a trail ARN. -// -// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail -// -// This exception is also thrown when you call AddTags or RemoveTags on a trail, -// event data store, or channel with a resource ARN that is not valid. -// -// The following is the format of an event data store ARN: arn:aws:cloudtrail:us-east-2:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE -// -// The following is the format of a channel ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetEventSelectors -func (c *CloudTrail) GetEventSelectors(input *GetEventSelectorsInput) (*GetEventSelectorsOutput, error) { - req, out := c.GetEventSelectorsRequest(input) - return out, req.Send() -} - -// GetEventSelectorsWithContext is the same as GetEventSelectors with the addition of -// the ability to pass a context and additional request options. -// -// See GetEventSelectors for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) GetEventSelectorsWithContext(ctx aws.Context, input *GetEventSelectorsInput, opts ...request.Option) (*GetEventSelectorsOutput, error) { - req, out := c.GetEventSelectorsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetImport = "GetImport" - -// GetImportRequest generates a "aws/request.Request" representing the -// client's request for the GetImport operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetImport for more information on using the GetImport -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetImportRequest method. -// req, resp := client.GetImportRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetImport -func (c *CloudTrail) GetImportRequest(input *GetImportInput) (req *request.Request, output *GetImportOutput) { - op := &request.Operation{ - Name: opGetImport, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetImportInput{} - } - - output = &GetImportOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetImport API operation for AWS CloudTrail. -// -// Returns information about a specific import. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation GetImport for usage and error information. -// -// Returned Error Types: -// -// - ImportNotFoundException -// The specified import was not found. -// -// - InvalidParameterException -// The request includes a parameter that is not valid. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetImport -func (c *CloudTrail) GetImport(input *GetImportInput) (*GetImportOutput, error) { - req, out := c.GetImportRequest(input) - return out, req.Send() -} - -// GetImportWithContext is the same as GetImport with the addition of -// the ability to pass a context and additional request options. -// -// See GetImport for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) GetImportWithContext(ctx aws.Context, input *GetImportInput, opts ...request.Option) (*GetImportOutput, error) { - req, out := c.GetImportRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetInsightSelectors = "GetInsightSelectors" - -// GetInsightSelectorsRequest generates a "aws/request.Request" representing the -// client's request for the GetInsightSelectors operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetInsightSelectors for more information on using the GetInsightSelectors -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetInsightSelectorsRequest method. -// req, resp := client.GetInsightSelectorsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetInsightSelectors -func (c *CloudTrail) GetInsightSelectorsRequest(input *GetInsightSelectorsInput) (req *request.Request, output *GetInsightSelectorsOutput) { - op := &request.Operation{ - Name: opGetInsightSelectors, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetInsightSelectorsInput{} - } - - output = &GetInsightSelectorsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetInsightSelectors API operation for AWS CloudTrail. -// -// Describes the settings for the Insights event selectors that you configured -// for your trail. GetInsightSelectors shows if CloudTrail Insights event logging -// is enabled on the trail, and if it is, which insight types are enabled. If -// you run GetInsightSelectors on a trail that does not have Insights events -// enabled, the operation throws the exception InsightNotEnabledException -// -// For more information, see Logging CloudTrail Insights Events for Trails (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-insights-events-with-cloudtrail.html) -// in the CloudTrail User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation GetInsightSelectors for usage and error information. -// -// Returned Error Types: -// -// - TrailNotFoundException -// This exception is thrown when the trail with the given name is not found. -// -// - InvalidTrailNameException -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// - Start with a letter or number, and end with a letter or number -// -// - Be between 3 and 128 characters -// -// - Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are not valid. -// -// - Not be in IP address format (for example, 192.168.5.4) -// -// - ARNInvalidException -// This exception is thrown when an operation is called with a trail ARN that -// is not valid. The following is the format of a trail ARN. -// -// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail -// -// This exception is also thrown when you call AddTags or RemoveTags on a trail, -// event data store, or channel with a resource ARN that is not valid. -// -// The following is the format of an event data store ARN: arn:aws:cloudtrail:us-east-2:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE -// -// The following is the format of a channel ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - InsightNotEnabledException -// If you run GetInsightSelectors on a trail that does not have Insights events -// enabled, the operation throws the exception InsightNotEnabledException. -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetInsightSelectors -func (c *CloudTrail) GetInsightSelectors(input *GetInsightSelectorsInput) (*GetInsightSelectorsOutput, error) { - req, out := c.GetInsightSelectorsRequest(input) - return out, req.Send() -} - -// GetInsightSelectorsWithContext is the same as GetInsightSelectors with the addition of -// the ability to pass a context and additional request options. -// -// See GetInsightSelectors for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) GetInsightSelectorsWithContext(ctx aws.Context, input *GetInsightSelectorsInput, opts ...request.Option) (*GetInsightSelectorsOutput, error) { - req, out := c.GetInsightSelectorsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetQueryResults = "GetQueryResults" - -// GetQueryResultsRequest generates a "aws/request.Request" representing the -// client's request for the GetQueryResults operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetQueryResults for more information on using the GetQueryResults -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetQueryResultsRequest method. -// req, resp := client.GetQueryResultsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetQueryResults -func (c *CloudTrail) GetQueryResultsRequest(input *GetQueryResultsInput) (req *request.Request, output *GetQueryResultsOutput) { - op := &request.Operation{ - Name: opGetQueryResults, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetQueryResultsInput{} - } - - output = &GetQueryResultsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetQueryResults API operation for AWS CloudTrail. -// -// Gets event data results of a query. You must specify the QueryID value returned -// by the StartQuery operation, and an ARN for EventDataStore. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation GetQueryResults for usage and error information. -// -// Returned Error Types: -// -// - EventDataStoreARNInvalidException -// The specified event data store ARN is not valid or does not map to an event -// data store in your account. -// -// - EventDataStoreNotFoundException -// The specified event data store was not found. -// -// - InactiveEventDataStoreException -// The event data store is inactive. -// -// - InvalidMaxResultsException -// This exception is thrown if the limit specified is not valid. -// -// - InvalidNextTokenException -// A token that is not valid, or a token that was previously used in a request -// with different parameters. This exception is thrown if the token is not valid. -// -// - InvalidParameterException -// The request includes a parameter that is not valid. -// -// - QueryIdNotFoundException -// The query ID does not exist or does not map to a query. -// -// - InsufficientEncryptionPolicyException -// This exception is thrown when the policy on the S3 bucket or KMS key does -// not have sufficient permissions for the operation. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetQueryResults -func (c *CloudTrail) GetQueryResults(input *GetQueryResultsInput) (*GetQueryResultsOutput, error) { - req, out := c.GetQueryResultsRequest(input) - return out, req.Send() -} - -// GetQueryResultsWithContext is the same as GetQueryResults with the addition of -// the ability to pass a context and additional request options. -// -// See GetQueryResults for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) GetQueryResultsWithContext(ctx aws.Context, input *GetQueryResultsInput, opts ...request.Option) (*GetQueryResultsOutput, error) { - req, out := c.GetQueryResultsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// GetQueryResultsPages iterates over the pages of a GetQueryResults operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetQueryResults method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a GetQueryResults operation. -// pageNum := 0 -// err := client.GetQueryResultsPages(params, -// func(page *cloudtrail.GetQueryResultsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CloudTrail) GetQueryResultsPages(input *GetQueryResultsInput, fn func(*GetQueryResultsOutput, bool) bool) error { - return c.GetQueryResultsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetQueryResultsPagesWithContext same as GetQueryResultsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) GetQueryResultsPagesWithContext(ctx aws.Context, input *GetQueryResultsInput, fn func(*GetQueryResultsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetQueryResultsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetQueryResultsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*GetQueryResultsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opGetResourcePolicy = "GetResourcePolicy" - -// GetResourcePolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetResourcePolicy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetResourcePolicy for more information on using the GetResourcePolicy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetResourcePolicyRequest method. -// req, resp := client.GetResourcePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetResourcePolicy -func (c *CloudTrail) GetResourcePolicyRequest(input *GetResourcePolicyInput) (req *request.Request, output *GetResourcePolicyOutput) { - op := &request.Operation{ - Name: opGetResourcePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetResourcePolicyInput{} - } - - output = &GetResourcePolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetResourcePolicy API operation for AWS CloudTrail. -// -// Retrieves the JSON text of the resource-based policy document attached to -// the CloudTrail channel. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation GetResourcePolicy for usage and error information. -// -// Returned Error Types: -// -// - ResourceARNNotValidException -// This exception is thrown when the provided resource does not exist, or the -// ARN format of the resource is not valid. The following is the valid format -// for a resource ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/MyChannel. -// -// - ResourceNotFoundException -// This exception is thrown when the specified resource is not found. -// -// - ResourcePolicyNotFoundException -// This exception is thrown when the specified resource policy is not found. -// -// - ResourceTypeNotSupportedException -// This exception is thrown when the specified resource type is not supported -// by CloudTrail. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetResourcePolicy -func (c *CloudTrail) GetResourcePolicy(input *GetResourcePolicyInput) (*GetResourcePolicyOutput, error) { - req, out := c.GetResourcePolicyRequest(input) - return out, req.Send() -} - -// GetResourcePolicyWithContext is the same as GetResourcePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See GetResourcePolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) GetResourcePolicyWithContext(ctx aws.Context, input *GetResourcePolicyInput, opts ...request.Option) (*GetResourcePolicyOutput, error) { - req, out := c.GetResourcePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetTrail = "GetTrail" - -// GetTrailRequest generates a "aws/request.Request" representing the -// client's request for the GetTrail operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetTrail for more information on using the GetTrail -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetTrailRequest method. -// req, resp := client.GetTrailRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetTrail -func (c *CloudTrail) GetTrailRequest(input *GetTrailInput) (req *request.Request, output *GetTrailOutput) { - op := &request.Operation{ - Name: opGetTrail, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetTrailInput{} - } - - output = &GetTrailOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTrail API operation for AWS CloudTrail. -// -// Returns settings information for a specified trail. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation GetTrail for usage and error information. -// -// Returned Error Types: -// -// - ARNInvalidException -// This exception is thrown when an operation is called with a trail ARN that -// is not valid. The following is the format of a trail ARN. -// -// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail -// -// This exception is also thrown when you call AddTags or RemoveTags on a trail, -// event data store, or channel with a resource ARN that is not valid. -// -// The following is the format of an event data store ARN: arn:aws:cloudtrail:us-east-2:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE -// -// The following is the format of a channel ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 -// -// - TrailNotFoundException -// This exception is thrown when the trail with the given name is not found. -// -// - InvalidTrailNameException -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// - Start with a letter or number, and end with a letter or number -// -// - Be between 3 and 128 characters -// -// - Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are not valid. -// -// - Not be in IP address format (for example, 192.168.5.4) -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetTrail -func (c *CloudTrail) GetTrail(input *GetTrailInput) (*GetTrailOutput, error) { - req, out := c.GetTrailRequest(input) - return out, req.Send() -} - -// GetTrailWithContext is the same as GetTrail with the addition of -// the ability to pass a context and additional request options. -// -// See GetTrail for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) GetTrailWithContext(ctx aws.Context, input *GetTrailInput, opts ...request.Option) (*GetTrailOutput, error) { - req, out := c.GetTrailRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetTrailStatus = "GetTrailStatus" - -// GetTrailStatusRequest generates a "aws/request.Request" representing the -// client's request for the GetTrailStatus operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetTrailStatus for more information on using the GetTrailStatus -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetTrailStatusRequest method. -// req, resp := client.GetTrailStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetTrailStatus -func (c *CloudTrail) GetTrailStatusRequest(input *GetTrailStatusInput) (req *request.Request, output *GetTrailStatusOutput) { - op := &request.Operation{ - Name: opGetTrailStatus, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetTrailStatusInput{} - } - - output = &GetTrailStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTrailStatus API operation for AWS CloudTrail. -// -// Returns a JSON-formatted list of information about the specified trail. Fields -// include information on delivery errors, Amazon SNS and Amazon S3 errors, -// and start and stop logging times for each trail. This operation returns trail -// status from a single region. To return trail status from all regions, you -// must call the operation on each region. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation GetTrailStatus for usage and error information. -// -// Returned Error Types: -// -// - ARNInvalidException -// This exception is thrown when an operation is called with a trail ARN that -// is not valid. The following is the format of a trail ARN. -// -// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail -// -// This exception is also thrown when you call AddTags or RemoveTags on a trail, -// event data store, or channel with a resource ARN that is not valid. -// -// The following is the format of an event data store ARN: arn:aws:cloudtrail:us-east-2:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE -// -// The following is the format of a channel ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 -// -// - TrailNotFoundException -// This exception is thrown when the trail with the given name is not found. -// -// - InvalidTrailNameException -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// - Start with a letter or number, and end with a letter or number -// -// - Be between 3 and 128 characters -// -// - Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are not valid. -// -// - Not be in IP address format (for example, 192.168.5.4) -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/GetTrailStatus -func (c *CloudTrail) GetTrailStatus(input *GetTrailStatusInput) (*GetTrailStatusOutput, error) { - req, out := c.GetTrailStatusRequest(input) - return out, req.Send() -} - -// GetTrailStatusWithContext is the same as GetTrailStatus with the addition of -// the ability to pass a context and additional request options. -// -// See GetTrailStatus for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) GetTrailStatusWithContext(ctx aws.Context, input *GetTrailStatusInput, opts ...request.Option) (*GetTrailStatusOutput, error) { - req, out := c.GetTrailStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListChannels = "ListChannels" - -// ListChannelsRequest generates a "aws/request.Request" representing the -// client's request for the ListChannels operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListChannels for more information on using the ListChannels -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListChannelsRequest method. -// req, resp := client.ListChannelsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListChannels -func (c *CloudTrail) ListChannelsRequest(input *ListChannelsInput) (req *request.Request, output *ListChannelsOutput) { - op := &request.Operation{ - Name: opListChannels, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListChannelsInput{} - } - - output = &ListChannelsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListChannels API operation for AWS CloudTrail. -// -// Lists the channels in the current account, and their source names. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation ListChannels for usage and error information. -// -// Returned Error Types: -// -// - InvalidNextTokenException -// A token that is not valid, or a token that was previously used in a request -// with different parameters. This exception is thrown if the token is not valid. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListChannels -func (c *CloudTrail) ListChannels(input *ListChannelsInput) (*ListChannelsOutput, error) { - req, out := c.ListChannelsRequest(input) - return out, req.Send() -} - -// ListChannelsWithContext is the same as ListChannels with the addition of -// the ability to pass a context and additional request options. -// -// See ListChannels for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) ListChannelsWithContext(ctx aws.Context, input *ListChannelsInput, opts ...request.Option) (*ListChannelsOutput, error) { - req, out := c.ListChannelsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListChannelsPages iterates over the pages of a ListChannels operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListChannels method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListChannels operation. -// pageNum := 0 -// err := client.ListChannelsPages(params, -// func(page *cloudtrail.ListChannelsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CloudTrail) ListChannelsPages(input *ListChannelsInput, fn func(*ListChannelsOutput, bool) bool) error { - return c.ListChannelsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListChannelsPagesWithContext same as ListChannelsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) ListChannelsPagesWithContext(ctx aws.Context, input *ListChannelsInput, fn func(*ListChannelsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListChannelsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListChannelsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListChannelsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListEventDataStores = "ListEventDataStores" - -// ListEventDataStoresRequest generates a "aws/request.Request" representing the -// client's request for the ListEventDataStores operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListEventDataStores for more information on using the ListEventDataStores -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListEventDataStoresRequest method. -// req, resp := client.ListEventDataStoresRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListEventDataStores -func (c *CloudTrail) ListEventDataStoresRequest(input *ListEventDataStoresInput) (req *request.Request, output *ListEventDataStoresOutput) { - op := &request.Operation{ - Name: opListEventDataStores, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListEventDataStoresInput{} - } - - output = &ListEventDataStoresOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListEventDataStores API operation for AWS CloudTrail. -// -// Returns information about all event data stores in the account, in the current -// region. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation ListEventDataStores for usage and error information. -// -// Returned Error Types: -// -// - InvalidMaxResultsException -// This exception is thrown if the limit specified is not valid. -// -// - InvalidNextTokenException -// A token that is not valid, or a token that was previously used in a request -// with different parameters. This exception is thrown if the token is not valid. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListEventDataStores -func (c *CloudTrail) ListEventDataStores(input *ListEventDataStoresInput) (*ListEventDataStoresOutput, error) { - req, out := c.ListEventDataStoresRequest(input) - return out, req.Send() -} - -// ListEventDataStoresWithContext is the same as ListEventDataStores with the addition of -// the ability to pass a context and additional request options. -// -// See ListEventDataStores for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) ListEventDataStoresWithContext(ctx aws.Context, input *ListEventDataStoresInput, opts ...request.Option) (*ListEventDataStoresOutput, error) { - req, out := c.ListEventDataStoresRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListEventDataStoresPages iterates over the pages of a ListEventDataStores operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListEventDataStores method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListEventDataStores operation. -// pageNum := 0 -// err := client.ListEventDataStoresPages(params, -// func(page *cloudtrail.ListEventDataStoresOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CloudTrail) ListEventDataStoresPages(input *ListEventDataStoresInput, fn func(*ListEventDataStoresOutput, bool) bool) error { - return c.ListEventDataStoresPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListEventDataStoresPagesWithContext same as ListEventDataStoresPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) ListEventDataStoresPagesWithContext(ctx aws.Context, input *ListEventDataStoresInput, fn func(*ListEventDataStoresOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListEventDataStoresInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListEventDataStoresRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListEventDataStoresOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListImportFailures = "ListImportFailures" - -// ListImportFailuresRequest generates a "aws/request.Request" representing the -// client's request for the ListImportFailures operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListImportFailures for more information on using the ListImportFailures -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListImportFailuresRequest method. -// req, resp := client.ListImportFailuresRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListImportFailures -func (c *CloudTrail) ListImportFailuresRequest(input *ListImportFailuresInput) (req *request.Request, output *ListImportFailuresOutput) { - op := &request.Operation{ - Name: opListImportFailures, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListImportFailuresInput{} - } - - output = &ListImportFailuresOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListImportFailures API operation for AWS CloudTrail. -// -// Returns a list of failures for the specified import. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation ListImportFailures for usage and error information. -// -// Returned Error Types: -// -// - InvalidNextTokenException -// A token that is not valid, or a token that was previously used in a request -// with different parameters. This exception is thrown if the token is not valid. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListImportFailures -func (c *CloudTrail) ListImportFailures(input *ListImportFailuresInput) (*ListImportFailuresOutput, error) { - req, out := c.ListImportFailuresRequest(input) - return out, req.Send() -} - -// ListImportFailuresWithContext is the same as ListImportFailures with the addition of -// the ability to pass a context and additional request options. -// -// See ListImportFailures for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) ListImportFailuresWithContext(ctx aws.Context, input *ListImportFailuresInput, opts ...request.Option) (*ListImportFailuresOutput, error) { - req, out := c.ListImportFailuresRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListImportFailuresPages iterates over the pages of a ListImportFailures operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListImportFailures method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListImportFailures operation. -// pageNum := 0 -// err := client.ListImportFailuresPages(params, -// func(page *cloudtrail.ListImportFailuresOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CloudTrail) ListImportFailuresPages(input *ListImportFailuresInput, fn func(*ListImportFailuresOutput, bool) bool) error { - return c.ListImportFailuresPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListImportFailuresPagesWithContext same as ListImportFailuresPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) ListImportFailuresPagesWithContext(ctx aws.Context, input *ListImportFailuresInput, fn func(*ListImportFailuresOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListImportFailuresInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListImportFailuresRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListImportFailuresOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListImports = "ListImports" - -// ListImportsRequest generates a "aws/request.Request" representing the -// client's request for the ListImports operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListImports for more information on using the ListImports -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListImportsRequest method. -// req, resp := client.ListImportsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListImports -func (c *CloudTrail) ListImportsRequest(input *ListImportsInput) (req *request.Request, output *ListImportsOutput) { - op := &request.Operation{ - Name: opListImports, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListImportsInput{} - } - - output = &ListImportsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListImports API operation for AWS CloudTrail. -// -// Returns information on all imports, or a select set of imports by ImportStatus -// or Destination. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation ListImports for usage and error information. -// -// Returned Error Types: -// -// - EventDataStoreARNInvalidException -// The specified event data store ARN is not valid or does not map to an event -// data store in your account. -// -// - InvalidNextTokenException -// A token that is not valid, or a token that was previously used in a request -// with different parameters. This exception is thrown if the token is not valid. -// -// - InvalidParameterException -// The request includes a parameter that is not valid. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListImports -func (c *CloudTrail) ListImports(input *ListImportsInput) (*ListImportsOutput, error) { - req, out := c.ListImportsRequest(input) - return out, req.Send() -} - -// ListImportsWithContext is the same as ListImports with the addition of -// the ability to pass a context and additional request options. -// -// See ListImports for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) ListImportsWithContext(ctx aws.Context, input *ListImportsInput, opts ...request.Option) (*ListImportsOutput, error) { - req, out := c.ListImportsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListImportsPages iterates over the pages of a ListImports operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListImports method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListImports operation. -// pageNum := 0 -// err := client.ListImportsPages(params, -// func(page *cloudtrail.ListImportsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CloudTrail) ListImportsPages(input *ListImportsInput, fn func(*ListImportsOutput, bool) bool) error { - return c.ListImportsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListImportsPagesWithContext same as ListImportsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) ListImportsPagesWithContext(ctx aws.Context, input *ListImportsInput, fn func(*ListImportsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListImportsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListImportsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListImportsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListPublicKeys = "ListPublicKeys" - -// ListPublicKeysRequest generates a "aws/request.Request" representing the -// client's request for the ListPublicKeys operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListPublicKeys for more information on using the ListPublicKeys -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListPublicKeysRequest method. -// req, resp := client.ListPublicKeysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListPublicKeys -func (c *CloudTrail) ListPublicKeysRequest(input *ListPublicKeysInput) (req *request.Request, output *ListPublicKeysOutput) { - op := &request.Operation{ - Name: opListPublicKeys, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListPublicKeysInput{} - } - - output = &ListPublicKeysOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPublicKeys API operation for AWS CloudTrail. -// -// Returns all public keys whose private keys were used to sign the digest files -// within the specified time range. The public key is needed to validate digest -// files that were signed with its corresponding private key. -// -// CloudTrail uses different private and public key pairs per region. Each digest -// file is signed with a private key unique to its region. When you validate -// a digest file from a specific region, you must look in the same region for -// its corresponding public key. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation ListPublicKeys for usage and error information. -// -// Returned Error Types: -// -// - InvalidTimeRangeException -// Occurs if the timestamp values are not valid. Either the start time occurs -// after the end time, or the time range is outside the range of possible values. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - InvalidTokenException -// Reserved for future use. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListPublicKeys -func (c *CloudTrail) ListPublicKeys(input *ListPublicKeysInput) (*ListPublicKeysOutput, error) { - req, out := c.ListPublicKeysRequest(input) - return out, req.Send() -} - -// ListPublicKeysWithContext is the same as ListPublicKeys with the addition of -// the ability to pass a context and additional request options. -// -// See ListPublicKeys for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) ListPublicKeysWithContext(ctx aws.Context, input *ListPublicKeysInput, opts ...request.Option) (*ListPublicKeysOutput, error) { - req, out := c.ListPublicKeysRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListPublicKeysPages iterates over the pages of a ListPublicKeys operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPublicKeys method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListPublicKeys operation. -// pageNum := 0 -// err := client.ListPublicKeysPages(params, -// func(page *cloudtrail.ListPublicKeysOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CloudTrail) ListPublicKeysPages(input *ListPublicKeysInput, fn func(*ListPublicKeysOutput, bool) bool) error { - return c.ListPublicKeysPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPublicKeysPagesWithContext same as ListPublicKeysPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) ListPublicKeysPagesWithContext(ctx aws.Context, input *ListPublicKeysInput, fn func(*ListPublicKeysOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListPublicKeysInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListPublicKeysRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListPublicKeysOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListQueries = "ListQueries" - -// ListQueriesRequest generates a "aws/request.Request" representing the -// client's request for the ListQueries operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListQueries for more information on using the ListQueries -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListQueriesRequest method. -// req, resp := client.ListQueriesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListQueries -func (c *CloudTrail) ListQueriesRequest(input *ListQueriesInput) (req *request.Request, output *ListQueriesOutput) { - op := &request.Operation{ - Name: opListQueries, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListQueriesInput{} - } - - output = &ListQueriesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListQueries API operation for AWS CloudTrail. -// -// Returns a list of queries and query statuses for the past seven days. You -// must specify an ARN value for EventDataStore. Optionally, to shorten the -// list of results, you can specify a time range, formatted as timestamps, by -// adding StartTime and EndTime parameters, and a QueryStatus value. Valid values -// for QueryStatus include QUEUED, RUNNING, FINISHED, FAILED, TIMED_OUT, or -// CANCELLED. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation ListQueries for usage and error information. -// -// Returned Error Types: -// -// - EventDataStoreARNInvalidException -// The specified event data store ARN is not valid or does not map to an event -// data store in your account. -// -// - EventDataStoreNotFoundException -// The specified event data store was not found. -// -// - InactiveEventDataStoreException -// The event data store is inactive. -// -// - InvalidDateRangeException -// A date range for the query was specified that is not valid. Be sure that -// the start time is chronologically before the end time. For more information -// about writing a query, see Create or edit a query (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-create-edit-query.html) -// in the CloudTrail User Guide. -// -// - InvalidMaxResultsException -// This exception is thrown if the limit specified is not valid. -// -// - InvalidNextTokenException -// A token that is not valid, or a token that was previously used in a request -// with different parameters. This exception is thrown if the token is not valid. -// -// - InvalidParameterException -// The request includes a parameter that is not valid. -// -// - InvalidQueryStatusException -// The query status is not valid for the operation. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListQueries -func (c *CloudTrail) ListQueries(input *ListQueriesInput) (*ListQueriesOutput, error) { - req, out := c.ListQueriesRequest(input) - return out, req.Send() -} - -// ListQueriesWithContext is the same as ListQueries with the addition of -// the ability to pass a context and additional request options. -// -// See ListQueries for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) ListQueriesWithContext(ctx aws.Context, input *ListQueriesInput, opts ...request.Option) (*ListQueriesOutput, error) { - req, out := c.ListQueriesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListQueriesPages iterates over the pages of a ListQueries operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListQueries method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListQueries operation. -// pageNum := 0 -// err := client.ListQueriesPages(params, -// func(page *cloudtrail.ListQueriesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CloudTrail) ListQueriesPages(input *ListQueriesInput, fn func(*ListQueriesOutput, bool) bool) error { - return c.ListQueriesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListQueriesPagesWithContext same as ListQueriesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) ListQueriesPagesWithContext(ctx aws.Context, input *ListQueriesInput, fn func(*ListQueriesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListQueriesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListQueriesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListQueriesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTags = "ListTags" - -// ListTagsRequest generates a "aws/request.Request" representing the -// client's request for the ListTags operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListTags for more information on using the ListTags -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListTagsRequest method. -// req, resp := client.ListTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListTags -func (c *CloudTrail) ListTagsRequest(input *ListTagsInput) (req *request.Request, output *ListTagsOutput) { - op := &request.Operation{ - Name: opListTags, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTagsInput{} - } - - output = &ListTagsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTags API operation for AWS CloudTrail. -// -// Lists the tags for the trail, event data store, or channel in the current -// region. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation ListTags for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// This exception is thrown when the specified resource is not found. -// -// - ARNInvalidException -// This exception is thrown when an operation is called with a trail ARN that -// is not valid. The following is the format of a trail ARN. -// -// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail -// -// This exception is also thrown when you call AddTags or RemoveTags on a trail, -// event data store, or channel with a resource ARN that is not valid. -// -// The following is the format of an event data store ARN: arn:aws:cloudtrail:us-east-2:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE -// -// The following is the format of a channel ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 -// -// - ResourceTypeNotSupportedException -// This exception is thrown when the specified resource type is not supported -// by CloudTrail. -// -// - InvalidTrailNameException -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// - Start with a letter or number, and end with a letter or number -// -// - Be between 3 and 128 characters -// -// - Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are not valid. -// -// - Not be in IP address format (for example, 192.168.5.4) -// -// - InactiveEventDataStoreException -// The event data store is inactive. -// -// - EventDataStoreNotFoundException -// The specified event data store was not found. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - InvalidTokenException -// Reserved for future use. -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListTags -func (c *CloudTrail) ListTags(input *ListTagsInput) (*ListTagsOutput, error) { - req, out := c.ListTagsRequest(input) - return out, req.Send() -} - -// ListTagsWithContext is the same as ListTags with the addition of -// the ability to pass a context and additional request options. -// -// See ListTags for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) ListTagsWithContext(ctx aws.Context, input *ListTagsInput, opts ...request.Option) (*ListTagsOutput, error) { - req, out := c.ListTagsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTagsPages iterates over the pages of a ListTags operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTags method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTags operation. -// pageNum := 0 -// err := client.ListTagsPages(params, -// func(page *cloudtrail.ListTagsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CloudTrail) ListTagsPages(input *ListTagsInput, fn func(*ListTagsOutput, bool) bool) error { - return c.ListTagsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTagsPagesWithContext same as ListTagsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) ListTagsPagesWithContext(ctx aws.Context, input *ListTagsInput, fn func(*ListTagsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTagsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTagsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListTagsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTrails = "ListTrails" - -// ListTrailsRequest generates a "aws/request.Request" representing the -// client's request for the ListTrails operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListTrails for more information on using the ListTrails -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListTrailsRequest method. -// req, resp := client.ListTrailsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListTrails -func (c *CloudTrail) ListTrailsRequest(input *ListTrailsInput) (req *request.Request, output *ListTrailsOutput) { - op := &request.Operation{ - Name: opListTrails, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTrailsInput{} - } - - output = &ListTrailsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTrails API operation for AWS CloudTrail. -// -// Lists trails that are in the current account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation ListTrails for usage and error information. -// -// Returned Error Types: -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/ListTrails -func (c *CloudTrail) ListTrails(input *ListTrailsInput) (*ListTrailsOutput, error) { - req, out := c.ListTrailsRequest(input) - return out, req.Send() -} - -// ListTrailsWithContext is the same as ListTrails with the addition of -// the ability to pass a context and additional request options. -// -// See ListTrails for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) ListTrailsWithContext(ctx aws.Context, input *ListTrailsInput, opts ...request.Option) (*ListTrailsOutput, error) { - req, out := c.ListTrailsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTrailsPages iterates over the pages of a ListTrails operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTrails method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTrails operation. -// pageNum := 0 -// err := client.ListTrailsPages(params, -// func(page *cloudtrail.ListTrailsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CloudTrail) ListTrailsPages(input *ListTrailsInput, fn func(*ListTrailsOutput, bool) bool) error { - return c.ListTrailsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTrailsPagesWithContext same as ListTrailsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) ListTrailsPagesWithContext(ctx aws.Context, input *ListTrailsInput, fn func(*ListTrailsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTrailsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTrailsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListTrailsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opLookupEvents = "LookupEvents" - -// LookupEventsRequest generates a "aws/request.Request" representing the -// client's request for the LookupEvents operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See LookupEvents for more information on using the LookupEvents -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the LookupEventsRequest method. -// req, resp := client.LookupEventsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/LookupEvents -func (c *CloudTrail) LookupEventsRequest(input *LookupEventsInput) (req *request.Request, output *LookupEventsOutput) { - op := &request.Operation{ - Name: opLookupEvents, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &LookupEventsInput{} - } - - output = &LookupEventsOutput{} - req = c.newRequest(op, input, output) - return -} - -// LookupEvents API operation for AWS CloudTrail. -// -// Looks up management events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-concepts.html#cloudtrail-concepts-management-events) -// or CloudTrail Insights events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-concepts.html#cloudtrail-concepts-insights-events) -// that are captured by CloudTrail. You can look up events that occurred in -// a region within the last 90 days. Lookup supports the following attributes -// for management events: -// -// - Amazon Web Services access key -// -// - Event ID -// -// - Event name -// -// - Event source -// -// - Read only -// -// - Resource name -// -// - Resource type -// -// - User name -// -// Lookup supports the following attributes for Insights events: -// -// - Event ID -// -// - Event name -// -// - Event source -// -// All attributes are optional. The default number of results returned is 50, -// with a maximum of 50 possible. The response includes a token that you can -// use to get the next page of results. -// -// The rate of lookup requests is limited to two per second, per account, per -// region. If this limit is exceeded, a throttling error occurs. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation LookupEvents for usage and error information. -// -// Returned Error Types: -// -// - InvalidLookupAttributesException -// Occurs when a lookup attribute is specified that is not valid. -// -// - InvalidTimeRangeException -// Occurs if the timestamp values are not valid. Either the start time occurs -// after the end time, or the time range is outside the range of possible values. -// -// - InvalidMaxResultsException -// This exception is thrown if the limit specified is not valid. -// -// - InvalidNextTokenException -// A token that is not valid, or a token that was previously used in a request -// with different parameters. This exception is thrown if the token is not valid. -// -// - InvalidEventCategoryException -// Occurs if an event category that is not valid is specified as a value of -// EventCategory. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/LookupEvents -func (c *CloudTrail) LookupEvents(input *LookupEventsInput) (*LookupEventsOutput, error) { - req, out := c.LookupEventsRequest(input) - return out, req.Send() -} - -// LookupEventsWithContext is the same as LookupEvents with the addition of -// the ability to pass a context and additional request options. -// -// See LookupEvents for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) LookupEventsWithContext(ctx aws.Context, input *LookupEventsInput, opts ...request.Option) (*LookupEventsOutput, error) { - req, out := c.LookupEventsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// LookupEventsPages iterates over the pages of a LookupEvents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See LookupEvents method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a LookupEvents operation. -// pageNum := 0 -// err := client.LookupEventsPages(params, -// func(page *cloudtrail.LookupEventsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *CloudTrail) LookupEventsPages(input *LookupEventsInput, fn func(*LookupEventsOutput, bool) bool) error { - return c.LookupEventsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// LookupEventsPagesWithContext same as LookupEventsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) LookupEventsPagesWithContext(ctx aws.Context, input *LookupEventsInput, fn func(*LookupEventsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *LookupEventsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.LookupEventsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*LookupEventsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opPutEventSelectors = "PutEventSelectors" - -// PutEventSelectorsRequest generates a "aws/request.Request" representing the -// client's request for the PutEventSelectors operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutEventSelectors for more information on using the PutEventSelectors -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutEventSelectorsRequest method. -// req, resp := client.PutEventSelectorsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutEventSelectors -func (c *CloudTrail) PutEventSelectorsRequest(input *PutEventSelectorsInput) (req *request.Request, output *PutEventSelectorsOutput) { - op := &request.Operation{ - Name: opPutEventSelectors, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutEventSelectorsInput{} - } - - output = &PutEventSelectorsOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutEventSelectors API operation for AWS CloudTrail. -// -// Configures an event selector or advanced event selectors for your trail. -// Use event selectors or advanced event selectors to specify management and -// data event settings for your trail. By default, trails created without specific -// event selectors are configured to log all read and write management events, -// and no data events. -// -// When an event occurs in your account, CloudTrail evaluates the event selectors -// or advanced event selectors in all trails. For each trail, if the event matches -// any event selector, the trail processes and logs the event. If the event -// doesn't match any event selector, the trail doesn't log the event. -// -// # Example -// -// You create an event selector for a trail and specify that you want write-only -// events. -// -// The EC2 GetConsoleOutput and RunInstances API operations occur in your account. -// -// CloudTrail evaluates whether the events match your event selectors. -// -// The RunInstances is a write-only event and it matches your event selector. -// The trail logs the event. -// -// The GetConsoleOutput is a read-only event that doesn't match your event selector. -// The trail doesn't log the event. -// -// The PutEventSelectors operation must be called from the region in which the -// trail was created; otherwise, an InvalidHomeRegionException exception is -// thrown. -// -// You can configure up to five event selectors for each trail. For more information, -// see Logging management events for trails (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html), -// Logging data events for trails (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html), -// and Quotas in CloudTrail (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html) -// in the CloudTrail User Guide. -// -// You can add advanced event selectors, and conditions for your advanced event -// selectors, up to a maximum of 500 values for all conditions and selectors -// on a trail. You can use either AdvancedEventSelectors or EventSelectors, -// but not both. If you apply AdvancedEventSelectors to a trail, any existing -// EventSelectors are overwritten. For more information about advanced event -// selectors, see Logging data events for trails (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html) -// in the CloudTrail User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation PutEventSelectors for usage and error information. -// -// Returned Error Types: -// -// - TrailNotFoundException -// This exception is thrown when the trail with the given name is not found. -// -// - InvalidTrailNameException -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// - Start with a letter or number, and end with a letter or number -// -// - Be between 3 and 128 characters -// -// - Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are not valid. -// -// - Not be in IP address format (for example, 192.168.5.4) -// -// - ARNInvalidException -// This exception is thrown when an operation is called with a trail ARN that -// is not valid. The following is the format of a trail ARN. -// -// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail -// -// This exception is also thrown when you call AddTags or RemoveTags on a trail, -// event data store, or channel with a resource ARN that is not valid. -// -// The following is the format of an event data store ARN: arn:aws:cloudtrail:us-east-2:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE -// -// The following is the format of a channel ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 -// -// - InvalidHomeRegionException -// This exception is thrown when an operation is called on a trail from a region -// other than the region in which the trail was created. -// -// - InvalidEventSelectorsException -// This exception is thrown when the PutEventSelectors operation is called with -// a number of event selectors, advanced event selectors, or data resources -// that is not valid. The combination of event selectors or advanced event selectors -// and data resources is not valid. A trail can have up to 5 event selectors. -// If a trail uses advanced event selectors, a maximum of 500 total values for -// all conditions in all advanced event selectors is allowed. A trail is limited -// to 250 data resources. These data resources can be distributed across event -// selectors, but the overall total cannot exceed 250. -// -// You can: -// -// - Specify a valid number of event selectors (1 to 5) for a trail. -// -// - Specify a valid number of data resources (1 to 250) for an event selector. -// The limit of number of resources on an individual event selector is configurable -// up to 250. However, this upper limit is allowed only if the total number -// of data resources does not exceed 250 across all event selectors for a -// trail. -// -// - Specify up to 500 values for all conditions in all advanced event selectors -// for a trail. -// -// - Specify a valid value for a parameter. For example, specifying the ReadWriteType -// parameter with a value of read-only is not valid. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - NotOrganizationMasterAccountException -// This exception is thrown when the Amazon Web Services account making the -// request to create or update an organization trail or event data store is -// not the management account for an organization in Organizations. For more -// information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// - InsufficientDependencyServiceAccessPermissionException -// This exception is thrown when the IAM user or role that is used to create -// the organization resource lacks one or more required permissions for creating -// an organization resource in a required service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutEventSelectors -func (c *CloudTrail) PutEventSelectors(input *PutEventSelectorsInput) (*PutEventSelectorsOutput, error) { - req, out := c.PutEventSelectorsRequest(input) - return out, req.Send() -} - -// PutEventSelectorsWithContext is the same as PutEventSelectors with the addition of -// the ability to pass a context and additional request options. -// -// See PutEventSelectors for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) PutEventSelectorsWithContext(ctx aws.Context, input *PutEventSelectorsInput, opts ...request.Option) (*PutEventSelectorsOutput, error) { - req, out := c.PutEventSelectorsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutInsightSelectors = "PutInsightSelectors" - -// PutInsightSelectorsRequest generates a "aws/request.Request" representing the -// client's request for the PutInsightSelectors operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutInsightSelectors for more information on using the PutInsightSelectors -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutInsightSelectorsRequest method. -// req, resp := client.PutInsightSelectorsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutInsightSelectors -func (c *CloudTrail) PutInsightSelectorsRequest(input *PutInsightSelectorsInput) (req *request.Request, output *PutInsightSelectorsOutput) { - op := &request.Operation{ - Name: opPutInsightSelectors, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutInsightSelectorsInput{} - } - - output = &PutInsightSelectorsOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutInsightSelectors API operation for AWS CloudTrail. -// -// Lets you enable Insights event logging by specifying the Insights selectors -// that you want to enable on an existing trail. You also use PutInsightSelectors -// to turn off Insights event logging, by passing an empty list of insight types. -// The valid Insights event types in this release are ApiErrorRateInsight and -// ApiCallRateInsight. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation PutInsightSelectors for usage and error information. -// -// Returned Error Types: -// -// - TrailNotFoundException -// This exception is thrown when the trail with the given name is not found. -// -// - InvalidTrailNameException -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// - Start with a letter or number, and end with a letter or number -// -// - Be between 3 and 128 characters -// -// - Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are not valid. -// -// - Not be in IP address format (for example, 192.168.5.4) -// -// - ARNInvalidException -// This exception is thrown when an operation is called with a trail ARN that -// is not valid. The following is the format of a trail ARN. -// -// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail -// -// This exception is also thrown when you call AddTags or RemoveTags on a trail, -// event data store, or channel with a resource ARN that is not valid. -// -// The following is the format of an event data store ARN: arn:aws:cloudtrail:us-east-2:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE -// -// The following is the format of a channel ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 -// -// - InvalidHomeRegionException -// This exception is thrown when an operation is called on a trail from a region -// other than the region in which the trail was created. -// -// - InvalidInsightSelectorsException -// The formatting or syntax of the InsightSelectors JSON statement in your PutInsightSelectors -// or GetInsightSelectors request is not valid, or the specified insight type -// in the InsightSelectors statement is not a valid insight type. -// -// - InsufficientS3BucketPolicyException -// This exception is thrown when the policy on the S3 bucket is not sufficient. -// -// - InsufficientEncryptionPolicyException -// This exception is thrown when the policy on the S3 bucket or KMS key does -// not have sufficient permissions for the operation. -// -// - S3BucketDoesNotExistException -// This exception is thrown when the specified S3 bucket does not exist. -// -// - KmsException -// This exception is thrown when there is an issue with the specified KMS key -// and the trail or event data store can't be updated. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - NotOrganizationMasterAccountException -// This exception is thrown when the Amazon Web Services account making the -// request to create or update an organization trail or event data store is -// not the management account for an organization in Organizations. For more -// information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutInsightSelectors -func (c *CloudTrail) PutInsightSelectors(input *PutInsightSelectorsInput) (*PutInsightSelectorsOutput, error) { - req, out := c.PutInsightSelectorsRequest(input) - return out, req.Send() -} - -// PutInsightSelectorsWithContext is the same as PutInsightSelectors with the addition of -// the ability to pass a context and additional request options. -// -// See PutInsightSelectors for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) PutInsightSelectorsWithContext(ctx aws.Context, input *PutInsightSelectorsInput, opts ...request.Option) (*PutInsightSelectorsOutput, error) { - req, out := c.PutInsightSelectorsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutResourcePolicy = "PutResourcePolicy" - -// PutResourcePolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutResourcePolicy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutResourcePolicy for more information on using the PutResourcePolicy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutResourcePolicyRequest method. -// req, resp := client.PutResourcePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutResourcePolicy -func (c *CloudTrail) PutResourcePolicyRequest(input *PutResourcePolicyInput) (req *request.Request, output *PutResourcePolicyOutput) { - op := &request.Operation{ - Name: opPutResourcePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutResourcePolicyInput{} - } - - output = &PutResourcePolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutResourcePolicy API operation for AWS CloudTrail. -// -// Attaches a resource-based permission policy to a CloudTrail channel that -// is used for an integration with an event source outside of Amazon Web Services. -// For more information about resource-based policies, see CloudTrail resource-based -// policy examples (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/security_iam_resource-based-policy-examples.html) -// in the CloudTrail User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation PutResourcePolicy for usage and error information. -// -// Returned Error Types: -// -// - ResourceARNNotValidException -// This exception is thrown when the provided resource does not exist, or the -// ARN format of the resource is not valid. The following is the valid format -// for a resource ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/MyChannel. -// -// - ResourcePolicyNotValidException -// This exception is thrown when the resouce-based policy has syntax errors, -// or contains a principal that is not valid. -// -// The following are requirements for the resource policy: -// -// - Contains only one action: cloudtrail-data:PutAuditEvents -// -// - Contains at least one statement. The policy can have a maximum of 20 -// statements. -// -// - Each statement contains at least one principal. A statement can have -// a maximum of 50 principals. -// -// - ResourceNotFoundException -// This exception is thrown when the specified resource is not found. -// -// - ResourceTypeNotSupportedException -// This exception is thrown when the specified resource type is not supported -// by CloudTrail. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/PutResourcePolicy -func (c *CloudTrail) PutResourcePolicy(input *PutResourcePolicyInput) (*PutResourcePolicyOutput, error) { - req, out := c.PutResourcePolicyRequest(input) - return out, req.Send() -} - -// PutResourcePolicyWithContext is the same as PutResourcePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See PutResourcePolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) PutResourcePolicyWithContext(ctx aws.Context, input *PutResourcePolicyInput, opts ...request.Option) (*PutResourcePolicyOutput, error) { - req, out := c.PutResourcePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRegisterOrganizationDelegatedAdmin = "RegisterOrganizationDelegatedAdmin" - -// RegisterOrganizationDelegatedAdminRequest generates a "aws/request.Request" representing the -// client's request for the RegisterOrganizationDelegatedAdmin operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RegisterOrganizationDelegatedAdmin for more information on using the RegisterOrganizationDelegatedAdmin -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the RegisterOrganizationDelegatedAdminRequest method. -// req, resp := client.RegisterOrganizationDelegatedAdminRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/RegisterOrganizationDelegatedAdmin -func (c *CloudTrail) RegisterOrganizationDelegatedAdminRequest(input *RegisterOrganizationDelegatedAdminInput) (req *request.Request, output *RegisterOrganizationDelegatedAdminOutput) { - op := &request.Operation{ - Name: opRegisterOrganizationDelegatedAdmin, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterOrganizationDelegatedAdminInput{} - } - - output = &RegisterOrganizationDelegatedAdminOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// RegisterOrganizationDelegatedAdmin API operation for AWS CloudTrail. -// -// Registers an organization’s member account as the CloudTrail delegated -// administrator. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation RegisterOrganizationDelegatedAdmin for usage and error information. -// -// Returned Error Types: -// -// - AccountRegisteredException -// This exception is thrown when the account is already registered as the CloudTrail -// delegated administrator. -// -// - AccountNotFoundException -// This exception is thrown when the specified account is not found or not part -// of an organization. -// -// - InsufficientDependencyServiceAccessPermissionException -// This exception is thrown when the IAM user or role that is used to create -// the organization resource lacks one or more required permissions for creating -// an organization resource in a required service. -// -// - InvalidParameterException -// The request includes a parameter that is not valid. -// -// - CannotDelegateManagementAccountException -// This exception is thrown when the management account of an organization is -// registered as the CloudTrail delegated administrator. -// -// - AccessNotEnabledException -// This exception is thrown when trusted access has not been enabled between -// CloudTrail and Organizations. For more information, see Enabling Trusted -// Access with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). -// -// - ConflictException -// This exception is thrown when the specified resource is not ready for an -// operation. This can occur when you try to run an operation on a resource -// before CloudTrail has time to fully load the resource, or because another -// operation is modifying the resource. If this exception occurs, wait a few -// minutes, and then try the operation again. -// -// - DelegatedAdminAccountLimitExceededException -// This exception is thrown when the maximum number of CloudTrail delegated -// administrators is reached. -// -// - NotOrganizationManagementAccountException -// This exception is thrown when the account making the request is not the organization's -// management account. -// -// - OrganizationNotInAllFeaturesModeException -// This exception is thrown when Organizations is not configured to support -// all features. All features must be enabled in Organizations to support creating -// an organization trail or event data store. -// -// - OrganizationsNotInUseException -// This exception is thrown when the request is made from an Amazon Web Services -// account that is not a member of an organization. To make this request, sign -// in using the credentials of an account that belongs to an organization. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/RegisterOrganizationDelegatedAdmin -func (c *CloudTrail) RegisterOrganizationDelegatedAdmin(input *RegisterOrganizationDelegatedAdminInput) (*RegisterOrganizationDelegatedAdminOutput, error) { - req, out := c.RegisterOrganizationDelegatedAdminRequest(input) - return out, req.Send() -} - -// RegisterOrganizationDelegatedAdminWithContext is the same as RegisterOrganizationDelegatedAdmin with the addition of -// the ability to pass a context and additional request options. -// -// See RegisterOrganizationDelegatedAdmin for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) RegisterOrganizationDelegatedAdminWithContext(ctx aws.Context, input *RegisterOrganizationDelegatedAdminInput, opts ...request.Option) (*RegisterOrganizationDelegatedAdminOutput, error) { - req, out := c.RegisterOrganizationDelegatedAdminRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRemoveTags = "RemoveTags" - -// RemoveTagsRequest generates a "aws/request.Request" representing the -// client's request for the RemoveTags operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RemoveTags for more information on using the RemoveTags -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the RemoveTagsRequest method. -// req, resp := client.RemoveTagsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/RemoveTags -func (c *CloudTrail) RemoveTagsRequest(input *RemoveTagsInput) (req *request.Request, output *RemoveTagsOutput) { - op := &request.Operation{ - Name: opRemoveTags, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveTagsInput{} - } - - output = &RemoveTagsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// RemoveTags API operation for AWS CloudTrail. -// -// Removes the specified tags from a trail, event data store, or channel. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation RemoveTags for usage and error information. -// -// Returned Error Types: -// -// - ResourceNotFoundException -// This exception is thrown when the specified resource is not found. -// -// - ARNInvalidException -// This exception is thrown when an operation is called with a trail ARN that -// is not valid. The following is the format of a trail ARN. -// -// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail -// -// This exception is also thrown when you call AddTags or RemoveTags on a trail, -// event data store, or channel with a resource ARN that is not valid. -// -// The following is the format of an event data store ARN: arn:aws:cloudtrail:us-east-2:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE -// -// The following is the format of a channel ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 -// -// - ResourceTypeNotSupportedException -// This exception is thrown when the specified resource type is not supported -// by CloudTrail. -// -// - InvalidTrailNameException -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// - Start with a letter or number, and end with a letter or number -// -// - Be between 3 and 128 characters -// -// - Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are not valid. -// -// - Not be in IP address format (for example, 192.168.5.4) -// -// - InvalidTagParameterException -// This exception is thrown when the specified tag key or values are not valid. -// It can also occur if there are duplicate tags or too many tags on the resource. -// -// - InactiveEventDataStoreException -// The event data store is inactive. -// -// - EventDataStoreNotFoundException -// The specified event data store was not found. -// -// - ChannelNotFoundException -// This exception is thrown when CloudTrail cannot find the specified channel. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - NotOrganizationMasterAccountException -// This exception is thrown when the Amazon Web Services account making the -// request to create or update an organization trail or event data store is -// not the management account for an organization in Organizations. For more -// information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/RemoveTags -func (c *CloudTrail) RemoveTags(input *RemoveTagsInput) (*RemoveTagsOutput, error) { - req, out := c.RemoveTagsRequest(input) - return out, req.Send() -} - -// RemoveTagsWithContext is the same as RemoveTags with the addition of -// the ability to pass a context and additional request options. -// -// See RemoveTags for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) RemoveTagsWithContext(ctx aws.Context, input *RemoveTagsInput, opts ...request.Option) (*RemoveTagsOutput, error) { - req, out := c.RemoveTagsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRestoreEventDataStore = "RestoreEventDataStore" - -// RestoreEventDataStoreRequest generates a "aws/request.Request" representing the -// client's request for the RestoreEventDataStore operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RestoreEventDataStore for more information on using the RestoreEventDataStore -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the RestoreEventDataStoreRequest method. -// req, resp := client.RestoreEventDataStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/RestoreEventDataStore -func (c *CloudTrail) RestoreEventDataStoreRequest(input *RestoreEventDataStoreInput) (req *request.Request, output *RestoreEventDataStoreOutput) { - op := &request.Operation{ - Name: opRestoreEventDataStore, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RestoreEventDataStoreInput{} - } - - output = &RestoreEventDataStoreOutput{} - req = c.newRequest(op, input, output) - return -} - -// RestoreEventDataStore API operation for AWS CloudTrail. -// -// Restores a deleted event data store specified by EventDataStore, which accepts -// an event data store ARN. You can only restore a deleted event data store -// within the seven-day wait period after deletion. Restoring an event data -// store can take several minutes, depending on the size of the event data store. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation RestoreEventDataStore for usage and error information. -// -// Returned Error Types: -// -// - EventDataStoreARNInvalidException -// The specified event data store ARN is not valid or does not map to an event -// data store in your account. -// -// - EventDataStoreNotFoundException -// The specified event data store was not found. -// -// - EventDataStoreMaxLimitExceededException -// Your account has used the maximum number of event data stores. -// -// - InvalidEventDataStoreStatusException -// The event data store is not in a status that supports the operation. -// -// - InvalidParameterException -// The request includes a parameter that is not valid. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - AccessNotEnabledException -// This exception is thrown when trusted access has not been enabled between -// CloudTrail and Organizations. For more information, see Enabling Trusted -// Access with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). -// -// - InsufficientDependencyServiceAccessPermissionException -// This exception is thrown when the IAM user or role that is used to create -// the organization resource lacks one or more required permissions for creating -// an organization resource in a required service. -// -// - OrganizationsNotInUseException -// This exception is thrown when the request is made from an Amazon Web Services -// account that is not a member of an organization. To make this request, sign -// in using the credentials of an account that belongs to an organization. -// -// - NotOrganizationMasterAccountException -// This exception is thrown when the Amazon Web Services account making the -// request to create or update an organization trail or event data store is -// not the management account for an organization in Organizations. For more -// information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// - OrganizationNotInAllFeaturesModeException -// This exception is thrown when Organizations is not configured to support -// all features. All features must be enabled in Organizations to support creating -// an organization trail or event data store. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/RestoreEventDataStore -func (c *CloudTrail) RestoreEventDataStore(input *RestoreEventDataStoreInput) (*RestoreEventDataStoreOutput, error) { - req, out := c.RestoreEventDataStoreRequest(input) - return out, req.Send() -} - -// RestoreEventDataStoreWithContext is the same as RestoreEventDataStore with the addition of -// the ability to pass a context and additional request options. -// -// See RestoreEventDataStore for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) RestoreEventDataStoreWithContext(ctx aws.Context, input *RestoreEventDataStoreInput, opts ...request.Option) (*RestoreEventDataStoreOutput, error) { - req, out := c.RestoreEventDataStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartImport = "StartImport" - -// StartImportRequest generates a "aws/request.Request" representing the -// client's request for the StartImport operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See StartImport for more information on using the StartImport -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the StartImportRequest method. -// req, resp := client.StartImportRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StartImport -func (c *CloudTrail) StartImportRequest(input *StartImportInput) (req *request.Request, output *StartImportOutput) { - op := &request.Operation{ - Name: opStartImport, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartImportInput{} - } - - output = &StartImportOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartImport API operation for AWS CloudTrail. -// -// Starts an import of logged trail events from a source S3 bucket to a destination -// event data store. By default, CloudTrail only imports events contained in -// the S3 bucket's CloudTrail prefix and the prefixes inside the CloudTrail -// prefix, and does not check prefixes for other Amazon Web Services services. -// If you want to import CloudTrail events contained in another prefix, you -// must include the prefix in the S3LocationUri. For more considerations about -// importing trail events, see Considerations (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-copy-trail-to-lake.html#cloudtrail-trail-copy-considerations). -// -// When you start a new import, the Destinations and ImportSource parameters -// are required. Before starting a new import, disable any access control lists -// (ACLs) attached to the source S3 bucket. For more information about disabling -// ACLs, see Controlling ownership of objects and disabling ACLs for your bucket -// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html). -// -// When you retry an import, the ImportID parameter is required. -// -// If the destination event data store is for an organization, you must use -// the management account to import trail events. You cannot use the delegated -// administrator account for the organization. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation StartImport for usage and error information. -// -// Returned Error Types: -// -// - AccountHasOngoingImportException -// This exception is thrown when you start a new import and a previous import -// is still in progress. -// -// - EventDataStoreARNInvalidException -// The specified event data store ARN is not valid or does not map to an event -// data store in your account. -// -// - EventDataStoreNotFoundException -// The specified event data store was not found. -// -// - InvalidEventDataStoreStatusException -// The event data store is not in a status that supports the operation. -// -// - InvalidEventDataStoreCategoryException -// This exception is thrown when event categories of specified event data stores -// are not valid. -// -// - InactiveEventDataStoreException -// The event data store is inactive. -// -// - InvalidImportSourceException -// This exception is thrown when the provided source S3 bucket is not valid -// for import. -// -// - ImportNotFoundException -// The specified import was not found. -// -// - InvalidParameterException -// The request includes a parameter that is not valid. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StartImport -func (c *CloudTrail) StartImport(input *StartImportInput) (*StartImportOutput, error) { - req, out := c.StartImportRequest(input) - return out, req.Send() -} - -// StartImportWithContext is the same as StartImport with the addition of -// the ability to pass a context and additional request options. -// -// See StartImport for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) StartImportWithContext(ctx aws.Context, input *StartImportInput, opts ...request.Option) (*StartImportOutput, error) { - req, out := c.StartImportRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartLogging = "StartLogging" - -// StartLoggingRequest generates a "aws/request.Request" representing the -// client's request for the StartLogging operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See StartLogging for more information on using the StartLogging -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the StartLoggingRequest method. -// req, resp := client.StartLoggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StartLogging -func (c *CloudTrail) StartLoggingRequest(input *StartLoggingInput) (req *request.Request, output *StartLoggingOutput) { - op := &request.Operation{ - Name: opStartLogging, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartLoggingInput{} - } - - output = &StartLoggingOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StartLogging API operation for AWS CloudTrail. -// -// Starts the recording of Amazon Web Services API calls and log file delivery -// for a trail. For a trail that is enabled in all regions, this operation must -// be called from the region in which the trail was created. This operation -// cannot be called on the shadow trails (replicated trails in other regions) -// of a trail that is enabled in all regions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation StartLogging for usage and error information. -// -// Returned Error Types: -// -// - ARNInvalidException -// This exception is thrown when an operation is called with a trail ARN that -// is not valid. The following is the format of a trail ARN. -// -// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail -// -// This exception is also thrown when you call AddTags or RemoveTags on a trail, -// event data store, or channel with a resource ARN that is not valid. -// -// The following is the format of an event data store ARN: arn:aws:cloudtrail:us-east-2:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE -// -// The following is the format of a channel ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 -// -// - ConflictException -// This exception is thrown when the specified resource is not ready for an -// operation. This can occur when you try to run an operation on a resource -// before CloudTrail has time to fully load the resource, or because another -// operation is modifying the resource. If this exception occurs, wait a few -// minutes, and then try the operation again. -// -// - TrailNotFoundException -// This exception is thrown when the trail with the given name is not found. -// -// - InvalidTrailNameException -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// - Start with a letter or number, and end with a letter or number -// -// - Be between 3 and 128 characters -// -// - Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are not valid. -// -// - Not be in IP address format (for example, 192.168.5.4) -// -// - InvalidHomeRegionException -// This exception is thrown when an operation is called on a trail from a region -// other than the region in which the trail was created. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - NotOrganizationMasterAccountException -// This exception is thrown when the Amazon Web Services account making the -// request to create or update an organization trail or event data store is -// not the management account for an organization in Organizations. For more -// information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// - InsufficientDependencyServiceAccessPermissionException -// This exception is thrown when the IAM user or role that is used to create -// the organization resource lacks one or more required permissions for creating -// an organization resource in a required service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StartLogging -func (c *CloudTrail) StartLogging(input *StartLoggingInput) (*StartLoggingOutput, error) { - req, out := c.StartLoggingRequest(input) - return out, req.Send() -} - -// StartLoggingWithContext is the same as StartLogging with the addition of -// the ability to pass a context and additional request options. -// -// See StartLogging for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) StartLoggingWithContext(ctx aws.Context, input *StartLoggingInput, opts ...request.Option) (*StartLoggingOutput, error) { - req, out := c.StartLoggingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStartQuery = "StartQuery" - -// StartQueryRequest generates a "aws/request.Request" representing the -// client's request for the StartQuery operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See StartQuery for more information on using the StartQuery -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the StartQueryRequest method. -// req, resp := client.StartQueryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StartQuery -func (c *CloudTrail) StartQueryRequest(input *StartQueryInput) (req *request.Request, output *StartQueryOutput) { - op := &request.Operation{ - Name: opStartQuery, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartQueryInput{} - } - - output = &StartQueryOutput{} - req = c.newRequest(op, input, output) - return -} - -// StartQuery API operation for AWS CloudTrail. -// -// Starts a CloudTrail Lake query. The required QueryStatement parameter provides -// your SQL query, enclosed in single quotation marks. Use the optional DeliveryS3Uri -// parameter to deliver the query results to an S3 bucket. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation StartQuery for usage and error information. -// -// Returned Error Types: -// -// - EventDataStoreARNInvalidException -// The specified event data store ARN is not valid or does not map to an event -// data store in your account. -// -// - EventDataStoreNotFoundException -// The specified event data store was not found. -// -// - InactiveEventDataStoreException -// The event data store is inactive. -// -// - InvalidParameterException -// The request includes a parameter that is not valid. -// -// - InvalidQueryStatementException -// The query that was submitted has validation errors, or uses incorrect syntax -// or unsupported keywords. For more information about writing a query, see -// Create or edit a query (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-create-edit-query.html) -// in the CloudTrail User Guide. -// -// - MaxConcurrentQueriesException -// You are already running the maximum number of concurrent queries. Wait a -// minute for some queries to finish, and then run the query again. -// -// - InsufficientEncryptionPolicyException -// This exception is thrown when the policy on the S3 bucket or KMS key does -// not have sufficient permissions for the operation. -// -// - InvalidS3PrefixException -// This exception is thrown when the provided S3 prefix is not valid. -// -// - InvalidS3BucketNameException -// This exception is thrown when the provided S3 bucket name is not valid. -// -// - InsufficientS3BucketPolicyException -// This exception is thrown when the policy on the S3 bucket is not sufficient. -// -// - S3BucketDoesNotExistException -// This exception is thrown when the specified S3 bucket does not exist. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StartQuery -func (c *CloudTrail) StartQuery(input *StartQueryInput) (*StartQueryOutput, error) { - req, out := c.StartQueryRequest(input) - return out, req.Send() -} - -// StartQueryWithContext is the same as StartQuery with the addition of -// the ability to pass a context and additional request options. -// -// See StartQuery for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) StartQueryWithContext(ctx aws.Context, input *StartQueryInput, opts ...request.Option) (*StartQueryOutput, error) { - req, out := c.StartQueryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopImport = "StopImport" - -// StopImportRequest generates a "aws/request.Request" representing the -// client's request for the StopImport operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See StopImport for more information on using the StopImport -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the StopImportRequest method. -// req, resp := client.StopImportRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StopImport -func (c *CloudTrail) StopImportRequest(input *StopImportInput) (req *request.Request, output *StopImportOutput) { - op := &request.Operation{ - Name: opStopImport, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StopImportInput{} - } - - output = &StopImportOutput{} - req = c.newRequest(op, input, output) - return -} - -// StopImport API operation for AWS CloudTrail. -// -// Stops a specified import. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation StopImport for usage and error information. -// -// Returned Error Types: -// -// - ImportNotFoundException -// The specified import was not found. -// -// - InvalidParameterException -// The request includes a parameter that is not valid. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StopImport -func (c *CloudTrail) StopImport(input *StopImportInput) (*StopImportOutput, error) { - req, out := c.StopImportRequest(input) - return out, req.Send() -} - -// StopImportWithContext is the same as StopImport with the addition of -// the ability to pass a context and additional request options. -// -// See StopImport for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) StopImportWithContext(ctx aws.Context, input *StopImportInput, opts ...request.Option) (*StopImportOutput, error) { - req, out := c.StopImportRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opStopLogging = "StopLogging" - -// StopLoggingRequest generates a "aws/request.Request" representing the -// client's request for the StopLogging operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See StopLogging for more information on using the StopLogging -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the StopLoggingRequest method. -// req, resp := client.StopLoggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StopLogging -func (c *CloudTrail) StopLoggingRequest(input *StopLoggingInput) (req *request.Request, output *StopLoggingOutput) { - op := &request.Operation{ - Name: opStopLogging, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StopLoggingInput{} - } - - output = &StopLoggingOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StopLogging API operation for AWS CloudTrail. -// -// Suspends the recording of Amazon Web Services API calls and log file delivery -// for the specified trail. Under most circumstances, there is no need to use -// this action. You can update a trail without stopping it first. This action -// is the only way to stop recording. For a trail enabled in all regions, this -// operation must be called from the region in which the trail was created, -// or an InvalidHomeRegionException will occur. This operation cannot be called -// on the shadow trails (replicated trails in other regions) of a trail enabled -// in all regions. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation StopLogging for usage and error information. -// -// Returned Error Types: -// -// - TrailNotFoundException -// This exception is thrown when the trail with the given name is not found. -// -// - InvalidTrailNameException -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// - Start with a letter or number, and end with a letter or number -// -// - Be between 3 and 128 characters -// -// - Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are not valid. -// -// - Not be in IP address format (for example, 192.168.5.4) -// -// - ARNInvalidException -// This exception is thrown when an operation is called with a trail ARN that -// is not valid. The following is the format of a trail ARN. -// -// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail -// -// This exception is also thrown when you call AddTags or RemoveTags on a trail, -// event data store, or channel with a resource ARN that is not valid. -// -// The following is the format of an event data store ARN: arn:aws:cloudtrail:us-east-2:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE -// -// The following is the format of a channel ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 -// -// - ConflictException -// This exception is thrown when the specified resource is not ready for an -// operation. This can occur when you try to run an operation on a resource -// before CloudTrail has time to fully load the resource, or because another -// operation is modifying the resource. If this exception occurs, wait a few -// minutes, and then try the operation again. -// -// - InvalidHomeRegionException -// This exception is thrown when an operation is called on a trail from a region -// other than the region in which the trail was created. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - NotOrganizationMasterAccountException -// This exception is thrown when the Amazon Web Services account making the -// request to create or update an organization trail or event data store is -// not the management account for an organization in Organizations. For more -// information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// - InsufficientDependencyServiceAccessPermissionException -// This exception is thrown when the IAM user or role that is used to create -// the organization resource lacks one or more required permissions for creating -// an organization resource in a required service. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/StopLogging -func (c *CloudTrail) StopLogging(input *StopLoggingInput) (*StopLoggingOutput, error) { - req, out := c.StopLoggingRequest(input) - return out, req.Send() -} - -// StopLoggingWithContext is the same as StopLogging with the addition of -// the ability to pass a context and additional request options. -// -// See StopLogging for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) StopLoggingWithContext(ctx aws.Context, input *StopLoggingInput, opts ...request.Option) (*StopLoggingOutput, error) { - req, out := c.StopLoggingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateChannel = "UpdateChannel" - -// UpdateChannelRequest generates a "aws/request.Request" representing the -// client's request for the UpdateChannel operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateChannel for more information on using the UpdateChannel -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the UpdateChannelRequest method. -// req, resp := client.UpdateChannelRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/UpdateChannel -func (c *CloudTrail) UpdateChannelRequest(input *UpdateChannelInput) (req *request.Request, output *UpdateChannelOutput) { - op := &request.Operation{ - Name: opUpdateChannel, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateChannelInput{} - } - - output = &UpdateChannelOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateChannel API operation for AWS CloudTrail. -// -// Updates a channel specified by a required channel ARN or UUID. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation UpdateChannel for usage and error information. -// -// Returned Error Types: -// -// - ChannelARNInvalidException -// This exception is thrown when the specified value of ChannelARN is not valid. -// -// - ChannelNotFoundException -// This exception is thrown when CloudTrail cannot find the specified channel. -// -// - ChannelAlreadyExistsException -// This exception is thrown when the provided channel already exists. -// -// - EventDataStoreARNInvalidException -// The specified event data store ARN is not valid or does not map to an event -// data store in your account. -// -// - EventDataStoreNotFoundException -// The specified event data store was not found. -// -// - InvalidEventDataStoreCategoryException -// This exception is thrown when event categories of specified event data stores -// are not valid. -// -// - InactiveEventDataStoreException -// The event data store is inactive. -// -// - InvalidParameterException -// The request includes a parameter that is not valid. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/UpdateChannel -func (c *CloudTrail) UpdateChannel(input *UpdateChannelInput) (*UpdateChannelOutput, error) { - req, out := c.UpdateChannelRequest(input) - return out, req.Send() -} - -// UpdateChannelWithContext is the same as UpdateChannel with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateChannel for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) UpdateChannelWithContext(ctx aws.Context, input *UpdateChannelInput, opts ...request.Option) (*UpdateChannelOutput, error) { - req, out := c.UpdateChannelRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateEventDataStore = "UpdateEventDataStore" - -// UpdateEventDataStoreRequest generates a "aws/request.Request" representing the -// client's request for the UpdateEventDataStore operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateEventDataStore for more information on using the UpdateEventDataStore -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the UpdateEventDataStoreRequest method. -// req, resp := client.UpdateEventDataStoreRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/UpdateEventDataStore -func (c *CloudTrail) UpdateEventDataStoreRequest(input *UpdateEventDataStoreInput) (req *request.Request, output *UpdateEventDataStoreOutput) { - op := &request.Operation{ - Name: opUpdateEventDataStore, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateEventDataStoreInput{} - } - - output = &UpdateEventDataStoreOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateEventDataStore API operation for AWS CloudTrail. -// -// Updates an event data store. The required EventDataStore value is an ARN -// or the ID portion of the ARN. Other parameters are optional, but at least -// one optional parameter must be specified, or CloudTrail throws an error. -// RetentionPeriod is in days, and valid values are integers between 90 and -// 2557. By default, TerminationProtection is enabled. -// -// For event data stores for CloudTrail events, AdvancedEventSelectors includes -// or excludes management and data events in your event data store. For more -// information about AdvancedEventSelectors, see PutEventSelectorsRequest$AdvancedEventSelectors. -// -// For event data stores for Config configuration items, Audit Manager evidence, -// or non-Amazon Web Services events, AdvancedEventSelectors includes events -// of that type in your event data store. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation UpdateEventDataStore for usage and error information. -// -// Returned Error Types: -// -// - EventDataStoreARNInvalidException -// The specified event data store ARN is not valid or does not map to an event -// data store in your account. -// -// - EventDataStoreNotFoundException -// The specified event data store was not found. -// -// - InvalidEventSelectorsException -// This exception is thrown when the PutEventSelectors operation is called with -// a number of event selectors, advanced event selectors, or data resources -// that is not valid. The combination of event selectors or advanced event selectors -// and data resources is not valid. A trail can have up to 5 event selectors. -// If a trail uses advanced event selectors, a maximum of 500 total values for -// all conditions in all advanced event selectors is allowed. A trail is limited -// to 250 data resources. These data resources can be distributed across event -// selectors, but the overall total cannot exceed 250. -// -// You can: -// -// - Specify a valid number of event selectors (1 to 5) for a trail. -// -// - Specify a valid number of data resources (1 to 250) for an event selector. -// The limit of number of resources on an individual event selector is configurable -// up to 250. However, this upper limit is allowed only if the total number -// of data resources does not exceed 250 across all event selectors for a -// trail. -// -// - Specify up to 500 values for all conditions in all advanced event selectors -// for a trail. -// -// - Specify a valid value for a parameter. For example, specifying the ReadWriteType -// parameter with a value of read-only is not valid. -// -// - EventDataStoreHasOngoingImportException -// This exception is thrown when you try to update or delete an event data store -// that currently has an import in progress. -// -// - InactiveEventDataStoreException -// The event data store is inactive. -// -// - InvalidParameterException -// The request includes a parameter that is not valid. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - InsufficientEncryptionPolicyException -// This exception is thrown when the policy on the S3 bucket or KMS key does -// not have sufficient permissions for the operation. -// -// - InvalidKmsKeyIdException -// This exception is thrown when the KMS key ARN is not valid. -// -// - KmsKeyNotFoundException -// This exception is thrown when the KMS key does not exist, when the S3 bucket -// and the KMS key are not in the same region, or when the KMS key associated -// with the Amazon SNS topic either does not exist or is not in the same region. -// -// - KmsException -// This exception is thrown when there is an issue with the specified KMS key -// and the trail or event data store can't be updated. -// -// - AccessNotEnabledException -// This exception is thrown when trusted access has not been enabled between -// CloudTrail and Organizations. For more information, see Enabling Trusted -// Access with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). -// -// - InsufficientDependencyServiceAccessPermissionException -// This exception is thrown when the IAM user or role that is used to create -// the organization resource lacks one or more required permissions for creating -// an organization resource in a required service. -// -// - OrganizationsNotInUseException -// This exception is thrown when the request is made from an Amazon Web Services -// account that is not a member of an organization. To make this request, sign -// in using the credentials of an account that belongs to an organization. -// -// - NotOrganizationMasterAccountException -// This exception is thrown when the Amazon Web Services account making the -// request to create or update an organization trail or event data store is -// not the management account for an organization in Organizations. For more -// information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// - OrganizationNotInAllFeaturesModeException -// This exception is thrown when Organizations is not configured to support -// all features. All features must be enabled in Organizations to support creating -// an organization trail or event data store. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/UpdateEventDataStore -func (c *CloudTrail) UpdateEventDataStore(input *UpdateEventDataStoreInput) (*UpdateEventDataStoreOutput, error) { - req, out := c.UpdateEventDataStoreRequest(input) - return out, req.Send() -} - -// UpdateEventDataStoreWithContext is the same as UpdateEventDataStore with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateEventDataStore for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) UpdateEventDataStoreWithContext(ctx aws.Context, input *UpdateEventDataStoreInput, opts ...request.Option) (*UpdateEventDataStoreOutput, error) { - req, out := c.UpdateEventDataStoreRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateTrail = "UpdateTrail" - -// UpdateTrailRequest generates a "aws/request.Request" representing the -// client's request for the UpdateTrail operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateTrail for more information on using the UpdateTrail -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the UpdateTrailRequest method. -// req, resp := client.UpdateTrailRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/UpdateTrail -func (c *CloudTrail) UpdateTrailRequest(input *UpdateTrailInput) (req *request.Request, output *UpdateTrailOutput) { - op := &request.Operation{ - Name: opUpdateTrail, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateTrailInput{} - } - - output = &UpdateTrailOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateTrail API operation for AWS CloudTrail. -// -// Updates trail settings that control what events you are logging, and how -// to handle log files. Changes to a trail do not require stopping the CloudTrail -// service. Use this action to designate an existing bucket for log delivery. -// If the existing bucket has previously been a target for CloudTrail log files, -// an IAM policy exists for the bucket. UpdateTrail must be called from the -// region in which the trail was created; otherwise, an InvalidHomeRegionException -// is thrown. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS CloudTrail's -// API operation UpdateTrail for usage and error information. -// -// Returned Error Types: -// -// - S3BucketDoesNotExistException -// This exception is thrown when the specified S3 bucket does not exist. -// -// - InsufficientS3BucketPolicyException -// This exception is thrown when the policy on the S3 bucket is not sufficient. -// -// - InsufficientSnsTopicPolicyException -// This exception is thrown when the policy on the Amazon SNS topic is not sufficient. -// -// - InsufficientEncryptionPolicyException -// This exception is thrown when the policy on the S3 bucket or KMS key does -// not have sufficient permissions for the operation. -// -// - TrailNotFoundException -// This exception is thrown when the trail with the given name is not found. -// -// - InvalidS3BucketNameException -// This exception is thrown when the provided S3 bucket name is not valid. -// -// - InvalidS3PrefixException -// This exception is thrown when the provided S3 prefix is not valid. -// -// - InvalidSnsTopicNameException -// This exception is thrown when the provided SNS topic name is not valid. -// -// - InvalidKmsKeyIdException -// This exception is thrown when the KMS key ARN is not valid. -// -// - InvalidTrailNameException -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// - Start with a letter or number, and end with a letter or number -// -// - Be between 3 and 128 characters -// -// - Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are not valid. -// -// - Not be in IP address format (for example, 192.168.5.4) -// -// - TrailNotProvidedException -// This exception is no longer in use. -// -// - InvalidEventSelectorsException -// This exception is thrown when the PutEventSelectors operation is called with -// a number of event selectors, advanced event selectors, or data resources -// that is not valid. The combination of event selectors or advanced event selectors -// and data resources is not valid. A trail can have up to 5 event selectors. -// If a trail uses advanced event selectors, a maximum of 500 total values for -// all conditions in all advanced event selectors is allowed. A trail is limited -// to 250 data resources. These data resources can be distributed across event -// selectors, but the overall total cannot exceed 250. -// -// You can: -// -// - Specify a valid number of event selectors (1 to 5) for a trail. -// -// - Specify a valid number of data resources (1 to 250) for an event selector. -// The limit of number of resources on an individual event selector is configurable -// up to 250. However, this upper limit is allowed only if the total number -// of data resources does not exceed 250 across all event selectors for a -// trail. -// -// - Specify up to 500 values for all conditions in all advanced event selectors -// for a trail. -// -// - Specify a valid value for a parameter. For example, specifying the ReadWriteType -// parameter with a value of read-only is not valid. -// -// - ARNInvalidException -// This exception is thrown when an operation is called with a trail ARN that -// is not valid. The following is the format of a trail ARN. -// -// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail -// -// This exception is also thrown when you call AddTags or RemoveTags on a trail, -// event data store, or channel with a resource ARN that is not valid. -// -// The following is the format of an event data store ARN: arn:aws:cloudtrail:us-east-2:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE -// -// The following is the format of a channel ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 -// -// - ConflictException -// This exception is thrown when the specified resource is not ready for an -// operation. This can occur when you try to run an operation on a resource -// before CloudTrail has time to fully load the resource, or because another -// operation is modifying the resource. If this exception occurs, wait a few -// minutes, and then try the operation again. -// -// - InvalidParameterCombinationException -// This exception is thrown when the combination of parameters provided is not -// valid. -// -// - InvalidHomeRegionException -// This exception is thrown when an operation is called on a trail from a region -// other than the region in which the trail was created. -// -// - KmsKeyNotFoundException -// This exception is thrown when the KMS key does not exist, when the S3 bucket -// and the KMS key are not in the same region, or when the KMS key associated -// with the Amazon SNS topic either does not exist or is not in the same region. -// -// - KmsKeyDisabledException -// This exception is no longer in use. -// -// - KmsException -// This exception is thrown when there is an issue with the specified KMS key -// and the trail or event data store can't be updated. -// -// - InvalidCloudWatchLogsLogGroupArnException -// This exception is thrown when the provided CloudWatch Logs log group is not -// valid. -// -// - InvalidCloudWatchLogsRoleArnException -// This exception is thrown when the provided role is not valid. -// -// - CloudWatchLogsDeliveryUnavailableException -// Cannot set a CloudWatch Logs delivery for this region. -// -// - UnsupportedOperationException -// This exception is thrown when the requested operation is not supported. -// -// - OperationNotPermittedException -// This exception is thrown when the requested operation is not permitted. -// -// - AccessNotEnabledException -// This exception is thrown when trusted access has not been enabled between -// CloudTrail and Organizations. For more information, see Enabling Trusted -// Access with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). -// -// - InsufficientDependencyServiceAccessPermissionException -// This exception is thrown when the IAM user or role that is used to create -// the organization resource lacks one or more required permissions for creating -// an organization resource in a required service. -// -// - OrganizationsNotInUseException -// This exception is thrown when the request is made from an Amazon Web Services -// account that is not a member of an organization. To make this request, sign -// in using the credentials of an account that belongs to an organization. -// -// - NotOrganizationMasterAccountException -// This exception is thrown when the Amazon Web Services account making the -// request to create or update an organization trail or event data store is -// not the management account for an organization in Organizations. For more -// information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). -// -// - OrganizationNotInAllFeaturesModeException -// This exception is thrown when Organizations is not configured to support -// all features. All features must be enabled in Organizations to support creating -// an organization trail or event data store. -// -// - NoManagementAccountSLRExistsException -// This exception is thrown when the management account does not have a service-linked -// role. -// -// - CloudTrailInvalidClientTokenIdException -// This exception is thrown when a call results in the InvalidClientTokenId -// error code. This can occur when you are creating or updating a trail to send -// notifications to an Amazon SNS topic that is in a suspended Amazon Web Services -// account. -// -// - InvalidParameterException -// The request includes a parameter that is not valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01/UpdateTrail -func (c *CloudTrail) UpdateTrail(input *UpdateTrailInput) (*UpdateTrailOutput, error) { - req, out := c.UpdateTrailRequest(input) - return out, req.Send() -} - -// UpdateTrailWithContext is the same as UpdateTrail with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateTrail for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *CloudTrail) UpdateTrailWithContext(ctx aws.Context, input *UpdateTrailInput, opts ...request.Option) (*UpdateTrailOutput, error) { - req, out := c.UpdateTrailRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// This exception is thrown when an operation is called with a trail ARN that -// is not valid. The following is the format of a trail ARN. -// -// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail -// -// This exception is also thrown when you call AddTags or RemoveTags on a trail, -// event data store, or channel with a resource ARN that is not valid. -// -// The following is the format of an event data store ARN: arn:aws:cloudtrail:us-east-2:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE -// -// The following is the format of a channel ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 -type ARNInvalidException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ARNInvalidException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ARNInvalidException) GoString() string { - return s.String() -} - -func newErrorARNInvalidException(v protocol.ResponseMetadata) error { - return &ARNInvalidException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ARNInvalidException) Code() string { - return "CloudTrailARNInvalidException" -} - -// Message returns the exception's message. -func (s *ARNInvalidException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ARNInvalidException) OrigErr() error { - return nil -} - -func (s *ARNInvalidException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ARNInvalidException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ARNInvalidException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when trusted access has not been enabled between -// CloudTrail and Organizations. For more information, see Enabling Trusted -// Access with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). -type AccessNotEnabledException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccessNotEnabledException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccessNotEnabledException) GoString() string { - return s.String() -} - -func newErrorAccessNotEnabledException(v protocol.ResponseMetadata) error { - return &AccessNotEnabledException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessNotEnabledException) Code() string { - return "CloudTrailAccessNotEnabledException" -} - -// Message returns the exception's message. -func (s *AccessNotEnabledException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessNotEnabledException) OrigErr() error { - return nil -} - -func (s *AccessNotEnabledException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessNotEnabledException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessNotEnabledException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when you start a new import and a previous import -// is still in progress. -type AccountHasOngoingImportException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccountHasOngoingImportException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccountHasOngoingImportException) GoString() string { - return s.String() -} - -func newErrorAccountHasOngoingImportException(v protocol.ResponseMetadata) error { - return &AccountHasOngoingImportException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccountHasOngoingImportException) Code() string { - return "AccountHasOngoingImportException" -} - -// Message returns the exception's message. -func (s *AccountHasOngoingImportException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccountHasOngoingImportException) OrigErr() error { - return nil -} - -func (s *AccountHasOngoingImportException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccountHasOngoingImportException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccountHasOngoingImportException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the specified account is not found or not part -// of an organization. -type AccountNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccountNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccountNotFoundException) GoString() string { - return s.String() -} - -func newErrorAccountNotFoundException(v protocol.ResponseMetadata) error { - return &AccountNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccountNotFoundException) Code() string { - return "AccountNotFoundException" -} - -// Message returns the exception's message. -func (s *AccountNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccountNotFoundException) OrigErr() error { - return nil -} - -func (s *AccountNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccountNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccountNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the specified account is not registered as -// the CloudTrail delegated administrator. -type AccountNotRegisteredException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccountNotRegisteredException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccountNotRegisteredException) GoString() string { - return s.String() -} - -func newErrorAccountNotRegisteredException(v protocol.ResponseMetadata) error { - return &AccountNotRegisteredException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccountNotRegisteredException) Code() string { - return "AccountNotRegisteredException" -} - -// Message returns the exception's message. -func (s *AccountNotRegisteredException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccountNotRegisteredException) OrigErr() error { - return nil -} - -func (s *AccountNotRegisteredException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccountNotRegisteredException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccountNotRegisteredException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the account is already registered as the CloudTrail -// delegated administrator. -type AccountRegisteredException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccountRegisteredException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccountRegisteredException) GoString() string { - return s.String() -} - -func newErrorAccountRegisteredException(v protocol.ResponseMetadata) error { - return &AccountRegisteredException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccountRegisteredException) Code() string { - return "AccountRegisteredException" -} - -// Message returns the exception's message. -func (s *AccountRegisteredException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccountRegisteredException) OrigErr() error { - return nil -} - -func (s *AccountRegisteredException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccountRegisteredException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccountRegisteredException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Specifies the tags to add to a trail, event data store, or channel. -type AddTagsInput struct { - _ struct{} `type:"structure"` - - // Specifies the ARN of the trail, event data store, or channel to which one - // or more tags will be added. - // - // The format of a trail ARN is: arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail - // - // The format of an event data store ARN is: arn:aws:cloudtrail:us-east-2:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE - // - // The format of a channel ARN is: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 - // - // ResourceId is a required field - ResourceId *string `type:"string" required:"true"` - - // Contains a list of tags, up to a limit of 50 - // - // TagsList is a required field - TagsList []*Tag `type:"list" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AddTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AddTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AddTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AddTagsInput"} - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.TagsList == nil { - invalidParams.Add(request.NewErrParamRequired("TagsList")) - } - if s.TagsList != nil { - for i, v := range s.TagsList { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagsList", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceId sets the ResourceId field's value. -func (s *AddTagsInput) SetResourceId(v string) *AddTagsInput { - s.ResourceId = &v - return s -} - -// SetTagsList sets the TagsList field's value. -func (s *AddTagsInput) SetTagsList(v []*Tag) *AddTagsInput { - s.TagsList = v - return s -} - -// Returns the objects or data if successful. Otherwise, returns an error. -type AddTagsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AddTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AddTagsOutput) GoString() string { - return s.String() -} - -// Advanced event selectors let you create fine-grained selectors for the following -// CloudTrail event record fields. They help you control costs by logging only -// those events that are important to you. For more information about advanced -// event selectors, see Logging data events for trails (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html) -// in the CloudTrail User Guide. -// -// - readOnly -// -// - eventSource -// -// - eventName -// -// - eventCategory -// -// - resources.type -// -// - resources.ARN -// -// You cannot apply both event selectors and advanced event selectors to a trail. -type AdvancedEventSelector struct { - _ struct{} `type:"structure"` - - // Contains all selector statements in an advanced event selector. - // - // FieldSelectors is a required field - FieldSelectors []*AdvancedFieldSelector `min:"1" type:"list" required:"true"` - - // An optional, descriptive name for an advanced event selector, such as "Log - // data events for only two S3 buckets". - Name *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AdvancedEventSelector) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AdvancedEventSelector) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AdvancedEventSelector) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AdvancedEventSelector"} - if s.FieldSelectors == nil { - invalidParams.Add(request.NewErrParamRequired("FieldSelectors")) - } - if s.FieldSelectors != nil && len(s.FieldSelectors) < 1 { - invalidParams.Add(request.NewErrParamMinLen("FieldSelectors", 1)) - } - if s.FieldSelectors != nil { - for i, v := range s.FieldSelectors { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "FieldSelectors", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFieldSelectors sets the FieldSelectors field's value. -func (s *AdvancedEventSelector) SetFieldSelectors(v []*AdvancedFieldSelector) *AdvancedEventSelector { - s.FieldSelectors = v - return s -} - -// SetName sets the Name field's value. -func (s *AdvancedEventSelector) SetName(v string) *AdvancedEventSelector { - s.Name = &v - return s -} - -// A single selector statement in an advanced event selector. -type AdvancedFieldSelector struct { - _ struct{} `type:"structure"` - - // An operator that includes events that match the last few characters of the - // event record field specified as the value of Field. - EndsWith []*string `min:"1" type:"list"` - - // An operator that includes events that match the exact value of the event - // record field specified as the value of Field. This is the only valid operator - // that you can use with the readOnly, eventCategory, and resources.type fields. - Equals []*string `min:"1" type:"list"` - - // A field in a CloudTrail event record on which to filter events to be logged. - // For event data stores for Config configuration items, Audit Manager evidence, - // or non-Amazon Web Services events, the field is used only for selecting events - // as filtering is not supported. - // - // For CloudTrail event records, supported fields include readOnly, eventCategory, - // eventSource (for management events), eventName, resources.type, and resources.ARN. - // - // For event data stores for Config configuration items, Audit Manager evidence, - // or non-Amazon Web Services events, the only supported field is eventCategory. - // - // * readOnly - Optional. Can be set to Equals a value of true or false. - // If you do not add this field, CloudTrail logs both read and write events. - // A value of true logs only read events. A value of false logs only write - // events. - // - // * eventSource - For filtering management events only. This can be set - // only to NotEquals kms.amazonaws.com. - // - // * eventName - Can use any operator. You can use it to filter in or filter - // out any data event logged to CloudTrail, such as PutBucket or GetSnapshotBlock. - // You can have multiple values for this field, separated by commas. - // - // * eventCategory - This is required and must be set to Equals. For CloudTrail - // event records, the value must be Management or Data. For Config configuration - // items, the value must be ConfigurationItem. For Audit Manager evidence, - // the value must be Evidence. For non-Amazon Web Services events, the value - // must be ActivityAuditLog. - // - // * resources.type - This field is required for CloudTrail data events. - // resources.type can only use the Equals operator, and the value can be - // one of the following: AWS::CloudTrail::Channel AWS::S3::Object AWS::Lambda::Function - // AWS::DynamoDB::Table AWS::S3Outposts::Object AWS::ManagedBlockchain::Node - // AWS::S3ObjectLambda::AccessPoint AWS::EC2::Snapshot AWS::S3::AccessPoint - // AWS::DynamoDB::Stream AWS::Glue::Table AWS::FinSpace::Environment AWS::SageMaker::ExperimentTrialComponent - // AWS::SageMaker::FeatureGroup You can have only one resources.type field - // per selector. To log data events on more than one resource type, add another - // selector. - // - // * resources.ARN - You can use any operator with resources.ARN, but if - // you use Equals or NotEquals, the value must exactly match the ARN of a - // valid resource of the type you've specified in the template as the value - // of resources.type. For example, if resources.type equals AWS::S3::Object, - // the ARN must be in one of the following formats. To log all data events - // for all objects in a specific S3 bucket, use the StartsWith operator, - // and include only the bucket ARN as the matching value. The trailing slash - // is intentional; do not exclude it. Replace the text between less than - // and greater than symbols (<>) with resource-specific information. arn::s3:::/ - // arn::s3:::// When resources.type - // equals AWS::S3::AccessPoint, and the operator is set to Equals or NotEquals, - // the ARN must be in one of the following formats. To log events on all - // objects in an S3 access point, we recommend that you use only the access - // point ARN, don’t include the object path, and use the StartsWith or - // NotStartsWith operators. arn::s3:::accesspoint/ - // arn::s3:::accesspoint//object/ - // When resources.type equals AWS::Lambda::Function, and the operator is - // set to Equals or NotEquals, the ARN must be in the following format: arn::lambda:::function: - // When resources.type equals AWS::DynamoDB::Table, and the operator is set - // to Equals or NotEquals, the ARN must be in the following format: arn::dynamodb:::table/ - // When resources.type equals AWS::CloudTrail::Channel, and the operator - // is set to Equals or NotEquals, the ARN must be in the following format: - // arn::cloudtrail:::channel/ - // When resources.type equals AWS::S3Outposts::Object, and the operator is - // set to Equals or NotEquals, the ARN must be in the following format: arn::s3-outposts::: - // When resources.type equals AWS::ManagedBlockchain::Node, and the operator - // is set to Equals or NotEquals, the ARN must be in the following format: - // arn::managedblockchain:::nodes/ - // When resources.type equals AWS::S3ObjectLambda::AccessPoint, and the operator - // is set to Equals or NotEquals, the ARN must be in the following format: - // arn::s3-object-lambda:::accesspoint/ - // When resources.type equals AWS::EC2::Snapshot, and the operator is set - // to Equals or NotEquals, the ARN must be in the following format: arn::ec2:::snapshot/ - // When resources.type equals AWS::DynamoDB::Stream, and the operator is - // set to Equals or NotEquals, the ARN must be in the following format: arn::dynamodb:::table//stream/ - // When resources.type equals AWS::Glue::Table, and the operator is set to - // Equals or NotEquals, the ARN must be in the following format: arn::glue:::table// - // When resources.type equals AWS::FinSpace::Environment, and the operator - // is set to Equals or NotEquals, the ARN must be in the following format: - // arn::finspace:::environment/ - // When resources.type equals AWS::SageMaker::ExperimentTrialComponent, and - // the operator is set to Equals or NotEquals, the ARN must be in the following - // format: arn::sagemaker:::experiment-trial-component/ - // When resources.type equals AWS::SageMaker::FeatureGroup, and the operator - // is set to Equals or NotEquals, the ARN must be in the following format: - // arn::sagemaker:::feature-group/ - // - // Field is a required field - Field *string `min:"1" type:"string" required:"true"` - - // An operator that excludes events that match the last few characters of the - // event record field specified as the value of Field. - NotEndsWith []*string `min:"1" type:"list"` - - // An operator that excludes events that match the exact value of the event - // record field specified as the value of Field. - NotEquals []*string `min:"1" type:"list"` - - // An operator that excludes events that match the first few characters of the - // event record field specified as the value of Field. - NotStartsWith []*string `min:"1" type:"list"` - - // An operator that includes events that match the first few characters of the - // event record field specified as the value of Field. - StartsWith []*string `min:"1" type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AdvancedFieldSelector) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AdvancedFieldSelector) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AdvancedFieldSelector) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AdvancedFieldSelector"} - if s.EndsWith != nil && len(s.EndsWith) < 1 { - invalidParams.Add(request.NewErrParamMinLen("EndsWith", 1)) - } - if s.Equals != nil && len(s.Equals) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Equals", 1)) - } - if s.Field == nil { - invalidParams.Add(request.NewErrParamRequired("Field")) - } - if s.Field != nil && len(*s.Field) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Field", 1)) - } - if s.NotEndsWith != nil && len(s.NotEndsWith) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NotEndsWith", 1)) - } - if s.NotEquals != nil && len(s.NotEquals) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NotEquals", 1)) - } - if s.NotStartsWith != nil && len(s.NotStartsWith) < 1 { - invalidParams.Add(request.NewErrParamMinLen("NotStartsWith", 1)) - } - if s.StartsWith != nil && len(s.StartsWith) < 1 { - invalidParams.Add(request.NewErrParamMinLen("StartsWith", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndsWith sets the EndsWith field's value. -func (s *AdvancedFieldSelector) SetEndsWith(v []*string) *AdvancedFieldSelector { - s.EndsWith = v - return s -} - -// SetEquals sets the Equals field's value. -func (s *AdvancedFieldSelector) SetEquals(v []*string) *AdvancedFieldSelector { - s.Equals = v - return s -} - -// SetField sets the Field field's value. -func (s *AdvancedFieldSelector) SetField(v string) *AdvancedFieldSelector { - s.Field = &v - return s -} - -// SetNotEndsWith sets the NotEndsWith field's value. -func (s *AdvancedFieldSelector) SetNotEndsWith(v []*string) *AdvancedFieldSelector { - s.NotEndsWith = v - return s -} - -// SetNotEquals sets the NotEquals field's value. -func (s *AdvancedFieldSelector) SetNotEquals(v []*string) *AdvancedFieldSelector { - s.NotEquals = v - return s -} - -// SetNotStartsWith sets the NotStartsWith field's value. -func (s *AdvancedFieldSelector) SetNotStartsWith(v []*string) *AdvancedFieldSelector { - s.NotStartsWith = v - return s -} - -// SetStartsWith sets the StartsWith field's value. -func (s *AdvancedFieldSelector) SetStartsWith(v []*string) *AdvancedFieldSelector { - s.StartsWith = v - return s -} - -type CancelQueryInput struct { - _ struct{} `type:"structure"` - - // The ARN (or the ID suffix of the ARN) of an event data store on which the - // specified query is running. - // - // Deprecated: EventDataStore is no longer required by CancelQueryRequest - EventDataStore *string `min:"3" deprecated:"true" type:"string"` - - // The ID of the query that you want to cancel. The QueryId comes from the response - // of a StartQuery operation. - // - // QueryId is a required field - QueryId *string `min:"36" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CancelQueryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CancelQueryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelQueryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelQueryInput"} - if s.EventDataStore != nil && len(*s.EventDataStore) < 3 { - invalidParams.Add(request.NewErrParamMinLen("EventDataStore", 3)) - } - if s.QueryId == nil { - invalidParams.Add(request.NewErrParamRequired("QueryId")) - } - if s.QueryId != nil && len(*s.QueryId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("QueryId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEventDataStore sets the EventDataStore field's value. -func (s *CancelQueryInput) SetEventDataStore(v string) *CancelQueryInput { - s.EventDataStore = &v - return s -} - -// SetQueryId sets the QueryId field's value. -func (s *CancelQueryInput) SetQueryId(v string) *CancelQueryInput { - s.QueryId = &v - return s -} - -type CancelQueryOutput struct { - _ struct{} `type:"structure"` - - // The ID of the canceled query. - // - // QueryId is a required field - QueryId *string `min:"36" type:"string" required:"true"` - - // Shows the status of a query after a CancelQuery request. Typically, the values - // shown are either RUNNING or CANCELLED. - // - // QueryStatus is a required field - QueryStatus *string `type:"string" required:"true" enum:"QueryStatus"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CancelQueryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CancelQueryOutput) GoString() string { - return s.String() -} - -// SetQueryId sets the QueryId field's value. -func (s *CancelQueryOutput) SetQueryId(v string) *CancelQueryOutput { - s.QueryId = &v - return s -} - -// SetQueryStatus sets the QueryStatus field's value. -func (s *CancelQueryOutput) SetQueryStatus(v string) *CancelQueryOutput { - s.QueryStatus = &v - return s -} - -// This exception is thrown when the management account of an organization is -// registered as the CloudTrail delegated administrator. -type CannotDelegateManagementAccountException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CannotDelegateManagementAccountException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CannotDelegateManagementAccountException) GoString() string { - return s.String() -} - -func newErrorCannotDelegateManagementAccountException(v protocol.ResponseMetadata) error { - return &CannotDelegateManagementAccountException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *CannotDelegateManagementAccountException) Code() string { - return "CannotDelegateManagementAccountException" -} - -// Message returns the exception's message. -func (s *CannotDelegateManagementAccountException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *CannotDelegateManagementAccountException) OrigErr() error { - return nil -} - -func (s *CannotDelegateManagementAccountException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *CannotDelegateManagementAccountException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *CannotDelegateManagementAccountException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains information about a returned CloudTrail channel. -type Channel struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of a channel. - ChannelArn *string `min:"3" type:"string"` - - // The name of the CloudTrail channel. For service-linked channels, the name - // is aws-service-channel/service-name/custom-suffix where service-name represents - // the name of the Amazon Web Services service that created the channel and - // custom-suffix represents the suffix created by the Amazon Web Services service. - Name *string `min:"3" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Channel) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Channel) GoString() string { - return s.String() -} - -// SetChannelArn sets the ChannelArn field's value. -func (s *Channel) SetChannelArn(v string) *Channel { - s.ChannelArn = &v - return s -} - -// SetName sets the Name field's value. -func (s *Channel) SetName(v string) *Channel { - s.Name = &v - return s -} - -// This exception is thrown when the specified value of ChannelARN is not valid. -type ChannelARNInvalidException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ChannelARNInvalidException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ChannelARNInvalidException) GoString() string { - return s.String() -} - -func newErrorChannelARNInvalidException(v protocol.ResponseMetadata) error { - return &ChannelARNInvalidException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ChannelARNInvalidException) Code() string { - return "ChannelARNInvalidException" -} - -// Message returns the exception's message. -func (s *ChannelARNInvalidException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ChannelARNInvalidException) OrigErr() error { - return nil -} - -func (s *ChannelARNInvalidException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ChannelARNInvalidException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ChannelARNInvalidException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the provided channel already exists. -type ChannelAlreadyExistsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ChannelAlreadyExistsException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ChannelAlreadyExistsException) GoString() string { - return s.String() -} - -func newErrorChannelAlreadyExistsException(v protocol.ResponseMetadata) error { - return &ChannelAlreadyExistsException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ChannelAlreadyExistsException) Code() string { - return "ChannelAlreadyExistsException" -} - -// Message returns the exception's message. -func (s *ChannelAlreadyExistsException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ChannelAlreadyExistsException) OrigErr() error { - return nil -} - -func (s *ChannelAlreadyExistsException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ChannelAlreadyExistsException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ChannelAlreadyExistsException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the specified event data store cannot yet be -// deleted because it is in use by a channel. -type ChannelExistsForEDSException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ChannelExistsForEDSException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ChannelExistsForEDSException) GoString() string { - return s.String() -} - -func newErrorChannelExistsForEDSException(v protocol.ResponseMetadata) error { - return &ChannelExistsForEDSException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ChannelExistsForEDSException) Code() string { - return "ChannelExistsForEDSException" -} - -// Message returns the exception's message. -func (s *ChannelExistsForEDSException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ChannelExistsForEDSException) OrigErr() error { - return nil -} - -func (s *ChannelExistsForEDSException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ChannelExistsForEDSException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ChannelExistsForEDSException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the maximum number of channels limit is exceeded. -type ChannelMaxLimitExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ChannelMaxLimitExceededException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ChannelMaxLimitExceededException) GoString() string { - return s.String() -} - -func newErrorChannelMaxLimitExceededException(v protocol.ResponseMetadata) error { - return &ChannelMaxLimitExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ChannelMaxLimitExceededException) Code() string { - return "ChannelMaxLimitExceededException" -} - -// Message returns the exception's message. -func (s *ChannelMaxLimitExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ChannelMaxLimitExceededException) OrigErr() error { - return nil -} - -func (s *ChannelMaxLimitExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ChannelMaxLimitExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ChannelMaxLimitExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when CloudTrail cannot find the specified channel. -type ChannelNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ChannelNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ChannelNotFoundException) GoString() string { - return s.String() -} - -func newErrorChannelNotFoundException(v protocol.ResponseMetadata) error { - return &ChannelNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ChannelNotFoundException) Code() string { - return "ChannelNotFoundException" -} - -// Message returns the exception's message. -func (s *ChannelNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ChannelNotFoundException) OrigErr() error { - return nil -} - -func (s *ChannelNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ChannelNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ChannelNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when a call results in the InvalidClientTokenId -// error code. This can occur when you are creating or updating a trail to send -// notifications to an Amazon SNS topic that is in a suspended Amazon Web Services -// account. -type CloudTrailInvalidClientTokenIdException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CloudTrailInvalidClientTokenIdException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CloudTrailInvalidClientTokenIdException) GoString() string { - return s.String() -} - -func newErrorCloudTrailInvalidClientTokenIdException(v protocol.ResponseMetadata) error { - return &CloudTrailInvalidClientTokenIdException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *CloudTrailInvalidClientTokenIdException) Code() string { - return "CloudTrailInvalidClientTokenIdException" -} - -// Message returns the exception's message. -func (s *CloudTrailInvalidClientTokenIdException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *CloudTrailInvalidClientTokenIdException) OrigErr() error { - return nil -} - -func (s *CloudTrailInvalidClientTokenIdException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *CloudTrailInvalidClientTokenIdException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *CloudTrailInvalidClientTokenIdException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Cannot set a CloudWatch Logs delivery for this region. -type CloudWatchLogsDeliveryUnavailableException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CloudWatchLogsDeliveryUnavailableException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CloudWatchLogsDeliveryUnavailableException) GoString() string { - return s.String() -} - -func newErrorCloudWatchLogsDeliveryUnavailableException(v protocol.ResponseMetadata) error { - return &CloudWatchLogsDeliveryUnavailableException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *CloudWatchLogsDeliveryUnavailableException) Code() string { - return "CloudWatchLogsDeliveryUnavailableException" -} - -// Message returns the exception's message. -func (s *CloudWatchLogsDeliveryUnavailableException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *CloudWatchLogsDeliveryUnavailableException) OrigErr() error { - return nil -} - -func (s *CloudWatchLogsDeliveryUnavailableException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *CloudWatchLogsDeliveryUnavailableException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *CloudWatchLogsDeliveryUnavailableException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the specified resource is not ready for an -// operation. This can occur when you try to run an operation on a resource -// before CloudTrail has time to fully load the resource, or because another -// operation is modifying the resource. If this exception occurs, wait a few -// minutes, and then try the operation again. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ConflictException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateChannelInput struct { - _ struct{} `type:"structure"` - - // One or more event data stores to which events arriving through a channel - // will be logged. - // - // Destinations is a required field - Destinations []*Destination `min:"1" type:"list" required:"true"` - - // The name of the channel. - // - // Name is a required field - Name *string `min:"3" type:"string" required:"true"` - - // The name of the partner or external event source. You cannot change this - // name after you create the channel. A maximum of one channel is allowed per - // source. - // - // A source can be either Custom for all valid non-Amazon Web Services events, - // or the name of a partner event source. For information about the source names - // for available partners, see Additional information about integration partners - // (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store-integration.html#cloudtrail-lake-partner-information) - // in the CloudTrail User Guide. - // - // Source is a required field - Source *string `min:"1" type:"string" required:"true"` - - // A list of tags. - Tags []*Tag `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateChannelInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateChannelInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateChannelInput"} - if s.Destinations == nil { - invalidParams.Add(request.NewErrParamRequired("Destinations")) - } - if s.Destinations != nil && len(s.Destinations) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Destinations", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Source == nil { - invalidParams.Add(request.NewErrParamRequired("Source")) - } - if s.Source != nil && len(*s.Source) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Source", 1)) - } - if s.Destinations != nil { - for i, v := range s.Destinations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Destinations", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestinations sets the Destinations field's value. -func (s *CreateChannelInput) SetDestinations(v []*Destination) *CreateChannelInput { - s.Destinations = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateChannelInput) SetName(v string) *CreateChannelInput { - s.Name = &v - return s -} - -// SetSource sets the Source field's value. -func (s *CreateChannelInput) SetSource(v string) *CreateChannelInput { - s.Source = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateChannelInput) SetTags(v []*Tag) *CreateChannelInput { - s.Tags = v - return s -} - -type CreateChannelOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the new channel. - ChannelArn *string `min:"3" type:"string"` - - // The event data stores that log the events arriving through the channel. - Destinations []*Destination `min:"1" type:"list"` - - // The name of the new channel. - Name *string `min:"3" type:"string"` - - // The partner or external event source name. - Source *string `min:"1" type:"string"` - - // A list of tags. - Tags []*Tag `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateChannelOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateChannelOutput) GoString() string { - return s.String() -} - -// SetChannelArn sets the ChannelArn field's value. -func (s *CreateChannelOutput) SetChannelArn(v string) *CreateChannelOutput { - s.ChannelArn = &v - return s -} - -// SetDestinations sets the Destinations field's value. -func (s *CreateChannelOutput) SetDestinations(v []*Destination) *CreateChannelOutput { - s.Destinations = v - return s -} - -// SetName sets the Name field's value. -func (s *CreateChannelOutput) SetName(v string) *CreateChannelOutput { - s.Name = &v - return s -} - -// SetSource sets the Source field's value. -func (s *CreateChannelOutput) SetSource(v string) *CreateChannelOutput { - s.Source = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateChannelOutput) SetTags(v []*Tag) *CreateChannelOutput { - s.Tags = v - return s -} - -type CreateEventDataStoreInput struct { - _ struct{} `type:"structure"` - - // The advanced event selectors to use to select the events for the data store. - // You can configure up to five advanced event selectors for each event data - // store. - // - // For more information about how to use advanced event selectors to log CloudTrail - // events, see Log events by using advanced event selectors (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html#creating-data-event-selectors-advanced) - // in the CloudTrail User Guide. - // - // For more information about how to use advanced event selectors to include - // Config configuration items in your event data store, see Create an event - // data store for Config configuration items (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-lake-cli.html#lake-cli-create-eds-config) - // in the CloudTrail User Guide. - // - // For more information about how to use advanced event selectors to include - // non-Amazon Web Services events in your event data store, see Create an integration - // to log events from outside Amazon Web Services (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-lake-cli.html#lake-cli-create-integration) - // in the CloudTrail User Guide. - AdvancedEventSelectors []*AdvancedEventSelector `type:"list"` - - // Specifies the KMS key ID to use to encrypt the events delivered by CloudTrail. - // The value can be an alias name prefixed by alias/, a fully specified ARN - // to an alias, a fully specified ARN to a key, or a globally unique identifier. - // - // Disabling or deleting the KMS key, or removing CloudTrail permissions on - // the key, prevents CloudTrail from logging events to the event data store, - // and prevents users from querying the data in the event data store that was - // encrypted with the key. After you associate an event data store with a KMS - // key, the KMS key cannot be removed or changed. Before you disable or delete - // a KMS key that you are using with an event data store, delete or back up - // your event data store. - // - // CloudTrail also supports KMS multi-Region keys. For more information about - // multi-Region keys, see Using multi-Region keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) - // in the Key Management Service Developer Guide. - // - // Examples: - // - // * alias/MyAliasName - // - // * arn:aws:kms:us-east-2:123456789012:alias/MyAliasName - // - // * arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // * 12345678-1234-1234-1234-123456789012 - KmsKeyId *string `min:"1" type:"string"` - - // Specifies whether the event data store includes events from all regions, - // or only from the region in which the event data store is created. - MultiRegionEnabled *bool `type:"boolean"` - - // The name of the event data store. - // - // Name is a required field - Name *string `min:"3" type:"string" required:"true"` - - // Specifies whether an event data store collects events logged for an organization - // in Organizations. - OrganizationEnabled *bool `type:"boolean"` - - // The retention period of the event data store, in days. You can set a retention - // period of up to 2557 days, the equivalent of seven years. - RetentionPeriod *int64 `min:"7" type:"integer"` - - // A list of tags. - TagsList []*Tag `type:"list"` - - // Specifies whether termination protection is enabled for the event data store. - // If termination protection is enabled, you cannot delete the event data store - // until termination protection is disabled. - TerminationProtectionEnabled *bool `type:"boolean"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateEventDataStoreInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateEventDataStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateEventDataStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateEventDataStoreInput"} - if s.KmsKeyId != nil && len(*s.KmsKeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KmsKeyId", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.RetentionPeriod != nil && *s.RetentionPeriod < 7 { - invalidParams.Add(request.NewErrParamMinValue("RetentionPeriod", 7)) - } - if s.AdvancedEventSelectors != nil { - for i, v := range s.AdvancedEventSelectors { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AdvancedEventSelectors", i), err.(request.ErrInvalidParams)) - } - } - } - if s.TagsList != nil { - for i, v := range s.TagsList { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagsList", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdvancedEventSelectors sets the AdvancedEventSelectors field's value. -func (s *CreateEventDataStoreInput) SetAdvancedEventSelectors(v []*AdvancedEventSelector) *CreateEventDataStoreInput { - s.AdvancedEventSelectors = v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateEventDataStoreInput) SetKmsKeyId(v string) *CreateEventDataStoreInput { - s.KmsKeyId = &v - return s -} - -// SetMultiRegionEnabled sets the MultiRegionEnabled field's value. -func (s *CreateEventDataStoreInput) SetMultiRegionEnabled(v bool) *CreateEventDataStoreInput { - s.MultiRegionEnabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateEventDataStoreInput) SetName(v string) *CreateEventDataStoreInput { - s.Name = &v - return s -} - -// SetOrganizationEnabled sets the OrganizationEnabled field's value. -func (s *CreateEventDataStoreInput) SetOrganizationEnabled(v bool) *CreateEventDataStoreInput { - s.OrganizationEnabled = &v - return s -} - -// SetRetentionPeriod sets the RetentionPeriod field's value. -func (s *CreateEventDataStoreInput) SetRetentionPeriod(v int64) *CreateEventDataStoreInput { - s.RetentionPeriod = &v - return s -} - -// SetTagsList sets the TagsList field's value. -func (s *CreateEventDataStoreInput) SetTagsList(v []*Tag) *CreateEventDataStoreInput { - s.TagsList = v - return s -} - -// SetTerminationProtectionEnabled sets the TerminationProtectionEnabled field's value. -func (s *CreateEventDataStoreInput) SetTerminationProtectionEnabled(v bool) *CreateEventDataStoreInput { - s.TerminationProtectionEnabled = &v - return s -} - -type CreateEventDataStoreOutput struct { - _ struct{} `type:"structure"` - - // The advanced event selectors that were used to select the events for the - // data store. - AdvancedEventSelectors []*AdvancedEventSelector `type:"list"` - - // The timestamp that shows when the event data store was created. - CreatedTimestamp *time.Time `type:"timestamp"` - - // The ARN of the event data store. - EventDataStoreArn *string `min:"3" type:"string"` - - // Specifies the KMS key ID that encrypts the events delivered by CloudTrail. - // The value is a fully specified ARN to a KMS key in the following format. - // - // arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 - KmsKeyId *string `min:"1" type:"string"` - - // Indicates whether the event data store collects events from all regions, - // or only from the region in which it was created. - MultiRegionEnabled *bool `type:"boolean"` - - // The name of the event data store. - Name *string `min:"3" type:"string"` - - // Indicates whether an event data store is collecting logged events for an - // organization in Organizations. - OrganizationEnabled *bool `type:"boolean"` - - // The retention period of an event data store, in days. - RetentionPeriod *int64 `min:"7" type:"integer"` - - // The status of event data store creation. - Status *string `type:"string" enum:"EventDataStoreStatus"` - - // A list of tags. - TagsList []*Tag `type:"list"` - - // Indicates whether termination protection is enabled for the event data store. - TerminationProtectionEnabled *bool `type:"boolean"` - - // The timestamp that shows when an event data store was updated, if applicable. - // UpdatedTimestamp is always either the same or newer than the time shown in - // CreatedTimestamp. - UpdatedTimestamp *time.Time `type:"timestamp"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateEventDataStoreOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateEventDataStoreOutput) GoString() string { - return s.String() -} - -// SetAdvancedEventSelectors sets the AdvancedEventSelectors field's value. -func (s *CreateEventDataStoreOutput) SetAdvancedEventSelectors(v []*AdvancedEventSelector) *CreateEventDataStoreOutput { - s.AdvancedEventSelectors = v - return s -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *CreateEventDataStoreOutput) SetCreatedTimestamp(v time.Time) *CreateEventDataStoreOutput { - s.CreatedTimestamp = &v - return s -} - -// SetEventDataStoreArn sets the EventDataStoreArn field's value. -func (s *CreateEventDataStoreOutput) SetEventDataStoreArn(v string) *CreateEventDataStoreOutput { - s.EventDataStoreArn = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateEventDataStoreOutput) SetKmsKeyId(v string) *CreateEventDataStoreOutput { - s.KmsKeyId = &v - return s -} - -// SetMultiRegionEnabled sets the MultiRegionEnabled field's value. -func (s *CreateEventDataStoreOutput) SetMultiRegionEnabled(v bool) *CreateEventDataStoreOutput { - s.MultiRegionEnabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateEventDataStoreOutput) SetName(v string) *CreateEventDataStoreOutput { - s.Name = &v - return s -} - -// SetOrganizationEnabled sets the OrganizationEnabled field's value. -func (s *CreateEventDataStoreOutput) SetOrganizationEnabled(v bool) *CreateEventDataStoreOutput { - s.OrganizationEnabled = &v - return s -} - -// SetRetentionPeriod sets the RetentionPeriod field's value. -func (s *CreateEventDataStoreOutput) SetRetentionPeriod(v int64) *CreateEventDataStoreOutput { - s.RetentionPeriod = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *CreateEventDataStoreOutput) SetStatus(v string) *CreateEventDataStoreOutput { - s.Status = &v - return s -} - -// SetTagsList sets the TagsList field's value. -func (s *CreateEventDataStoreOutput) SetTagsList(v []*Tag) *CreateEventDataStoreOutput { - s.TagsList = v - return s -} - -// SetTerminationProtectionEnabled sets the TerminationProtectionEnabled field's value. -func (s *CreateEventDataStoreOutput) SetTerminationProtectionEnabled(v bool) *CreateEventDataStoreOutput { - s.TerminationProtectionEnabled = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *CreateEventDataStoreOutput) SetUpdatedTimestamp(v time.Time) *CreateEventDataStoreOutput { - s.UpdatedTimestamp = &v - return s -} - -// Specifies the settings for each trail. -type CreateTrailInput struct { - _ struct{} `type:"structure"` - - // Specifies a log group name using an Amazon Resource Name (ARN), a unique - // identifier that represents the log group to which CloudTrail logs will be - // delivered. You must use a log group that exists in your account. - // - // Not required unless you specify CloudWatchLogsRoleArn. - CloudWatchLogsLogGroupArn *string `type:"string"` - - // Specifies the role for the CloudWatch Logs endpoint to assume to write to - // a user's log group. You must use a role that exists in your account. - CloudWatchLogsRoleArn *string `type:"string"` - - // Specifies whether log file integrity validation is enabled. The default is - // false. - // - // When you disable log file integrity validation, the chain of digest files - // is broken after one hour. CloudTrail does not create digest files for log - // files that were delivered during a period in which log file integrity validation - // was disabled. For example, if you enable log file integrity validation at - // noon on January 1, disable it at noon on January 2, and re-enable it at noon - // on January 10, digest files will not be created for the log files delivered - // from noon on January 2 to noon on January 10. The same applies whenever you - // stop CloudTrail logging or delete a trail. - EnableLogFileValidation *bool `type:"boolean"` - - // Specifies whether the trail is publishing events from global services such - // as IAM to the log files. - IncludeGlobalServiceEvents *bool `type:"boolean"` - - // Specifies whether the trail is created in the current region or in all regions. - // The default is false, which creates a trail only in the region where you - // are signed in. As a best practice, consider creating trails that log events - // in all regions. - IsMultiRegionTrail *bool `type:"boolean"` - - // Specifies whether the trail is created for all accounts in an organization - // in Organizations, or only for the current Amazon Web Services account. The - // default is false, and cannot be true unless the call is made on behalf of - // an Amazon Web Services account that is the management account or delegated - // administrator account for an organization in Organizations. - IsOrganizationTrail *bool `type:"boolean"` - - // Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. - // The value can be an alias name prefixed by alias/, a fully specified ARN - // to an alias, a fully specified ARN to a key, or a globally unique identifier. - // - // CloudTrail also supports KMS multi-Region keys. For more information about - // multi-Region keys, see Using multi-Region keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) - // in the Key Management Service Developer Guide. - // - // Examples: - // - // * alias/MyAliasName - // - // * arn:aws:kms:us-east-2:123456789012:alias/MyAliasName - // - // * arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // * 12345678-1234-1234-1234-123456789012 - KmsKeyId *string `type:"string"` - - // Specifies the name of the trail. The name must meet the following requirements: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores - // (_), or dashes (-) - // - // * Start with a letter or number, and end with a letter or number - // - // * Be between 3 and 128 characters - // - // * Have no adjacent periods, underscores or dashes. Names like my-_namespace - // and my--namespace are not valid. - // - // * Not be in IP address format (for example, 192.168.5.4) - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // Specifies the name of the Amazon S3 bucket designated for publishing log - // files. See Amazon S3 Bucket Naming Requirements (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html). - // - // S3BucketName is a required field - S3BucketName *string `type:"string" required:"true"` - - // Specifies the Amazon S3 key prefix that comes after the name of the bucket - // you have designated for log file delivery. For more information, see Finding - // Your CloudTrail Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html). - // The maximum length is 200 characters. - S3KeyPrefix *string `type:"string"` - - // Specifies the name of the Amazon SNS topic defined for notification of log - // file delivery. The maximum length is 256 characters. - SnsTopicName *string `type:"string"` - - // A list of tags. - TagsList []*Tag `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateTrailInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateTrailInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateTrailInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateTrailInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.S3BucketName == nil { - invalidParams.Add(request.NewErrParamRequired("S3BucketName")) - } - if s.TagsList != nil { - for i, v := range s.TagsList { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagsList", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value. -func (s *CreateTrailInput) SetCloudWatchLogsLogGroupArn(v string) *CreateTrailInput { - s.CloudWatchLogsLogGroupArn = &v - return s -} - -// SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value. -func (s *CreateTrailInput) SetCloudWatchLogsRoleArn(v string) *CreateTrailInput { - s.CloudWatchLogsRoleArn = &v - return s -} - -// SetEnableLogFileValidation sets the EnableLogFileValidation field's value. -func (s *CreateTrailInput) SetEnableLogFileValidation(v bool) *CreateTrailInput { - s.EnableLogFileValidation = &v - return s -} - -// SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value. -func (s *CreateTrailInput) SetIncludeGlobalServiceEvents(v bool) *CreateTrailInput { - s.IncludeGlobalServiceEvents = &v - return s -} - -// SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value. -func (s *CreateTrailInput) SetIsMultiRegionTrail(v bool) *CreateTrailInput { - s.IsMultiRegionTrail = &v - return s -} - -// SetIsOrganizationTrail sets the IsOrganizationTrail field's value. -func (s *CreateTrailInput) SetIsOrganizationTrail(v bool) *CreateTrailInput { - s.IsOrganizationTrail = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateTrailInput) SetKmsKeyId(v string) *CreateTrailInput { - s.KmsKeyId = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateTrailInput) SetName(v string) *CreateTrailInput { - s.Name = &v - return s -} - -// SetS3BucketName sets the S3BucketName field's value. -func (s *CreateTrailInput) SetS3BucketName(v string) *CreateTrailInput { - s.S3BucketName = &v - return s -} - -// SetS3KeyPrefix sets the S3KeyPrefix field's value. -func (s *CreateTrailInput) SetS3KeyPrefix(v string) *CreateTrailInput { - s.S3KeyPrefix = &v - return s -} - -// SetSnsTopicName sets the SnsTopicName field's value. -func (s *CreateTrailInput) SetSnsTopicName(v string) *CreateTrailInput { - s.SnsTopicName = &v - return s -} - -// SetTagsList sets the TagsList field's value. -func (s *CreateTrailInput) SetTagsList(v []*Tag) *CreateTrailInput { - s.TagsList = v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -type CreateTrailOutput struct { - _ struct{} `type:"structure"` - - // Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail - // logs will be delivered. - CloudWatchLogsLogGroupArn *string `type:"string"` - - // Specifies the role for the CloudWatch Logs endpoint to assume to write to - // a user's log group. - CloudWatchLogsRoleArn *string `type:"string"` - - // Specifies whether the trail is publishing events from global services such - // as IAM to the log files. - IncludeGlobalServiceEvents *bool `type:"boolean"` - - // Specifies whether the trail exists in one region or in all regions. - IsMultiRegionTrail *bool `type:"boolean"` - - // Specifies whether the trail is an organization trail. - IsOrganizationTrail *bool `type:"boolean"` - - // Specifies the KMS key ID that encrypts the events delivered by CloudTrail. - // The value is a fully specified ARN to a KMS key in the following format. - // - // arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 - KmsKeyId *string `type:"string"` - - // Specifies whether log file integrity validation is enabled. - LogFileValidationEnabled *bool `type:"boolean"` - - // Specifies the name of the trail. - Name *string `type:"string"` - - // Specifies the name of the Amazon S3 bucket designated for publishing log - // files. - S3BucketName *string `type:"string"` - - // Specifies the Amazon S3 key prefix that comes after the name of the bucket - // you have designated for log file delivery. For more information, see Finding - // Your CloudTrail Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html). - S3KeyPrefix *string `type:"string"` - - // Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications - // when log files are delivered. The format of a topic ARN is: - // - // arn:aws:sns:us-east-2:123456789012:MyTopic - SnsTopicARN *string `type:"string"` - - // This field is no longer in use. Use SnsTopicARN. - // - // Deprecated: SnsTopicName has been deprecated - SnsTopicName *string `deprecated:"true" type:"string"` - - // Specifies the ARN of the trail that was created. The format of a trail ARN - // is: - // - // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail - TrailARN *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateTrailOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateTrailOutput) GoString() string { - return s.String() -} - -// SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value. -func (s *CreateTrailOutput) SetCloudWatchLogsLogGroupArn(v string) *CreateTrailOutput { - s.CloudWatchLogsLogGroupArn = &v - return s -} - -// SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value. -func (s *CreateTrailOutput) SetCloudWatchLogsRoleArn(v string) *CreateTrailOutput { - s.CloudWatchLogsRoleArn = &v - return s -} - -// SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value. -func (s *CreateTrailOutput) SetIncludeGlobalServiceEvents(v bool) *CreateTrailOutput { - s.IncludeGlobalServiceEvents = &v - return s -} - -// SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value. -func (s *CreateTrailOutput) SetIsMultiRegionTrail(v bool) *CreateTrailOutput { - s.IsMultiRegionTrail = &v - return s -} - -// SetIsOrganizationTrail sets the IsOrganizationTrail field's value. -func (s *CreateTrailOutput) SetIsOrganizationTrail(v bool) *CreateTrailOutput { - s.IsOrganizationTrail = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *CreateTrailOutput) SetKmsKeyId(v string) *CreateTrailOutput { - s.KmsKeyId = &v - return s -} - -// SetLogFileValidationEnabled sets the LogFileValidationEnabled field's value. -func (s *CreateTrailOutput) SetLogFileValidationEnabled(v bool) *CreateTrailOutput { - s.LogFileValidationEnabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateTrailOutput) SetName(v string) *CreateTrailOutput { - s.Name = &v - return s -} - -// SetS3BucketName sets the S3BucketName field's value. -func (s *CreateTrailOutput) SetS3BucketName(v string) *CreateTrailOutput { - s.S3BucketName = &v - return s -} - -// SetS3KeyPrefix sets the S3KeyPrefix field's value. -func (s *CreateTrailOutput) SetS3KeyPrefix(v string) *CreateTrailOutput { - s.S3KeyPrefix = &v - return s -} - -// SetSnsTopicARN sets the SnsTopicARN field's value. -func (s *CreateTrailOutput) SetSnsTopicARN(v string) *CreateTrailOutput { - s.SnsTopicARN = &v - return s -} - -// SetSnsTopicName sets the SnsTopicName field's value. -func (s *CreateTrailOutput) SetSnsTopicName(v string) *CreateTrailOutput { - s.SnsTopicName = &v - return s -} - -// SetTrailARN sets the TrailARN field's value. -func (s *CreateTrailOutput) SetTrailARN(v string) *CreateTrailOutput { - s.TrailARN = &v - return s -} - -// The Amazon S3 buckets, Lambda functions, or Amazon DynamoDB tables that you -// specify in your event selectors for your trail to log data events. Data events -// provide information about the resource operations performed on or within -// a resource itself. These are also known as data plane operations. You can -// specify up to 250 data resources for a trail. -// -// The total number of allowed data resources is 250. This number can be distributed -// between 1 and 5 event selectors, but the total cannot exceed 250 across all -// selectors for the trail. -// -// If you are using advanced event selectors, the maximum total number of values -// for all conditions, across all advanced event selectors for the trail, is -// 500. -// -// The following example demonstrates how logging works when you configure logging -// of all data events for an S3 bucket named bucket-1. In this example, the -// CloudTrail user specified an empty prefix, and the option to log both Read -// and Write data events. -// -// A user uploads an image file to bucket-1. -// -// The PutObject API operation is an Amazon S3 object-level API. It is recorded -// as a data event in CloudTrail. Because the CloudTrail user specified an S3 -// bucket with an empty prefix, events that occur on any object in that bucket -// are logged. The trail processes and logs the event. -// -// A user uploads an object to an Amazon S3 bucket named arn:aws:s3:::bucket-2. -// -// The PutObject API operation occurred for an object in an S3 bucket that the -// CloudTrail user didn't specify for the trail. The trail doesn’t log the -// event. -// -// The following example demonstrates how logging works when you configure logging -// of Lambda data events for a Lambda function named MyLambdaFunction, but not -// for all Lambda functions. -// -// A user runs a script that includes a call to the MyLambdaFunction function -// and the MyOtherLambdaFunction function. -// -// The Invoke API operation on MyLambdaFunction is an Lambda API. It is recorded -// as a data event in CloudTrail. Because the CloudTrail user specified logging -// data events for MyLambdaFunction, any invocations of that function are logged. -// The trail processes and logs the event. -// -// The Invoke API operation on MyOtherLambdaFunction is an Lambda API. Because -// the CloudTrail user did not specify logging data events for all Lambda functions, -// the Invoke operation for MyOtherLambdaFunction does not match the function -// specified for the trail. The trail doesn’t log the event. -type DataResource struct { - _ struct{} `type:"structure"` - - // The resource type in which you want to log data events. You can specify the - // following basic event selector resource types: - // - // * AWS::S3::Object - // - // * AWS::Lambda::Function - // - // * AWS::DynamoDB::Table - // - // The following resource types are also available through advanced event selectors. - // Basic event selector resource types are valid in advanced event selectors, - // but advanced event selector resource types are not valid in basic event selectors. - // For more information, see AdvancedFieldSelector$Field. - // - // * AWS::CloudTrail::Channel - // - // * AWS::S3Outposts::Object - // - // * AWS::ManagedBlockchain::Node - // - // * AWS::S3ObjectLambda::AccessPoint - // - // * AWS::EC2::Snapshot - // - // * AWS::S3::AccessPoint - // - // * AWS::DynamoDB::Stream - // - // * AWS::Glue::Table - // - // * AWS::FinSpace::Environment - // - // * AWS::SageMaker::ExperimentTrialComponent - // - // * AWS::SageMaker::FeatureGroup - Type *string `type:"string"` - - // An array of Amazon Resource Name (ARN) strings or partial ARN strings for - // the specified objects. - // - // * To log data events for all objects in all S3 buckets in your Amazon - // Web Services account, specify the prefix as arn:aws:s3. This also enables - // logging of data event activity performed by any user or role in your Amazon - // Web Services account, even if that activity is performed on a bucket that - // belongs to another Amazon Web Services account. - // - // * To log data events for all objects in an S3 bucket, specify the bucket - // and an empty object prefix such as arn:aws:s3:::bucket-1/. The trail logs - // data events for all objects in this S3 bucket. - // - // * To log data events for specific objects, specify the S3 bucket and object - // prefix such as arn:aws:s3:::bucket-1/example-images. The trail logs data - // events for objects in this S3 bucket that match the prefix. - // - // * To log data events for all Lambda functions in your Amazon Web Services - // account, specify the prefix as arn:aws:lambda. This also enables logging - // of Invoke activity performed by any user or role in your Amazon Web Services - // account, even if that activity is performed on a function that belongs - // to another Amazon Web Services account. - // - // * To log data events for a specific Lambda function, specify the function - // ARN. Lambda function ARNs are exact. For example, if you specify a function - // ARN arn:aws:lambda:us-west-2:111111111111:function:helloworld, data events - // will only be logged for arn:aws:lambda:us-west-2:111111111111:function:helloworld. - // They will not be logged for arn:aws:lambda:us-west-2:111111111111:function:helloworld2. - // - // * To log data events for all DynamoDB tables in your Amazon Web Services - // account, specify the prefix as arn:aws:dynamodb. - Values []*string `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DataResource) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DataResource) GoString() string { - return s.String() -} - -// SetType sets the Type field's value. -func (s *DataResource) SetType(v string) *DataResource { - s.Type = &v - return s -} - -// SetValues sets the Values field's value. -func (s *DataResource) SetValues(v []*string) *DataResource { - s.Values = v - return s -} - -// This exception is thrown when the maximum number of CloudTrail delegated -// administrators is reached. -type DelegatedAdminAccountLimitExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DelegatedAdminAccountLimitExceededException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DelegatedAdminAccountLimitExceededException) GoString() string { - return s.String() -} - -func newErrorDelegatedAdminAccountLimitExceededException(v protocol.ResponseMetadata) error { - return &DelegatedAdminAccountLimitExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *DelegatedAdminAccountLimitExceededException) Code() string { - return "DelegatedAdminAccountLimitExceededException" -} - -// Message returns the exception's message. -func (s *DelegatedAdminAccountLimitExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *DelegatedAdminAccountLimitExceededException) OrigErr() error { - return nil -} - -func (s *DelegatedAdminAccountLimitExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *DelegatedAdminAccountLimitExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *DelegatedAdminAccountLimitExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -type DeleteChannelInput struct { - _ struct{} `type:"structure"` - - // The ARN or the UUID value of the channel that you want to delete. - // - // Channel is a required field - Channel *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteChannelInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteChannelInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteChannelInput"} - if s.Channel == nil { - invalidParams.Add(request.NewErrParamRequired("Channel")) - } - if s.Channel != nil && len(*s.Channel) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Channel", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannel sets the Channel field's value. -func (s *DeleteChannelInput) SetChannel(v string) *DeleteChannelInput { - s.Channel = &v - return s -} - -type DeleteChannelOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteChannelOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteChannelOutput) GoString() string { - return s.String() -} - -type DeleteEventDataStoreInput struct { - _ struct{} `type:"structure"` - - // The ARN (or the ID suffix of the ARN) of the event data store to delete. - // - // EventDataStore is a required field - EventDataStore *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteEventDataStoreInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteEventDataStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteEventDataStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteEventDataStoreInput"} - if s.EventDataStore == nil { - invalidParams.Add(request.NewErrParamRequired("EventDataStore")) - } - if s.EventDataStore != nil && len(*s.EventDataStore) < 3 { - invalidParams.Add(request.NewErrParamMinLen("EventDataStore", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEventDataStore sets the EventDataStore field's value. -func (s *DeleteEventDataStoreInput) SetEventDataStore(v string) *DeleteEventDataStoreInput { - s.EventDataStore = &v - return s -} - -type DeleteEventDataStoreOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteEventDataStoreOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteEventDataStoreOutput) GoString() string { - return s.String() -} - -type DeleteResourcePolicyInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the CloudTrail channel you're deleting - // the resource-based policy from. The following is the format of a resource - // ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/MyChannel. - // - // ResourceArn is a required field - ResourceArn *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteResourcePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteResourcePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteResourcePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteResourcePolicyInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 3 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *DeleteResourcePolicyInput) SetResourceArn(v string) *DeleteResourcePolicyInput { - s.ResourceArn = &v - return s -} - -type DeleteResourcePolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteResourcePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteResourcePolicyOutput) GoString() string { - return s.String() -} - -// The request that specifies the name of a trail to delete. -type DeleteTrailInput struct { - _ struct{} `type:"structure"` - - // Specifies the name or the CloudTrail ARN of the trail to be deleted. The - // following is the format of a trail ARN. arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteTrailInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteTrailInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteTrailInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteTrailInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DeleteTrailInput) SetName(v string) *DeleteTrailInput { - s.Name = &v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -type DeleteTrailOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteTrailOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteTrailOutput) GoString() string { - return s.String() -} - -// Removes CloudTrail delegated administrator permissions from a specified member -// account in an organization that is currently designated as a delegated administrator. -type DeregisterOrganizationDelegatedAdminInput struct { - _ struct{} `type:"structure"` - - // A delegated administrator account ID. This is a member account in an organization - // that is currently designated as a delegated administrator. - // - // DelegatedAdminAccountId is a required field - DelegatedAdminAccountId *string `min:"12" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeregisterOrganizationDelegatedAdminInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeregisterOrganizationDelegatedAdminInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterOrganizationDelegatedAdminInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterOrganizationDelegatedAdminInput"} - if s.DelegatedAdminAccountId == nil { - invalidParams.Add(request.NewErrParamRequired("DelegatedAdminAccountId")) - } - if s.DelegatedAdminAccountId != nil && len(*s.DelegatedAdminAccountId) < 12 { - invalidParams.Add(request.NewErrParamMinLen("DelegatedAdminAccountId", 12)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDelegatedAdminAccountId sets the DelegatedAdminAccountId field's value. -func (s *DeregisterOrganizationDelegatedAdminInput) SetDelegatedAdminAccountId(v string) *DeregisterOrganizationDelegatedAdminInput { - s.DelegatedAdminAccountId = &v - return s -} - -// Returns the following response if successful. Otherwise, returns an error. -type DeregisterOrganizationDelegatedAdminOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeregisterOrganizationDelegatedAdminOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeregisterOrganizationDelegatedAdminOutput) GoString() string { - return s.String() -} - -type DescribeQueryInput struct { - _ struct{} `type:"structure"` - - // The ARN (or the ID suffix of the ARN) of an event data store on which the - // specified query was run. - // - // Deprecated: EventDataStore is no longer required by DescribeQueryRequest - EventDataStore *string `min:"3" deprecated:"true" type:"string"` - - // The query ID. - // - // QueryId is a required field - QueryId *string `min:"36" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeQueryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeQueryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeQueryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeQueryInput"} - if s.EventDataStore != nil && len(*s.EventDataStore) < 3 { - invalidParams.Add(request.NewErrParamMinLen("EventDataStore", 3)) - } - if s.QueryId == nil { - invalidParams.Add(request.NewErrParamRequired("QueryId")) - } - if s.QueryId != nil && len(*s.QueryId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("QueryId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEventDataStore sets the EventDataStore field's value. -func (s *DescribeQueryInput) SetEventDataStore(v string) *DescribeQueryInput { - s.EventDataStore = &v - return s -} - -// SetQueryId sets the QueryId field's value. -func (s *DescribeQueryInput) SetQueryId(v string) *DescribeQueryInput { - s.QueryId = &v - return s -} - -type DescribeQueryOutput struct { - _ struct{} `type:"structure"` - - // The URI for the S3 bucket where CloudTrail delivered query results, if applicable. - DeliveryS3Uri *string `type:"string"` - - // The delivery status. - DeliveryStatus *string `type:"string" enum:"DeliveryStatus"` - - // The error message returned if a query failed. - ErrorMessage *string `min:"4" type:"string"` - - // The ID of the query. - QueryId *string `min:"36" type:"string"` - - // Metadata about a query, including the number of events that were matched, - // the total number of events scanned, the query run time in milliseconds, and - // the query's creation time. - QueryStatistics *QueryStatisticsForDescribeQuery `type:"structure"` - - // The status of a query. Values for QueryStatus include QUEUED, RUNNING, FINISHED, - // FAILED, TIMED_OUT, or CANCELLED - QueryStatus *string `type:"string" enum:"QueryStatus"` - - // The SQL code of a query. - QueryString *string `min:"1" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeQueryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeQueryOutput) GoString() string { - return s.String() -} - -// SetDeliveryS3Uri sets the DeliveryS3Uri field's value. -func (s *DescribeQueryOutput) SetDeliveryS3Uri(v string) *DescribeQueryOutput { - s.DeliveryS3Uri = &v - return s -} - -// SetDeliveryStatus sets the DeliveryStatus field's value. -func (s *DescribeQueryOutput) SetDeliveryStatus(v string) *DescribeQueryOutput { - s.DeliveryStatus = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *DescribeQueryOutput) SetErrorMessage(v string) *DescribeQueryOutput { - s.ErrorMessage = &v - return s -} - -// SetQueryId sets the QueryId field's value. -func (s *DescribeQueryOutput) SetQueryId(v string) *DescribeQueryOutput { - s.QueryId = &v - return s -} - -// SetQueryStatistics sets the QueryStatistics field's value. -func (s *DescribeQueryOutput) SetQueryStatistics(v *QueryStatisticsForDescribeQuery) *DescribeQueryOutput { - s.QueryStatistics = v - return s -} - -// SetQueryStatus sets the QueryStatus field's value. -func (s *DescribeQueryOutput) SetQueryStatus(v string) *DescribeQueryOutput { - s.QueryStatus = &v - return s -} - -// SetQueryString sets the QueryString field's value. -func (s *DescribeQueryOutput) SetQueryString(v string) *DescribeQueryOutput { - s.QueryString = &v - return s -} - -// Returns information about the trail. -type DescribeTrailsInput struct { - _ struct{} `type:"structure"` - - // Specifies whether to include shadow trails in the response. A shadow trail - // is the replication in a region of a trail that was created in a different - // region, or in the case of an organization trail, the replication of an organization - // trail in member accounts. If you do not include shadow trails, organization - // trails in a member account and region replication trails will not be returned. - // The default is true. - IncludeShadowTrails *bool `locationName:"includeShadowTrails" type:"boolean"` - - // Specifies a list of trail names, trail ARNs, or both, of the trails to describe. - // The format of a trail ARN is: - // - // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail - // - // If an empty list is specified, information for the trail in the current region - // is returned. - // - // * If an empty list is specified and IncludeShadowTrails is false, then - // information for all trails in the current region is returned. - // - // * If an empty list is specified and IncludeShadowTrails is null or true, - // then information for all trails in the current region and any associated - // shadow trails in other regions is returned. - // - // If one or more trail names are specified, information is returned only if - // the names match the names of trails belonging only to the current region - // and current account. To return information about a trail in another region, - // you must specify its trail ARN. - TrailNameList []*string `locationName:"trailNameList" type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeTrailsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeTrailsInput) GoString() string { - return s.String() -} - -// SetIncludeShadowTrails sets the IncludeShadowTrails field's value. -func (s *DescribeTrailsInput) SetIncludeShadowTrails(v bool) *DescribeTrailsInput { - s.IncludeShadowTrails = &v - return s -} - -// SetTrailNameList sets the TrailNameList field's value. -func (s *DescribeTrailsInput) SetTrailNameList(v []*string) *DescribeTrailsInput { - s.TrailNameList = v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -type DescribeTrailsOutput struct { - _ struct{} `type:"structure"` - - // The list of trail objects. Trail objects with string values are only returned - // if values for the objects exist in a trail's configuration. For example, - // SNSTopicName and SNSTopicARN are only returned in results if a trail is configured - // to send SNS notifications. Similarly, KMSKeyId only appears in results if - // a trail's log files are encrypted with KMS customer managed keys. - TrailList []*Trail `locationName:"trailList" type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeTrailsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeTrailsOutput) GoString() string { - return s.String() -} - -// SetTrailList sets the TrailList field's value. -func (s *DescribeTrailsOutput) SetTrailList(v []*Trail) *DescribeTrailsOutput { - s.TrailList = v - return s -} - -// Contains information about the destination receiving events. -type Destination struct { - _ struct{} `type:"structure"` - - // For channels used for a CloudTrail Lake integration, the location is the - // ARN of an event data store that receives events from a channel. For service-linked - // channels, the location is the name of the Amazon Web Services service. - // - // Location is a required field - Location *string `min:"3" type:"string" required:"true"` - - // The type of destination for events arriving from a channel. For channels - // used for a CloudTrail Lake integration, the value is EventDataStore. For - // service-linked channels, the value is AWS_SERVICE. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"DestinationType"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Destination) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Destination) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Destination) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Destination"} - if s.Location == nil { - invalidParams.Add(request.NewErrParamRequired("Location")) - } - if s.Location != nil && len(*s.Location) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Location", 3)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLocation sets the Location field's value. -func (s *Destination) SetLocation(v string) *Destination { - s.Location = &v - return s -} - -// SetType sets the Type field's value. -func (s *Destination) SetType(v string) *Destination { - s.Type = &v - return s -} - -// Contains information about an event that was returned by a lookup request. -// The result includes a representation of a CloudTrail event. -type Event struct { - _ struct{} `type:"structure"` - - // The Amazon Web Services access key ID that was used to sign the request. - // If the request was made with temporary security credentials, this is the - // access key ID of the temporary credentials. - AccessKeyId *string `type:"string"` - - // A JSON string that contains a representation of the event returned. - CloudTrailEvent *string `type:"string"` - - // The CloudTrail ID of the event returned. - EventId *string `type:"string"` - - // The name of the event returned. - EventName *string `type:"string"` - - // The Amazon Web Services service to which the request was made. - EventSource *string `type:"string"` - - // The date and time of the event returned. - EventTime *time.Time `type:"timestamp"` - - // Information about whether the event is a write event or a read event. - ReadOnly *string `type:"string"` - - // A list of resources referenced by the event returned. - Resources []*Resource `type:"list"` - - // A user name or role name of the requester that called the API in the event - // returned. - Username *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Event) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Event) GoString() string { - return s.String() -} - -// SetAccessKeyId sets the AccessKeyId field's value. -func (s *Event) SetAccessKeyId(v string) *Event { - s.AccessKeyId = &v - return s -} - -// SetCloudTrailEvent sets the CloudTrailEvent field's value. -func (s *Event) SetCloudTrailEvent(v string) *Event { - s.CloudTrailEvent = &v - return s -} - -// SetEventId sets the EventId field's value. -func (s *Event) SetEventId(v string) *Event { - s.EventId = &v - return s -} - -// SetEventName sets the EventName field's value. -func (s *Event) SetEventName(v string) *Event { - s.EventName = &v - return s -} - -// SetEventSource sets the EventSource field's value. -func (s *Event) SetEventSource(v string) *Event { - s.EventSource = &v - return s -} - -// SetEventTime sets the EventTime field's value. -func (s *Event) SetEventTime(v time.Time) *Event { - s.EventTime = &v - return s -} - -// SetReadOnly sets the ReadOnly field's value. -func (s *Event) SetReadOnly(v string) *Event { - s.ReadOnly = &v - return s -} - -// SetResources sets the Resources field's value. -func (s *Event) SetResources(v []*Resource) *Event { - s.Resources = v - return s -} - -// SetUsername sets the Username field's value. -func (s *Event) SetUsername(v string) *Event { - s.Username = &v - return s -} - -// A storage lake of event data against which you can run complex SQL-based -// queries. An event data store can include events that you have logged on your -// account from the last 90 to 2557 days (about three months to up to seven -// years). To select events for an event data store, use advanced event selectors -// (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html#creating-data-event-selectors-advanced). -type EventDataStore struct { - _ struct{} `type:"structure"` - - // The advanced event selectors that were used to select events for the data - // store. - // - // Deprecated: AdvancedEventSelectors is no longer returned by ListEventDataStores - AdvancedEventSelectors []*AdvancedEventSelector `deprecated:"true" type:"list"` - - // The timestamp of the event data store's creation. - // - // Deprecated: CreatedTimestamp is no longer returned by ListEventDataStores - CreatedTimestamp *time.Time `deprecated:"true" type:"timestamp"` - - // The ARN of the event data store. - EventDataStoreArn *string `min:"3" type:"string"` - - // Indicates whether the event data store includes events from all regions, - // or only from the region in which it was created. - // - // Deprecated: MultiRegionEnabled is no longer returned by ListEventDataStores - MultiRegionEnabled *bool `deprecated:"true" type:"boolean"` - - // The name of the event data store. - Name *string `min:"3" type:"string"` - - // Indicates that an event data store is collecting logged events for an organization. - // - // Deprecated: OrganizationEnabled is no longer returned by ListEventDataStores - OrganizationEnabled *bool `deprecated:"true" type:"boolean"` - - // The retention period, in days. - // - // Deprecated: RetentionPeriod is no longer returned by ListEventDataStores - RetentionPeriod *int64 `min:"7" deprecated:"true" type:"integer"` - - // The status of an event data store. Values are ENABLED and PENDING_DELETION. - // - // Deprecated: Status is no longer returned by ListEventDataStores - Status *string `deprecated:"true" type:"string" enum:"EventDataStoreStatus"` - - // Indicates whether the event data store is protected from termination. - // - // Deprecated: TerminationProtectionEnabled is no longer returned by ListEventDataStores - TerminationProtectionEnabled *bool `deprecated:"true" type:"boolean"` - - // The timestamp showing when an event data store was updated, if applicable. - // UpdatedTimestamp is always either the same or newer than the time shown in - // CreatedTimestamp. - // - // Deprecated: UpdatedTimestamp is no longer returned by ListEventDataStores - UpdatedTimestamp *time.Time `deprecated:"true" type:"timestamp"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EventDataStore) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EventDataStore) GoString() string { - return s.String() -} - -// SetAdvancedEventSelectors sets the AdvancedEventSelectors field's value. -func (s *EventDataStore) SetAdvancedEventSelectors(v []*AdvancedEventSelector) *EventDataStore { - s.AdvancedEventSelectors = v - return s -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *EventDataStore) SetCreatedTimestamp(v time.Time) *EventDataStore { - s.CreatedTimestamp = &v - return s -} - -// SetEventDataStoreArn sets the EventDataStoreArn field's value. -func (s *EventDataStore) SetEventDataStoreArn(v string) *EventDataStore { - s.EventDataStoreArn = &v - return s -} - -// SetMultiRegionEnabled sets the MultiRegionEnabled field's value. -func (s *EventDataStore) SetMultiRegionEnabled(v bool) *EventDataStore { - s.MultiRegionEnabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *EventDataStore) SetName(v string) *EventDataStore { - s.Name = &v - return s -} - -// SetOrganizationEnabled sets the OrganizationEnabled field's value. -func (s *EventDataStore) SetOrganizationEnabled(v bool) *EventDataStore { - s.OrganizationEnabled = &v - return s -} - -// SetRetentionPeriod sets the RetentionPeriod field's value. -func (s *EventDataStore) SetRetentionPeriod(v int64) *EventDataStore { - s.RetentionPeriod = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *EventDataStore) SetStatus(v string) *EventDataStore { - s.Status = &v - return s -} - -// SetTerminationProtectionEnabled sets the TerminationProtectionEnabled field's value. -func (s *EventDataStore) SetTerminationProtectionEnabled(v bool) *EventDataStore { - s.TerminationProtectionEnabled = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *EventDataStore) SetUpdatedTimestamp(v time.Time) *EventDataStore { - s.UpdatedTimestamp = &v - return s -} - -// The specified event data store ARN is not valid or does not map to an event -// data store in your account. -type EventDataStoreARNInvalidException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EventDataStoreARNInvalidException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EventDataStoreARNInvalidException) GoString() string { - return s.String() -} - -func newErrorEventDataStoreARNInvalidException(v protocol.ResponseMetadata) error { - return &EventDataStoreARNInvalidException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *EventDataStoreARNInvalidException) Code() string { - return "EventDataStoreARNInvalidException" -} - -// Message returns the exception's message. -func (s *EventDataStoreARNInvalidException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *EventDataStoreARNInvalidException) OrigErr() error { - return nil -} - -func (s *EventDataStoreARNInvalidException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *EventDataStoreARNInvalidException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *EventDataStoreARNInvalidException) RequestID() string { - return s.RespMetadata.RequestID -} - -// An event data store with that name already exists. -type EventDataStoreAlreadyExistsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EventDataStoreAlreadyExistsException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EventDataStoreAlreadyExistsException) GoString() string { - return s.String() -} - -func newErrorEventDataStoreAlreadyExistsException(v protocol.ResponseMetadata) error { - return &EventDataStoreAlreadyExistsException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *EventDataStoreAlreadyExistsException) Code() string { - return "EventDataStoreAlreadyExistsException" -} - -// Message returns the exception's message. -func (s *EventDataStoreAlreadyExistsException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *EventDataStoreAlreadyExistsException) OrigErr() error { - return nil -} - -func (s *EventDataStoreAlreadyExistsException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *EventDataStoreAlreadyExistsException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *EventDataStoreAlreadyExistsException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when you try to update or delete an event data store -// that currently has an import in progress. -type EventDataStoreHasOngoingImportException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EventDataStoreHasOngoingImportException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EventDataStoreHasOngoingImportException) GoString() string { - return s.String() -} - -func newErrorEventDataStoreHasOngoingImportException(v protocol.ResponseMetadata) error { - return &EventDataStoreHasOngoingImportException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *EventDataStoreHasOngoingImportException) Code() string { - return "EventDataStoreHasOngoingImportException" -} - -// Message returns the exception's message. -func (s *EventDataStoreHasOngoingImportException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *EventDataStoreHasOngoingImportException) OrigErr() error { - return nil -} - -func (s *EventDataStoreHasOngoingImportException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *EventDataStoreHasOngoingImportException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *EventDataStoreHasOngoingImportException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Your account has used the maximum number of event data stores. -type EventDataStoreMaxLimitExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EventDataStoreMaxLimitExceededException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EventDataStoreMaxLimitExceededException) GoString() string { - return s.String() -} - -func newErrorEventDataStoreMaxLimitExceededException(v protocol.ResponseMetadata) error { - return &EventDataStoreMaxLimitExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *EventDataStoreMaxLimitExceededException) Code() string { - return "EventDataStoreMaxLimitExceededException" -} - -// Message returns the exception's message. -func (s *EventDataStoreMaxLimitExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *EventDataStoreMaxLimitExceededException) OrigErr() error { - return nil -} - -func (s *EventDataStoreMaxLimitExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *EventDataStoreMaxLimitExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *EventDataStoreMaxLimitExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The specified event data store was not found. -type EventDataStoreNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EventDataStoreNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EventDataStoreNotFoundException) GoString() string { - return s.String() -} - -func newErrorEventDataStoreNotFoundException(v protocol.ResponseMetadata) error { - return &EventDataStoreNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *EventDataStoreNotFoundException) Code() string { - return "EventDataStoreNotFoundException" -} - -// Message returns the exception's message. -func (s *EventDataStoreNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *EventDataStoreNotFoundException) OrigErr() error { - return nil -} - -func (s *EventDataStoreNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *EventDataStoreNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *EventDataStoreNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The event data store cannot be deleted because termination protection is -// enabled for it. -type EventDataStoreTerminationProtectedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EventDataStoreTerminationProtectedException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EventDataStoreTerminationProtectedException) GoString() string { - return s.String() -} - -func newErrorEventDataStoreTerminationProtectedException(v protocol.ResponseMetadata) error { - return &EventDataStoreTerminationProtectedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *EventDataStoreTerminationProtectedException) Code() string { - return "EventDataStoreTerminationProtectedException" -} - -// Message returns the exception's message. -func (s *EventDataStoreTerminationProtectedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *EventDataStoreTerminationProtectedException) OrigErr() error { - return nil -} - -func (s *EventDataStoreTerminationProtectedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *EventDataStoreTerminationProtectedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *EventDataStoreTerminationProtectedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Use event selectors to further specify the management and data event settings -// for your trail. By default, trails created without specific event selectors -// will be configured to log all read and write management events, and no data -// events. When an event occurs in your account, CloudTrail evaluates the event -// selector for all trails. For each trail, if the event matches any event selector, -// the trail processes and logs the event. If the event doesn't match any event -// selector, the trail doesn't log the event. -// -// You can configure up to five event selectors for a trail. -// -// You cannot apply both event selectors and advanced event selectors to a trail. -type EventSelector struct { - _ struct{} `type:"structure"` - - // CloudTrail supports data event logging for Amazon S3 objects, Lambda functions, - // and Amazon DynamoDB tables with basic event selectors. You can specify up - // to 250 resources for an individual event selector, but the total number of - // data resources cannot exceed 250 across all event selectors in a trail. This - // limit does not apply if you configure resource logging for all data events. - // - // For more information, see Data Events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html) - // and Limits in CloudTrail (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/WhatIsCloudTrail-Limits.html) - // in the CloudTrail User Guide. - DataResources []*DataResource `type:"list"` - - // An optional list of service event sources from which you do not want management - // events to be logged on your trail. In this release, the list can be empty - // (disables the filter), or it can filter out Key Management Service or Amazon - // RDS Data API events by containing kms.amazonaws.com or rdsdata.amazonaws.com. - // By default, ExcludeManagementEventSources is empty, and KMS and Amazon RDS - // Data API events are logged to your trail. You can exclude management event - // sources only in regions that support the event source. - ExcludeManagementEventSources []*string `type:"list"` - - // Specify if you want your event selector to include management events for - // your trail. - // - // For more information, see Management Events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-management-events-with-cloudtrail.html) - // in the CloudTrail User Guide. - // - // By default, the value is true. - // - // The first copy of management events is free. You are charged for additional - // copies of management events that you are logging on any subsequent trail - // in the same region. For more information about CloudTrail pricing, see CloudTrail - // Pricing (http://aws.amazon.com/cloudtrail/pricing/). - IncludeManagementEvents *bool `type:"boolean"` - - // Specify if you want your trail to log read-only events, write-only events, - // or all. For example, the EC2 GetConsoleOutput is a read-only API operation - // and RunInstances is a write-only API operation. - // - // By default, the value is All. - ReadWriteType *string `type:"string" enum:"ReadWriteType"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EventSelector) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EventSelector) GoString() string { - return s.String() -} - -// SetDataResources sets the DataResources field's value. -func (s *EventSelector) SetDataResources(v []*DataResource) *EventSelector { - s.DataResources = v - return s -} - -// SetExcludeManagementEventSources sets the ExcludeManagementEventSources field's value. -func (s *EventSelector) SetExcludeManagementEventSources(v []*string) *EventSelector { - s.ExcludeManagementEventSources = v - return s -} - -// SetIncludeManagementEvents sets the IncludeManagementEvents field's value. -func (s *EventSelector) SetIncludeManagementEvents(v bool) *EventSelector { - s.IncludeManagementEvents = &v - return s -} - -// SetReadWriteType sets the ReadWriteType field's value. -func (s *EventSelector) SetReadWriteType(v string) *EventSelector { - s.ReadWriteType = &v - return s -} - -type GetChannelInput struct { - _ struct{} `type:"structure"` - - // The ARN or UUID of a channel. - // - // Channel is a required field - Channel *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetChannelInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetChannelInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetChannelInput"} - if s.Channel == nil { - invalidParams.Add(request.NewErrParamRequired("Channel")) - } - if s.Channel != nil && len(*s.Channel) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Channel", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannel sets the Channel field's value. -func (s *GetChannelInput) SetChannel(v string) *GetChannelInput { - s.Channel = &v - return s -} - -type GetChannelOutput struct { - _ struct{} `type:"structure"` - - // The ARN of an channel returned by a GetChannel request. - ChannelArn *string `min:"3" type:"string"` - - // The destinations for the channel. For channels created for integrations, - // the destinations are the event data stores that log events arriving through - // the channel. For service-linked channels, the destination is the Amazon Web - // Services service that created the service-linked channel to receive events. - Destinations []*Destination `min:"1" type:"list"` - - // A table showing information about the most recent successful and failed attempts - // to ingest events. - IngestionStatus *IngestionStatus `type:"structure"` - - // The name of the CloudTrail channel. For service-linked channels, the name - // is aws-service-channel/service-name/custom-suffix where service-name represents - // the name of the Amazon Web Services service that created the channel and - // custom-suffix represents the suffix generated by the Amazon Web Services - // service. - Name *string `min:"3" type:"string"` - - // The source for the CloudTrail channel. - Source *string `min:"1" type:"string"` - - // Provides information about the advanced event selectors configured for the - // channel, and whether the channel applies to all regions or a single region. - SourceConfig *SourceConfig `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetChannelOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetChannelOutput) GoString() string { - return s.String() -} - -// SetChannelArn sets the ChannelArn field's value. -func (s *GetChannelOutput) SetChannelArn(v string) *GetChannelOutput { - s.ChannelArn = &v - return s -} - -// SetDestinations sets the Destinations field's value. -func (s *GetChannelOutput) SetDestinations(v []*Destination) *GetChannelOutput { - s.Destinations = v - return s -} - -// SetIngestionStatus sets the IngestionStatus field's value. -func (s *GetChannelOutput) SetIngestionStatus(v *IngestionStatus) *GetChannelOutput { - s.IngestionStatus = v - return s -} - -// SetName sets the Name field's value. -func (s *GetChannelOutput) SetName(v string) *GetChannelOutput { - s.Name = &v - return s -} - -// SetSource sets the Source field's value. -func (s *GetChannelOutput) SetSource(v string) *GetChannelOutput { - s.Source = &v - return s -} - -// SetSourceConfig sets the SourceConfig field's value. -func (s *GetChannelOutput) SetSourceConfig(v *SourceConfig) *GetChannelOutput { - s.SourceConfig = v - return s -} - -type GetEventDataStoreInput struct { - _ struct{} `type:"structure"` - - // The ARN (or ID suffix of the ARN) of the event data store about which you - // want information. - // - // EventDataStore is a required field - EventDataStore *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetEventDataStoreInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetEventDataStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetEventDataStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetEventDataStoreInput"} - if s.EventDataStore == nil { - invalidParams.Add(request.NewErrParamRequired("EventDataStore")) - } - if s.EventDataStore != nil && len(*s.EventDataStore) < 3 { - invalidParams.Add(request.NewErrParamMinLen("EventDataStore", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEventDataStore sets the EventDataStore field's value. -func (s *GetEventDataStoreInput) SetEventDataStore(v string) *GetEventDataStoreInput { - s.EventDataStore = &v - return s -} - -type GetEventDataStoreOutput struct { - _ struct{} `type:"structure"` - - // The advanced event selectors used to select events for the data store. - AdvancedEventSelectors []*AdvancedEventSelector `type:"list"` - - // The timestamp of the event data store's creation. - CreatedTimestamp *time.Time `type:"timestamp"` - - // The event data store Amazon Resource Number (ARN). - EventDataStoreArn *string `min:"3" type:"string"` - - // Specifies the KMS key ID that encrypts the events delivered by CloudTrail. - // The value is a fully specified ARN to a KMS key in the following format. - // - // arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 - KmsKeyId *string `min:"1" type:"string"` - - // Indicates whether the event data store includes events from all regions, - // or only from the region in which it was created. - MultiRegionEnabled *bool `type:"boolean"` - - // The name of the event data store. - Name *string `min:"3" type:"string"` - - // Indicates whether an event data store is collecting logged events for an - // organization in Organizations. - OrganizationEnabled *bool `type:"boolean"` - - // The retention period of the event data store, in days. - RetentionPeriod *int64 `min:"7" type:"integer"` - - // The status of an event data store. Values can be ENABLED and PENDING_DELETION. - Status *string `type:"string" enum:"EventDataStoreStatus"` - - // Indicates that termination protection is enabled. - TerminationProtectionEnabled *bool `type:"boolean"` - - // Shows the time that an event data store was updated, if applicable. UpdatedTimestamp - // is always either the same or newer than the time shown in CreatedTimestamp. - UpdatedTimestamp *time.Time `type:"timestamp"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetEventDataStoreOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetEventDataStoreOutput) GoString() string { - return s.String() -} - -// SetAdvancedEventSelectors sets the AdvancedEventSelectors field's value. -func (s *GetEventDataStoreOutput) SetAdvancedEventSelectors(v []*AdvancedEventSelector) *GetEventDataStoreOutput { - s.AdvancedEventSelectors = v - return s -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *GetEventDataStoreOutput) SetCreatedTimestamp(v time.Time) *GetEventDataStoreOutput { - s.CreatedTimestamp = &v - return s -} - -// SetEventDataStoreArn sets the EventDataStoreArn field's value. -func (s *GetEventDataStoreOutput) SetEventDataStoreArn(v string) *GetEventDataStoreOutput { - s.EventDataStoreArn = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *GetEventDataStoreOutput) SetKmsKeyId(v string) *GetEventDataStoreOutput { - s.KmsKeyId = &v - return s -} - -// SetMultiRegionEnabled sets the MultiRegionEnabled field's value. -func (s *GetEventDataStoreOutput) SetMultiRegionEnabled(v bool) *GetEventDataStoreOutput { - s.MultiRegionEnabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *GetEventDataStoreOutput) SetName(v string) *GetEventDataStoreOutput { - s.Name = &v - return s -} - -// SetOrganizationEnabled sets the OrganizationEnabled field's value. -func (s *GetEventDataStoreOutput) SetOrganizationEnabled(v bool) *GetEventDataStoreOutput { - s.OrganizationEnabled = &v - return s -} - -// SetRetentionPeriod sets the RetentionPeriod field's value. -func (s *GetEventDataStoreOutput) SetRetentionPeriod(v int64) *GetEventDataStoreOutput { - s.RetentionPeriod = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetEventDataStoreOutput) SetStatus(v string) *GetEventDataStoreOutput { - s.Status = &v - return s -} - -// SetTerminationProtectionEnabled sets the TerminationProtectionEnabled field's value. -func (s *GetEventDataStoreOutput) SetTerminationProtectionEnabled(v bool) *GetEventDataStoreOutput { - s.TerminationProtectionEnabled = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *GetEventDataStoreOutput) SetUpdatedTimestamp(v time.Time) *GetEventDataStoreOutput { - s.UpdatedTimestamp = &v - return s -} - -type GetEventSelectorsInput struct { - _ struct{} `type:"structure"` - - // Specifies the name of the trail or trail ARN. If you specify a trail name, - // the string must meet the following requirements: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores - // (_), or dashes (-) - // - // * Start with a letter or number, and end with a letter or number - // - // * Be between 3 and 128 characters - // - // * Have no adjacent periods, underscores or dashes. Names like my-_namespace - // and my--namespace are not valid. - // - // * Not be in IP address format (for example, 192.168.5.4) - // - // If you specify a trail ARN, it must be in the format: - // - // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail - // - // TrailName is a required field - TrailName *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetEventSelectorsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetEventSelectorsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetEventSelectorsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetEventSelectorsInput"} - if s.TrailName == nil { - invalidParams.Add(request.NewErrParamRequired("TrailName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTrailName sets the TrailName field's value. -func (s *GetEventSelectorsInput) SetTrailName(v string) *GetEventSelectorsInput { - s.TrailName = &v - return s -} - -type GetEventSelectorsOutput struct { - _ struct{} `type:"structure"` - - // The advanced event selectors that are configured for the trail. - AdvancedEventSelectors []*AdvancedEventSelector `type:"list"` - - // The event selectors that are configured for the trail. - EventSelectors []*EventSelector `type:"list"` - - // The specified trail ARN that has the event selectors. - TrailARN *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetEventSelectorsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetEventSelectorsOutput) GoString() string { - return s.String() -} - -// SetAdvancedEventSelectors sets the AdvancedEventSelectors field's value. -func (s *GetEventSelectorsOutput) SetAdvancedEventSelectors(v []*AdvancedEventSelector) *GetEventSelectorsOutput { - s.AdvancedEventSelectors = v - return s -} - -// SetEventSelectors sets the EventSelectors field's value. -func (s *GetEventSelectorsOutput) SetEventSelectors(v []*EventSelector) *GetEventSelectorsOutput { - s.EventSelectors = v - return s -} - -// SetTrailARN sets the TrailARN field's value. -func (s *GetEventSelectorsOutput) SetTrailARN(v string) *GetEventSelectorsOutput { - s.TrailARN = &v - return s -} - -type GetImportInput struct { - _ struct{} `type:"structure"` - - // The ID for the import. - // - // ImportId is a required field - ImportId *string `min:"36" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetImportInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetImportInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetImportInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetImportInput"} - if s.ImportId == nil { - invalidParams.Add(request.NewErrParamRequired("ImportId")) - } - if s.ImportId != nil && len(*s.ImportId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ImportId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetImportId sets the ImportId field's value. -func (s *GetImportInput) SetImportId(v string) *GetImportInput { - s.ImportId = &v - return s -} - -type GetImportOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of the import's creation. - CreatedTimestamp *time.Time `type:"timestamp"` - - // The ARN of the destination event data store. - Destinations []*string `min:"1" type:"list"` - - // Used with StartEventTime to bound a StartImport request, and limit imported - // trail events to only those events logged within a specified time period. - EndEventTime *time.Time `type:"timestamp"` - - // The ID of the import. - ImportId *string `min:"36" type:"string"` - - // The source S3 bucket. - ImportSource *ImportSource `type:"structure"` - - // Provides statistics for the import. CloudTrail does not update import statistics - // in real-time. Returned values for parameters such as EventsCompleted may - // be lower than the actual value, because CloudTrail updates statistics incrementally - // over the course of the import. - ImportStatistics *ImportStatistics `type:"structure"` - - // The status of the import. - ImportStatus *string `type:"string" enum:"ImportStatus"` - - // Used with EndEventTime to bound a StartImport request, and limit imported - // trail events to only those events logged within a specified time period. - StartEventTime *time.Time `type:"timestamp"` - - // The timestamp of when the import was updated. - UpdatedTimestamp *time.Time `type:"timestamp"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetImportOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetImportOutput) GoString() string { - return s.String() -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *GetImportOutput) SetCreatedTimestamp(v time.Time) *GetImportOutput { - s.CreatedTimestamp = &v - return s -} - -// SetDestinations sets the Destinations field's value. -func (s *GetImportOutput) SetDestinations(v []*string) *GetImportOutput { - s.Destinations = v - return s -} - -// SetEndEventTime sets the EndEventTime field's value. -func (s *GetImportOutput) SetEndEventTime(v time.Time) *GetImportOutput { - s.EndEventTime = &v - return s -} - -// SetImportId sets the ImportId field's value. -func (s *GetImportOutput) SetImportId(v string) *GetImportOutput { - s.ImportId = &v - return s -} - -// SetImportSource sets the ImportSource field's value. -func (s *GetImportOutput) SetImportSource(v *ImportSource) *GetImportOutput { - s.ImportSource = v - return s -} - -// SetImportStatistics sets the ImportStatistics field's value. -func (s *GetImportOutput) SetImportStatistics(v *ImportStatistics) *GetImportOutput { - s.ImportStatistics = v - return s -} - -// SetImportStatus sets the ImportStatus field's value. -func (s *GetImportOutput) SetImportStatus(v string) *GetImportOutput { - s.ImportStatus = &v - return s -} - -// SetStartEventTime sets the StartEventTime field's value. -func (s *GetImportOutput) SetStartEventTime(v time.Time) *GetImportOutput { - s.StartEventTime = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *GetImportOutput) SetUpdatedTimestamp(v time.Time) *GetImportOutput { - s.UpdatedTimestamp = &v - return s -} - -type GetInsightSelectorsInput struct { - _ struct{} `type:"structure"` - - // Specifies the name of the trail or trail ARN. If you specify a trail name, - // the string must meet the following requirements: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores - // (_), or dashes (-) - // - // * Start with a letter or number, and end with a letter or number - // - // * Be between 3 and 128 characters - // - // * Have no adjacent periods, underscores or dashes. Names like my-_namespace - // and my--namespace are not valid. - // - // * Not be in IP address format (for example, 192.168.5.4) - // - // If you specify a trail ARN, it must be in the format: - // - // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail - // - // TrailName is a required field - TrailName *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetInsightSelectorsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetInsightSelectorsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetInsightSelectorsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetInsightSelectorsInput"} - if s.TrailName == nil { - invalidParams.Add(request.NewErrParamRequired("TrailName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTrailName sets the TrailName field's value. -func (s *GetInsightSelectorsInput) SetTrailName(v string) *GetInsightSelectorsInput { - s.TrailName = &v - return s -} - -type GetInsightSelectorsOutput struct { - _ struct{} `type:"structure"` - - // A JSON string that contains the insight types you want to log on a trail. - // In this release, ApiErrorRateInsight and ApiCallRateInsight are supported - // as insight types. - InsightSelectors []*InsightSelector `type:"list"` - - // The Amazon Resource Name (ARN) of a trail for which you want to get Insights - // selectors. - TrailARN *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetInsightSelectorsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetInsightSelectorsOutput) GoString() string { - return s.String() -} - -// SetInsightSelectors sets the InsightSelectors field's value. -func (s *GetInsightSelectorsOutput) SetInsightSelectors(v []*InsightSelector) *GetInsightSelectorsOutput { - s.InsightSelectors = v - return s -} - -// SetTrailARN sets the TrailARN field's value. -func (s *GetInsightSelectorsOutput) SetTrailARN(v string) *GetInsightSelectorsOutput { - s.TrailARN = &v - return s -} - -type GetQueryResultsInput struct { - _ struct{} `type:"structure"` - - // The ARN (or ID suffix of the ARN) of the event data store against which the - // query was run. - // - // Deprecated: EventDataStore is no longer required by GetQueryResultsRequest - EventDataStore *string `min:"3" deprecated:"true" type:"string"` - - // The maximum number of query results to display on a single page. - MaxQueryResults *int64 `min:"1" type:"integer"` - - // A token you can use to get the next page of query results. - NextToken *string `min:"4" type:"string"` - - // The ID of the query for which you want to get results. - // - // QueryId is a required field - QueryId *string `min:"36" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetQueryResultsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetQueryResultsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetQueryResultsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetQueryResultsInput"} - if s.EventDataStore != nil && len(*s.EventDataStore) < 3 { - invalidParams.Add(request.NewErrParamMinLen("EventDataStore", 3)) - } - if s.MaxQueryResults != nil && *s.MaxQueryResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxQueryResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 4 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 4)) - } - if s.QueryId == nil { - invalidParams.Add(request.NewErrParamRequired("QueryId")) - } - if s.QueryId != nil && len(*s.QueryId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("QueryId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEventDataStore sets the EventDataStore field's value. -func (s *GetQueryResultsInput) SetEventDataStore(v string) *GetQueryResultsInput { - s.EventDataStore = &v - return s -} - -// SetMaxQueryResults sets the MaxQueryResults field's value. -func (s *GetQueryResultsInput) SetMaxQueryResults(v int64) *GetQueryResultsInput { - s.MaxQueryResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetQueryResultsInput) SetNextToken(v string) *GetQueryResultsInput { - s.NextToken = &v - return s -} - -// SetQueryId sets the QueryId field's value. -func (s *GetQueryResultsInput) SetQueryId(v string) *GetQueryResultsInput { - s.QueryId = &v - return s -} - -type GetQueryResultsOutput struct { - _ struct{} `type:"structure"` - - // The error message returned if a query failed. - ErrorMessage *string `min:"4" type:"string"` - - // A token you can use to get the next page of query results. - NextToken *string `min:"4" type:"string"` - - // Contains the individual event results of the query. - QueryResultRows [][]map[string]*string `type:"list"` - - // Shows the count of query results. - QueryStatistics *QueryStatistics `type:"structure"` - - // The status of the query. Values include QUEUED, RUNNING, FINISHED, FAILED, - // TIMED_OUT, or CANCELLED. - QueryStatus *string `type:"string" enum:"QueryStatus"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetQueryResultsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetQueryResultsOutput) GoString() string { - return s.String() -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *GetQueryResultsOutput) SetErrorMessage(v string) *GetQueryResultsOutput { - s.ErrorMessage = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *GetQueryResultsOutput) SetNextToken(v string) *GetQueryResultsOutput { - s.NextToken = &v - return s -} - -// SetQueryResultRows sets the QueryResultRows field's value. -func (s *GetQueryResultsOutput) SetQueryResultRows(v [][]map[string]*string) *GetQueryResultsOutput { - s.QueryResultRows = v - return s -} - -// SetQueryStatistics sets the QueryStatistics field's value. -func (s *GetQueryResultsOutput) SetQueryStatistics(v *QueryStatistics) *GetQueryResultsOutput { - s.QueryStatistics = v - return s -} - -// SetQueryStatus sets the QueryStatus field's value. -func (s *GetQueryResultsOutput) SetQueryStatus(v string) *GetQueryResultsOutput { - s.QueryStatus = &v - return s -} - -type GetResourcePolicyInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the CloudTrail channel attached to the - // resource-based policy. The following is the format of a resource ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/MyChannel. - // - // ResourceArn is a required field - ResourceArn *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetResourcePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetResourcePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetResourcePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetResourcePolicyInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 3 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *GetResourcePolicyInput) SetResourceArn(v string) *GetResourcePolicyInput { - s.ResourceArn = &v - return s -} - -type GetResourcePolicyOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the CloudTrail channel attached to resource-based - // policy. - ResourceArn *string `min:"3" type:"string"` - - // A JSON-formatted string that contains the resource-based policy attached - // to the CloudTrail channel. - ResourcePolicy *string `min:"1" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetResourcePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetResourcePolicyOutput) GoString() string { - return s.String() -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *GetResourcePolicyOutput) SetResourceArn(v string) *GetResourcePolicyOutput { - s.ResourceArn = &v - return s -} - -// SetResourcePolicy sets the ResourcePolicy field's value. -func (s *GetResourcePolicyOutput) SetResourcePolicy(v string) *GetResourcePolicyOutput { - s.ResourcePolicy = &v - return s -} - -type GetTrailInput struct { - _ struct{} `type:"structure"` - - // The name or the Amazon Resource Name (ARN) of the trail for which you want - // to retrieve settings information. - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetTrailInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetTrailInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTrailInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTrailInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *GetTrailInput) SetName(v string) *GetTrailInput { - s.Name = &v - return s -} - -type GetTrailOutput struct { - _ struct{} `type:"structure"` - - // The settings for a trail. - Trail *Trail `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetTrailOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetTrailOutput) GoString() string { - return s.String() -} - -// SetTrail sets the Trail field's value. -func (s *GetTrailOutput) SetTrail(v *Trail) *GetTrailOutput { - s.Trail = v - return s -} - -// The name of a trail about which you want the current status. -type GetTrailStatusInput struct { - _ struct{} `type:"structure"` - - // Specifies the name or the CloudTrail ARN of the trail for which you are requesting - // status. To get the status of a shadow trail (a replication of the trail in - // another region), you must specify its ARN. The following is the format of - // a trail ARN. - // - // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetTrailStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetTrailStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTrailStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTrailStatusInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *GetTrailStatusInput) SetName(v string) *GetTrailStatusInput { - s.Name = &v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -type GetTrailStatusOutput struct { - _ struct{} `type:"structure"` - - // Whether the CloudTrail trail is currently logging Amazon Web Services API - // calls. - IsLogging *bool `type:"boolean"` - - // Displays any CloudWatch Logs error that CloudTrail encountered when attempting - // to deliver logs to CloudWatch Logs. - LatestCloudWatchLogsDeliveryError *string `type:"string"` - - // Displays the most recent date and time when CloudTrail delivered logs to - // CloudWatch Logs. - LatestCloudWatchLogsDeliveryTime *time.Time `type:"timestamp"` - - // This field is no longer in use. - LatestDeliveryAttemptSucceeded *string `type:"string"` - - // This field is no longer in use. - LatestDeliveryAttemptTime *string `type:"string"` - - // Displays any Amazon S3 error that CloudTrail encountered when attempting - // to deliver log files to the designated bucket. For more information, see - // Error Responses (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html) - // in the Amazon S3 API Reference. - // - // This error occurs only when there is a problem with the destination S3 bucket, - // and does not occur for requests that time out. To resolve the issue, create - // a new bucket, and then call UpdateTrail to specify the new bucket; or fix - // the existing objects so that CloudTrail can again write to the bucket. - LatestDeliveryError *string `type:"string"` - - // Specifies the date and time that CloudTrail last delivered log files to an - // account's Amazon S3 bucket. - LatestDeliveryTime *time.Time `type:"timestamp"` - - // Displays any Amazon S3 error that CloudTrail encountered when attempting - // to deliver a digest file to the designated bucket. For more information, - // see Error Responses (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html) - // in the Amazon S3 API Reference. - // - // This error occurs only when there is a problem with the destination S3 bucket, - // and does not occur for requests that time out. To resolve the issue, create - // a new bucket, and then call UpdateTrail to specify the new bucket; or fix - // the existing objects so that CloudTrail can again write to the bucket. - LatestDigestDeliveryError *string `type:"string"` - - // Specifies the date and time that CloudTrail last delivered a digest file - // to an account's Amazon S3 bucket. - LatestDigestDeliveryTime *time.Time `type:"timestamp"` - - // This field is no longer in use. - LatestNotificationAttemptSucceeded *string `type:"string"` - - // This field is no longer in use. - LatestNotificationAttemptTime *string `type:"string"` - - // Displays any Amazon SNS error that CloudTrail encountered when attempting - // to send a notification. For more information about Amazon SNS errors, see - // the Amazon SNS Developer Guide (https://docs.aws.amazon.com/sns/latest/dg/welcome.html). - LatestNotificationError *string `type:"string"` - - // Specifies the date and time of the most recent Amazon SNS notification that - // CloudTrail has written a new log file to an account's Amazon S3 bucket. - LatestNotificationTime *time.Time `type:"timestamp"` - - // Specifies the most recent date and time when CloudTrail started recording - // API calls for an Amazon Web Services account. - StartLoggingTime *time.Time `type:"timestamp"` - - // Specifies the most recent date and time when CloudTrail stopped recording - // API calls for an Amazon Web Services account. - StopLoggingTime *time.Time `type:"timestamp"` - - // This field is no longer in use. - TimeLoggingStarted *string `type:"string"` - - // This field is no longer in use. - TimeLoggingStopped *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetTrailStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetTrailStatusOutput) GoString() string { - return s.String() -} - -// SetIsLogging sets the IsLogging field's value. -func (s *GetTrailStatusOutput) SetIsLogging(v bool) *GetTrailStatusOutput { - s.IsLogging = &v - return s -} - -// SetLatestCloudWatchLogsDeliveryError sets the LatestCloudWatchLogsDeliveryError field's value. -func (s *GetTrailStatusOutput) SetLatestCloudWatchLogsDeliveryError(v string) *GetTrailStatusOutput { - s.LatestCloudWatchLogsDeliveryError = &v - return s -} - -// SetLatestCloudWatchLogsDeliveryTime sets the LatestCloudWatchLogsDeliveryTime field's value. -func (s *GetTrailStatusOutput) SetLatestCloudWatchLogsDeliveryTime(v time.Time) *GetTrailStatusOutput { - s.LatestCloudWatchLogsDeliveryTime = &v - return s -} - -// SetLatestDeliveryAttemptSucceeded sets the LatestDeliveryAttemptSucceeded field's value. -func (s *GetTrailStatusOutput) SetLatestDeliveryAttemptSucceeded(v string) *GetTrailStatusOutput { - s.LatestDeliveryAttemptSucceeded = &v - return s -} - -// SetLatestDeliveryAttemptTime sets the LatestDeliveryAttemptTime field's value. -func (s *GetTrailStatusOutput) SetLatestDeliveryAttemptTime(v string) *GetTrailStatusOutput { - s.LatestDeliveryAttemptTime = &v - return s -} - -// SetLatestDeliveryError sets the LatestDeliveryError field's value. -func (s *GetTrailStatusOutput) SetLatestDeliveryError(v string) *GetTrailStatusOutput { - s.LatestDeliveryError = &v - return s -} - -// SetLatestDeliveryTime sets the LatestDeliveryTime field's value. -func (s *GetTrailStatusOutput) SetLatestDeliveryTime(v time.Time) *GetTrailStatusOutput { - s.LatestDeliveryTime = &v - return s -} - -// SetLatestDigestDeliveryError sets the LatestDigestDeliveryError field's value. -func (s *GetTrailStatusOutput) SetLatestDigestDeliveryError(v string) *GetTrailStatusOutput { - s.LatestDigestDeliveryError = &v - return s -} - -// SetLatestDigestDeliveryTime sets the LatestDigestDeliveryTime field's value. -func (s *GetTrailStatusOutput) SetLatestDigestDeliveryTime(v time.Time) *GetTrailStatusOutput { - s.LatestDigestDeliveryTime = &v - return s -} - -// SetLatestNotificationAttemptSucceeded sets the LatestNotificationAttemptSucceeded field's value. -func (s *GetTrailStatusOutput) SetLatestNotificationAttemptSucceeded(v string) *GetTrailStatusOutput { - s.LatestNotificationAttemptSucceeded = &v - return s -} - -// SetLatestNotificationAttemptTime sets the LatestNotificationAttemptTime field's value. -func (s *GetTrailStatusOutput) SetLatestNotificationAttemptTime(v string) *GetTrailStatusOutput { - s.LatestNotificationAttemptTime = &v - return s -} - -// SetLatestNotificationError sets the LatestNotificationError field's value. -func (s *GetTrailStatusOutput) SetLatestNotificationError(v string) *GetTrailStatusOutput { - s.LatestNotificationError = &v - return s -} - -// SetLatestNotificationTime sets the LatestNotificationTime field's value. -func (s *GetTrailStatusOutput) SetLatestNotificationTime(v time.Time) *GetTrailStatusOutput { - s.LatestNotificationTime = &v - return s -} - -// SetStartLoggingTime sets the StartLoggingTime field's value. -func (s *GetTrailStatusOutput) SetStartLoggingTime(v time.Time) *GetTrailStatusOutput { - s.StartLoggingTime = &v - return s -} - -// SetStopLoggingTime sets the StopLoggingTime field's value. -func (s *GetTrailStatusOutput) SetStopLoggingTime(v time.Time) *GetTrailStatusOutput { - s.StopLoggingTime = &v - return s -} - -// SetTimeLoggingStarted sets the TimeLoggingStarted field's value. -func (s *GetTrailStatusOutput) SetTimeLoggingStarted(v string) *GetTrailStatusOutput { - s.TimeLoggingStarted = &v - return s -} - -// SetTimeLoggingStopped sets the TimeLoggingStopped field's value. -func (s *GetTrailStatusOutput) SetTimeLoggingStopped(v string) *GetTrailStatusOutput { - s.TimeLoggingStopped = &v - return s -} - -// Provides information about an import failure. -type ImportFailureListItem struct { - _ struct{} `type:"structure"` - - // Provides the reason the import failed. - ErrorMessage *string `type:"string"` - - // The type of import error. - ErrorType *string `type:"string"` - - // When the import was last updated. - LastUpdatedTime *time.Time `type:"timestamp"` - - // The location of the failure in the S3 bucket. - Location *string `type:"string"` - - // The status of the import. - Status *string `type:"string" enum:"ImportFailureStatus"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ImportFailureListItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ImportFailureListItem) GoString() string { - return s.String() -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *ImportFailureListItem) SetErrorMessage(v string) *ImportFailureListItem { - s.ErrorMessage = &v - return s -} - -// SetErrorType sets the ErrorType field's value. -func (s *ImportFailureListItem) SetErrorType(v string) *ImportFailureListItem { - s.ErrorType = &v - return s -} - -// SetLastUpdatedTime sets the LastUpdatedTime field's value. -func (s *ImportFailureListItem) SetLastUpdatedTime(v time.Time) *ImportFailureListItem { - s.LastUpdatedTime = &v - return s -} - -// SetLocation sets the Location field's value. -func (s *ImportFailureListItem) SetLocation(v string) *ImportFailureListItem { - s.Location = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *ImportFailureListItem) SetStatus(v string) *ImportFailureListItem { - s.Status = &v - return s -} - -// The specified import was not found. -type ImportNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ImportNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ImportNotFoundException) GoString() string { - return s.String() -} - -func newErrorImportNotFoundException(v protocol.ResponseMetadata) error { - return &ImportNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ImportNotFoundException) Code() string { - return "ImportNotFoundException" -} - -// Message returns the exception's message. -func (s *ImportNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ImportNotFoundException) OrigErr() error { - return nil -} - -func (s *ImportNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ImportNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ImportNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The import source. -type ImportSource struct { - _ struct{} `type:"structure"` - - // The source S3 bucket. - // - // S3 is a required field - S3 *S3ImportSource `type:"structure" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ImportSource) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ImportSource) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ImportSource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ImportSource"} - if s.S3 == nil { - invalidParams.Add(request.NewErrParamRequired("S3")) - } - if s.S3 != nil { - if err := s.S3.Validate(); err != nil { - invalidParams.AddNested("S3", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3 sets the S3 field's value. -func (s *ImportSource) SetS3(v *S3ImportSource) *ImportSource { - s.S3 = v - return s -} - -// Provides statistics for the specified ImportID. CloudTrail does not update -// import statistics in real-time. Returned values for parameters such as EventsCompleted -// may be lower than the actual value, because CloudTrail updates statistics -// incrementally over the course of the import. -type ImportStatistics struct { - _ struct{} `type:"structure"` - - // The number of trail events imported into the event data store. - EventsCompleted *int64 `type:"long"` - - // The number of failed entries. - FailedEntries *int64 `type:"long"` - - // The number of log files that completed import. - FilesCompleted *int64 `type:"long"` - - // The number of S3 prefixes that completed import. - PrefixesCompleted *int64 `type:"long"` - - // The number of S3 prefixes found for the import. - PrefixesFound *int64 `type:"long"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ImportStatistics) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ImportStatistics) GoString() string { - return s.String() -} - -// SetEventsCompleted sets the EventsCompleted field's value. -func (s *ImportStatistics) SetEventsCompleted(v int64) *ImportStatistics { - s.EventsCompleted = &v - return s -} - -// SetFailedEntries sets the FailedEntries field's value. -func (s *ImportStatistics) SetFailedEntries(v int64) *ImportStatistics { - s.FailedEntries = &v - return s -} - -// SetFilesCompleted sets the FilesCompleted field's value. -func (s *ImportStatistics) SetFilesCompleted(v int64) *ImportStatistics { - s.FilesCompleted = &v - return s -} - -// SetPrefixesCompleted sets the PrefixesCompleted field's value. -func (s *ImportStatistics) SetPrefixesCompleted(v int64) *ImportStatistics { - s.PrefixesCompleted = &v - return s -} - -// SetPrefixesFound sets the PrefixesFound field's value. -func (s *ImportStatistics) SetPrefixesFound(v int64) *ImportStatistics { - s.PrefixesFound = &v - return s -} - -// Contains information about an import that was returned by a lookup request. -type ImportsListItem struct { - _ struct{} `type:"structure"` - - // The timestamp of the import's creation. - CreatedTimestamp *time.Time `type:"timestamp"` - - // The ARN of the destination event data store. - Destinations []*string `min:"1" type:"list"` - - // The ID of the import. - ImportId *string `min:"36" type:"string"` - - // The status of the import. - ImportStatus *string `type:"string" enum:"ImportStatus"` - - // The timestamp of the import's last update. - UpdatedTimestamp *time.Time `type:"timestamp"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ImportsListItem) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ImportsListItem) GoString() string { - return s.String() -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *ImportsListItem) SetCreatedTimestamp(v time.Time) *ImportsListItem { - s.CreatedTimestamp = &v - return s -} - -// SetDestinations sets the Destinations field's value. -func (s *ImportsListItem) SetDestinations(v []*string) *ImportsListItem { - s.Destinations = v - return s -} - -// SetImportId sets the ImportId field's value. -func (s *ImportsListItem) SetImportId(v string) *ImportsListItem { - s.ImportId = &v - return s -} - -// SetImportStatus sets the ImportStatus field's value. -func (s *ImportsListItem) SetImportStatus(v string) *ImportsListItem { - s.ImportStatus = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *ImportsListItem) SetUpdatedTimestamp(v time.Time) *ImportsListItem { - s.UpdatedTimestamp = &v - return s -} - -// The event data store is inactive. -type InactiveEventDataStoreException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InactiveEventDataStoreException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InactiveEventDataStoreException) GoString() string { - return s.String() -} - -func newErrorInactiveEventDataStoreException(v protocol.ResponseMetadata) error { - return &InactiveEventDataStoreException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InactiveEventDataStoreException) Code() string { - return "InactiveEventDataStoreException" -} - -// Message returns the exception's message. -func (s *InactiveEventDataStoreException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InactiveEventDataStoreException) OrigErr() error { - return nil -} - -func (s *InactiveEventDataStoreException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InactiveEventDataStoreException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InactiveEventDataStoreException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The specified query cannot be canceled because it is in the FINISHED, FAILED, -// TIMED_OUT, or CANCELLED state. -type InactiveQueryException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InactiveQueryException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InactiveQueryException) GoString() string { - return s.String() -} - -func newErrorInactiveQueryException(v protocol.ResponseMetadata) error { - return &InactiveQueryException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InactiveQueryException) Code() string { - return "InactiveQueryException" -} - -// Message returns the exception's message. -func (s *InactiveQueryException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InactiveQueryException) OrigErr() error { - return nil -} - -func (s *InactiveQueryException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InactiveQueryException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InactiveQueryException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A table showing information about the most recent successful and failed attempts -// to ingest events. -type IngestionStatus struct { - _ struct{} `type:"structure"` - - // The event ID of the most recent attempt to ingest events. - LatestIngestionAttemptEventID *string `min:"36" type:"string"` - - // The time stamp of the most recent attempt to ingest events on the channel. - LatestIngestionAttemptTime *time.Time `type:"timestamp"` - - // The error code for the most recent failure to ingest events. - LatestIngestionErrorCode *string `min:"4" type:"string"` - - // The event ID of the most recent successful ingestion of events. - LatestIngestionSuccessEventID *string `min:"36" type:"string"` - - // The time stamp of the most recent successful ingestion of events for the - // channel. - LatestIngestionSuccessTime *time.Time `type:"timestamp"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s IngestionStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s IngestionStatus) GoString() string { - return s.String() -} - -// SetLatestIngestionAttemptEventID sets the LatestIngestionAttemptEventID field's value. -func (s *IngestionStatus) SetLatestIngestionAttemptEventID(v string) *IngestionStatus { - s.LatestIngestionAttemptEventID = &v - return s -} - -// SetLatestIngestionAttemptTime sets the LatestIngestionAttemptTime field's value. -func (s *IngestionStatus) SetLatestIngestionAttemptTime(v time.Time) *IngestionStatus { - s.LatestIngestionAttemptTime = &v - return s -} - -// SetLatestIngestionErrorCode sets the LatestIngestionErrorCode field's value. -func (s *IngestionStatus) SetLatestIngestionErrorCode(v string) *IngestionStatus { - s.LatestIngestionErrorCode = &v - return s -} - -// SetLatestIngestionSuccessEventID sets the LatestIngestionSuccessEventID field's value. -func (s *IngestionStatus) SetLatestIngestionSuccessEventID(v string) *IngestionStatus { - s.LatestIngestionSuccessEventID = &v - return s -} - -// SetLatestIngestionSuccessTime sets the LatestIngestionSuccessTime field's value. -func (s *IngestionStatus) SetLatestIngestionSuccessTime(v time.Time) *IngestionStatus { - s.LatestIngestionSuccessTime = &v - return s -} - -// If you run GetInsightSelectors on a trail that does not have Insights events -// enabled, the operation throws the exception InsightNotEnabledException. -type InsightNotEnabledException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InsightNotEnabledException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InsightNotEnabledException) GoString() string { - return s.String() -} - -func newErrorInsightNotEnabledException(v protocol.ResponseMetadata) error { - return &InsightNotEnabledException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InsightNotEnabledException) Code() string { - return "InsightNotEnabledException" -} - -// Message returns the exception's message. -func (s *InsightNotEnabledException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InsightNotEnabledException) OrigErr() error { - return nil -} - -func (s *InsightNotEnabledException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InsightNotEnabledException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InsightNotEnabledException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A JSON string that contains a list of insight types that are logged on a -// trail. -type InsightSelector struct { - _ struct{} `type:"structure"` - - // The type of insights to log on a trail. ApiCallRateInsight and ApiErrorRateInsight - // are valid insight types. - InsightType *string `type:"string" enum:"InsightType"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InsightSelector) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InsightSelector) GoString() string { - return s.String() -} - -// SetInsightType sets the InsightType field's value. -func (s *InsightSelector) SetInsightType(v string) *InsightSelector { - s.InsightType = &v - return s -} - -// This exception is thrown when the IAM user or role that is used to create -// the organization resource lacks one or more required permissions for creating -// an organization resource in a required service. -type InsufficientDependencyServiceAccessPermissionException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InsufficientDependencyServiceAccessPermissionException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InsufficientDependencyServiceAccessPermissionException) GoString() string { - return s.String() -} - -func newErrorInsufficientDependencyServiceAccessPermissionException(v protocol.ResponseMetadata) error { - return &InsufficientDependencyServiceAccessPermissionException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InsufficientDependencyServiceAccessPermissionException) Code() string { - return "InsufficientDependencyServiceAccessPermissionException" -} - -// Message returns the exception's message. -func (s *InsufficientDependencyServiceAccessPermissionException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InsufficientDependencyServiceAccessPermissionException) OrigErr() error { - return nil -} - -func (s *InsufficientDependencyServiceAccessPermissionException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InsufficientDependencyServiceAccessPermissionException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InsufficientDependencyServiceAccessPermissionException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the policy on the S3 bucket or KMS key does -// not have sufficient permissions for the operation. -type InsufficientEncryptionPolicyException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InsufficientEncryptionPolicyException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InsufficientEncryptionPolicyException) GoString() string { - return s.String() -} - -func newErrorInsufficientEncryptionPolicyException(v protocol.ResponseMetadata) error { - return &InsufficientEncryptionPolicyException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InsufficientEncryptionPolicyException) Code() string { - return "InsufficientEncryptionPolicyException" -} - -// Message returns the exception's message. -func (s *InsufficientEncryptionPolicyException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InsufficientEncryptionPolicyException) OrigErr() error { - return nil -} - -func (s *InsufficientEncryptionPolicyException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InsufficientEncryptionPolicyException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InsufficientEncryptionPolicyException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the policy on the S3 bucket is not sufficient. -type InsufficientS3BucketPolicyException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InsufficientS3BucketPolicyException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InsufficientS3BucketPolicyException) GoString() string { - return s.String() -} - -func newErrorInsufficientS3BucketPolicyException(v protocol.ResponseMetadata) error { - return &InsufficientS3BucketPolicyException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InsufficientS3BucketPolicyException) Code() string { - return "InsufficientS3BucketPolicyException" -} - -// Message returns the exception's message. -func (s *InsufficientS3BucketPolicyException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InsufficientS3BucketPolicyException) OrigErr() error { - return nil -} - -func (s *InsufficientS3BucketPolicyException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InsufficientS3BucketPolicyException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InsufficientS3BucketPolicyException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the policy on the Amazon SNS topic is not sufficient. -type InsufficientSnsTopicPolicyException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InsufficientSnsTopicPolicyException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InsufficientSnsTopicPolicyException) GoString() string { - return s.String() -} - -func newErrorInsufficientSnsTopicPolicyException(v protocol.ResponseMetadata) error { - return &InsufficientSnsTopicPolicyException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InsufficientSnsTopicPolicyException) Code() string { - return "InsufficientSnsTopicPolicyException" -} - -// Message returns the exception's message. -func (s *InsufficientSnsTopicPolicyException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InsufficientSnsTopicPolicyException) OrigErr() error { - return nil -} - -func (s *InsufficientSnsTopicPolicyException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InsufficientSnsTopicPolicyException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InsufficientSnsTopicPolicyException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the provided CloudWatch Logs log group is not -// valid. -type InvalidCloudWatchLogsLogGroupArnException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidCloudWatchLogsLogGroupArnException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidCloudWatchLogsLogGroupArnException) GoString() string { - return s.String() -} - -func newErrorInvalidCloudWatchLogsLogGroupArnException(v protocol.ResponseMetadata) error { - return &InvalidCloudWatchLogsLogGroupArnException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidCloudWatchLogsLogGroupArnException) Code() string { - return "InvalidCloudWatchLogsLogGroupArnException" -} - -// Message returns the exception's message. -func (s *InvalidCloudWatchLogsLogGroupArnException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidCloudWatchLogsLogGroupArnException) OrigErr() error { - return nil -} - -func (s *InvalidCloudWatchLogsLogGroupArnException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidCloudWatchLogsLogGroupArnException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidCloudWatchLogsLogGroupArnException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the provided role is not valid. -type InvalidCloudWatchLogsRoleArnException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidCloudWatchLogsRoleArnException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidCloudWatchLogsRoleArnException) GoString() string { - return s.String() -} - -func newErrorInvalidCloudWatchLogsRoleArnException(v protocol.ResponseMetadata) error { - return &InvalidCloudWatchLogsRoleArnException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidCloudWatchLogsRoleArnException) Code() string { - return "InvalidCloudWatchLogsRoleArnException" -} - -// Message returns the exception's message. -func (s *InvalidCloudWatchLogsRoleArnException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidCloudWatchLogsRoleArnException) OrigErr() error { - return nil -} - -func (s *InvalidCloudWatchLogsRoleArnException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidCloudWatchLogsRoleArnException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidCloudWatchLogsRoleArnException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A date range for the query was specified that is not valid. Be sure that -// the start time is chronologically before the end time. For more information -// about writing a query, see Create or edit a query (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-create-edit-query.html) -// in the CloudTrail User Guide. -type InvalidDateRangeException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidDateRangeException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidDateRangeException) GoString() string { - return s.String() -} - -func newErrorInvalidDateRangeException(v protocol.ResponseMetadata) error { - return &InvalidDateRangeException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidDateRangeException) Code() string { - return "InvalidDateRangeException" -} - -// Message returns the exception's message. -func (s *InvalidDateRangeException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidDateRangeException) OrigErr() error { - return nil -} - -func (s *InvalidDateRangeException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidDateRangeException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidDateRangeException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Occurs if an event category that is not valid is specified as a value of -// EventCategory. -type InvalidEventCategoryException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidEventCategoryException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidEventCategoryException) GoString() string { - return s.String() -} - -func newErrorInvalidEventCategoryException(v protocol.ResponseMetadata) error { - return &InvalidEventCategoryException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidEventCategoryException) Code() string { - return "InvalidEventCategoryException" -} - -// Message returns the exception's message. -func (s *InvalidEventCategoryException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidEventCategoryException) OrigErr() error { - return nil -} - -func (s *InvalidEventCategoryException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidEventCategoryException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidEventCategoryException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when event categories of specified event data stores -// are not valid. -type InvalidEventDataStoreCategoryException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidEventDataStoreCategoryException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidEventDataStoreCategoryException) GoString() string { - return s.String() -} - -func newErrorInvalidEventDataStoreCategoryException(v protocol.ResponseMetadata) error { - return &InvalidEventDataStoreCategoryException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidEventDataStoreCategoryException) Code() string { - return "InvalidEventDataStoreCategoryException" -} - -// Message returns the exception's message. -func (s *InvalidEventDataStoreCategoryException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidEventDataStoreCategoryException) OrigErr() error { - return nil -} - -func (s *InvalidEventDataStoreCategoryException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidEventDataStoreCategoryException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidEventDataStoreCategoryException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The event data store is not in a status that supports the operation. -type InvalidEventDataStoreStatusException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidEventDataStoreStatusException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidEventDataStoreStatusException) GoString() string { - return s.String() -} - -func newErrorInvalidEventDataStoreStatusException(v protocol.ResponseMetadata) error { - return &InvalidEventDataStoreStatusException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidEventDataStoreStatusException) Code() string { - return "InvalidEventDataStoreStatusException" -} - -// Message returns the exception's message. -func (s *InvalidEventDataStoreStatusException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidEventDataStoreStatusException) OrigErr() error { - return nil -} - -func (s *InvalidEventDataStoreStatusException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidEventDataStoreStatusException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidEventDataStoreStatusException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the PutEventSelectors operation is called with -// a number of event selectors, advanced event selectors, or data resources -// that is not valid. The combination of event selectors or advanced event selectors -// and data resources is not valid. A trail can have up to 5 event selectors. -// If a trail uses advanced event selectors, a maximum of 500 total values for -// all conditions in all advanced event selectors is allowed. A trail is limited -// to 250 data resources. These data resources can be distributed across event -// selectors, but the overall total cannot exceed 250. -// -// You can: -// -// - Specify a valid number of event selectors (1 to 5) for a trail. -// -// - Specify a valid number of data resources (1 to 250) for an event selector. -// The limit of number of resources on an individual event selector is configurable -// up to 250. However, this upper limit is allowed only if the total number -// of data resources does not exceed 250 across all event selectors for a -// trail. -// -// - Specify up to 500 values for all conditions in all advanced event selectors -// for a trail. -// -// - Specify a valid value for a parameter. For example, specifying the ReadWriteType -// parameter with a value of read-only is not valid. -type InvalidEventSelectorsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidEventSelectorsException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidEventSelectorsException) GoString() string { - return s.String() -} - -func newErrorInvalidEventSelectorsException(v protocol.ResponseMetadata) error { - return &InvalidEventSelectorsException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidEventSelectorsException) Code() string { - return "InvalidEventSelectorsException" -} - -// Message returns the exception's message. -func (s *InvalidEventSelectorsException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidEventSelectorsException) OrigErr() error { - return nil -} - -func (s *InvalidEventSelectorsException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidEventSelectorsException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidEventSelectorsException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when an operation is called on a trail from a region -// other than the region in which the trail was created. -type InvalidHomeRegionException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidHomeRegionException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidHomeRegionException) GoString() string { - return s.String() -} - -func newErrorInvalidHomeRegionException(v protocol.ResponseMetadata) error { - return &InvalidHomeRegionException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidHomeRegionException) Code() string { - return "InvalidHomeRegionException" -} - -// Message returns the exception's message. -func (s *InvalidHomeRegionException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidHomeRegionException) OrigErr() error { - return nil -} - -func (s *InvalidHomeRegionException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidHomeRegionException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidHomeRegionException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the provided source S3 bucket is not valid -// for import. -type InvalidImportSourceException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidImportSourceException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidImportSourceException) GoString() string { - return s.String() -} - -func newErrorInvalidImportSourceException(v protocol.ResponseMetadata) error { - return &InvalidImportSourceException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidImportSourceException) Code() string { - return "InvalidImportSourceException" -} - -// Message returns the exception's message. -func (s *InvalidImportSourceException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidImportSourceException) OrigErr() error { - return nil -} - -func (s *InvalidImportSourceException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidImportSourceException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidImportSourceException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The formatting or syntax of the InsightSelectors JSON statement in your PutInsightSelectors -// or GetInsightSelectors request is not valid, or the specified insight type -// in the InsightSelectors statement is not a valid insight type. -type InvalidInsightSelectorsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidInsightSelectorsException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidInsightSelectorsException) GoString() string { - return s.String() -} - -func newErrorInvalidInsightSelectorsException(v protocol.ResponseMetadata) error { - return &InvalidInsightSelectorsException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidInsightSelectorsException) Code() string { - return "InvalidInsightSelectorsException" -} - -// Message returns the exception's message. -func (s *InvalidInsightSelectorsException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidInsightSelectorsException) OrigErr() error { - return nil -} - -func (s *InvalidInsightSelectorsException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidInsightSelectorsException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidInsightSelectorsException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the KMS key ARN is not valid. -type InvalidKmsKeyIdException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidKmsKeyIdException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidKmsKeyIdException) GoString() string { - return s.String() -} - -func newErrorInvalidKmsKeyIdException(v protocol.ResponseMetadata) error { - return &InvalidKmsKeyIdException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidKmsKeyIdException) Code() string { - return "InvalidKmsKeyIdException" -} - -// Message returns the exception's message. -func (s *InvalidKmsKeyIdException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidKmsKeyIdException) OrigErr() error { - return nil -} - -func (s *InvalidKmsKeyIdException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidKmsKeyIdException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidKmsKeyIdException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Occurs when a lookup attribute is specified that is not valid. -type InvalidLookupAttributesException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidLookupAttributesException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidLookupAttributesException) GoString() string { - return s.String() -} - -func newErrorInvalidLookupAttributesException(v protocol.ResponseMetadata) error { - return &InvalidLookupAttributesException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidLookupAttributesException) Code() string { - return "InvalidLookupAttributesException" -} - -// Message returns the exception's message. -func (s *InvalidLookupAttributesException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidLookupAttributesException) OrigErr() error { - return nil -} - -func (s *InvalidLookupAttributesException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidLookupAttributesException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidLookupAttributesException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown if the limit specified is not valid. -type InvalidMaxResultsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidMaxResultsException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidMaxResultsException) GoString() string { - return s.String() -} - -func newErrorInvalidMaxResultsException(v protocol.ResponseMetadata) error { - return &InvalidMaxResultsException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidMaxResultsException) Code() string { - return "InvalidMaxResultsException" -} - -// Message returns the exception's message. -func (s *InvalidMaxResultsException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidMaxResultsException) OrigErr() error { - return nil -} - -func (s *InvalidMaxResultsException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidMaxResultsException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidMaxResultsException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A token that is not valid, or a token that was previously used in a request -// with different parameters. This exception is thrown if the token is not valid. -type InvalidNextTokenException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidNextTokenException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidNextTokenException) GoString() string { - return s.String() -} - -func newErrorInvalidNextTokenException(v protocol.ResponseMetadata) error { - return &InvalidNextTokenException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidNextTokenException) Code() string { - return "InvalidNextTokenException" -} - -// Message returns the exception's message. -func (s *InvalidNextTokenException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidNextTokenException) OrigErr() error { - return nil -} - -func (s *InvalidNextTokenException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidNextTokenException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidNextTokenException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the combination of parameters provided is not -// valid. -type InvalidParameterCombinationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidParameterCombinationException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidParameterCombinationException) GoString() string { - return s.String() -} - -func newErrorInvalidParameterCombinationException(v protocol.ResponseMetadata) error { - return &InvalidParameterCombinationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidParameterCombinationException) Code() string { - return "InvalidParameterCombinationException" -} - -// Message returns the exception's message. -func (s *InvalidParameterCombinationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidParameterCombinationException) OrigErr() error { - return nil -} - -func (s *InvalidParameterCombinationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidParameterCombinationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidParameterCombinationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The request includes a parameter that is not valid. -type InvalidParameterException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidParameterException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidParameterException) GoString() string { - return s.String() -} - -func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { - return &InvalidParameterException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidParameterException) Code() string { - return "InvalidParameterException" -} - -// Message returns the exception's message. -func (s *InvalidParameterException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidParameterException) OrigErr() error { - return nil -} - -func (s *InvalidParameterException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidParameterException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidParameterException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The query that was submitted has validation errors, or uses incorrect syntax -// or unsupported keywords. For more information about writing a query, see -// Create or edit a query (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-create-edit-query.html) -// in the CloudTrail User Guide. -type InvalidQueryStatementException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidQueryStatementException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidQueryStatementException) GoString() string { - return s.String() -} - -func newErrorInvalidQueryStatementException(v protocol.ResponseMetadata) error { - return &InvalidQueryStatementException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidQueryStatementException) Code() string { - return "InvalidQueryStatementException" -} - -// Message returns the exception's message. -func (s *InvalidQueryStatementException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidQueryStatementException) OrigErr() error { - return nil -} - -func (s *InvalidQueryStatementException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidQueryStatementException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidQueryStatementException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The query status is not valid for the operation. -type InvalidQueryStatusException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidQueryStatusException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidQueryStatusException) GoString() string { - return s.String() -} - -func newErrorInvalidQueryStatusException(v protocol.ResponseMetadata) error { - return &InvalidQueryStatusException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidQueryStatusException) Code() string { - return "InvalidQueryStatusException" -} - -// Message returns the exception's message. -func (s *InvalidQueryStatusException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidQueryStatusException) OrigErr() error { - return nil -} - -func (s *InvalidQueryStatusException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidQueryStatusException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidQueryStatusException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the provided S3 bucket name is not valid. -type InvalidS3BucketNameException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidS3BucketNameException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidS3BucketNameException) GoString() string { - return s.String() -} - -func newErrorInvalidS3BucketNameException(v protocol.ResponseMetadata) error { - return &InvalidS3BucketNameException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidS3BucketNameException) Code() string { - return "InvalidS3BucketNameException" -} - -// Message returns the exception's message. -func (s *InvalidS3BucketNameException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidS3BucketNameException) OrigErr() error { - return nil -} - -func (s *InvalidS3BucketNameException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidS3BucketNameException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidS3BucketNameException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the provided S3 prefix is not valid. -type InvalidS3PrefixException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidS3PrefixException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidS3PrefixException) GoString() string { - return s.String() -} - -func newErrorInvalidS3PrefixException(v protocol.ResponseMetadata) error { - return &InvalidS3PrefixException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidS3PrefixException) Code() string { - return "InvalidS3PrefixException" -} - -// Message returns the exception's message. -func (s *InvalidS3PrefixException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidS3PrefixException) OrigErr() error { - return nil -} - -func (s *InvalidS3PrefixException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidS3PrefixException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidS3PrefixException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the provided SNS topic name is not valid. -type InvalidSnsTopicNameException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidSnsTopicNameException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidSnsTopicNameException) GoString() string { - return s.String() -} - -func newErrorInvalidSnsTopicNameException(v protocol.ResponseMetadata) error { - return &InvalidSnsTopicNameException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidSnsTopicNameException) Code() string { - return "InvalidSnsTopicNameException" -} - -// Message returns the exception's message. -func (s *InvalidSnsTopicNameException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidSnsTopicNameException) OrigErr() error { - return nil -} - -func (s *InvalidSnsTopicNameException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidSnsTopicNameException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidSnsTopicNameException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the specified value of Source is not valid. -type InvalidSourceException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidSourceException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidSourceException) GoString() string { - return s.String() -} - -func newErrorInvalidSourceException(v protocol.ResponseMetadata) error { - return &InvalidSourceException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidSourceException) Code() string { - return "InvalidSourceException" -} - -// Message returns the exception's message. -func (s *InvalidSourceException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidSourceException) OrigErr() error { - return nil -} - -func (s *InvalidSourceException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidSourceException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidSourceException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the specified tag key or values are not valid. -// It can also occur if there are duplicate tags or too many tags on the resource. -type InvalidTagParameterException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidTagParameterException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidTagParameterException) GoString() string { - return s.String() -} - -func newErrorInvalidTagParameterException(v protocol.ResponseMetadata) error { - return &InvalidTagParameterException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidTagParameterException) Code() string { - return "InvalidTagParameterException" -} - -// Message returns the exception's message. -func (s *InvalidTagParameterException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidTagParameterException) OrigErr() error { - return nil -} - -func (s *InvalidTagParameterException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidTagParameterException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidTagParameterException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Occurs if the timestamp values are not valid. Either the start time occurs -// after the end time, or the time range is outside the range of possible values. -type InvalidTimeRangeException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidTimeRangeException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidTimeRangeException) GoString() string { - return s.String() -} - -func newErrorInvalidTimeRangeException(v protocol.ResponseMetadata) error { - return &InvalidTimeRangeException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidTimeRangeException) Code() string { - return "InvalidTimeRangeException" -} - -// Message returns the exception's message. -func (s *InvalidTimeRangeException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidTimeRangeException) OrigErr() error { - return nil -} - -func (s *InvalidTimeRangeException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidTimeRangeException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidTimeRangeException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Reserved for future use. -type InvalidTokenException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidTokenException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidTokenException) GoString() string { - return s.String() -} - -func newErrorInvalidTokenException(v protocol.ResponseMetadata) error { - return &InvalidTokenException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidTokenException) Code() string { - return "InvalidTokenException" -} - -// Message returns the exception's message. -func (s *InvalidTokenException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidTokenException) OrigErr() error { - return nil -} - -func (s *InvalidTokenException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidTokenException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidTokenException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the provided trail name is not valid. Trail -// names must meet the following requirements: -// -// - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores -// (_), or dashes (-) -// -// - Start with a letter or number, and end with a letter or number -// -// - Be between 3 and 128 characters -// -// - Have no adjacent periods, underscores or dashes. Names like my-_namespace -// and my--namespace are not valid. -// -// - Not be in IP address format (for example, 192.168.5.4) -type InvalidTrailNameException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidTrailNameException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidTrailNameException) GoString() string { - return s.String() -} - -func newErrorInvalidTrailNameException(v protocol.ResponseMetadata) error { - return &InvalidTrailNameException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidTrailNameException) Code() string { - return "InvalidTrailNameException" -} - -// Message returns the exception's message. -func (s *InvalidTrailNameException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidTrailNameException) OrigErr() error { - return nil -} - -func (s *InvalidTrailNameException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidTrailNameException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidTrailNameException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when there is an issue with the specified KMS key -// and the trail or event data store can't be updated. -type KmsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s KmsException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s KmsException) GoString() string { - return s.String() -} - -func newErrorKmsException(v protocol.ResponseMetadata) error { - return &KmsException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *KmsException) Code() string { - return "KmsException" -} - -// Message returns the exception's message. -func (s *KmsException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *KmsException) OrigErr() error { - return nil -} - -func (s *KmsException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *KmsException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *KmsException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is no longer in use. -// -// Deprecated: KmsKeyDisabledException has been deprecated -type KmsKeyDisabledException struct { - _ struct{} `deprecated:"true" type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s KmsKeyDisabledException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s KmsKeyDisabledException) GoString() string { - return s.String() -} - -func newErrorKmsKeyDisabledException(v protocol.ResponseMetadata) error { - return &KmsKeyDisabledException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *KmsKeyDisabledException) Code() string { - return "KmsKeyDisabledException" -} - -// Message returns the exception's message. -func (s *KmsKeyDisabledException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *KmsKeyDisabledException) OrigErr() error { - return nil -} - -func (s *KmsKeyDisabledException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *KmsKeyDisabledException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *KmsKeyDisabledException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the KMS key does not exist, when the S3 bucket -// and the KMS key are not in the same region, or when the KMS key associated -// with the Amazon SNS topic either does not exist or is not in the same region. -type KmsKeyNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s KmsKeyNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s KmsKeyNotFoundException) GoString() string { - return s.String() -} - -func newErrorKmsKeyNotFoundException(v protocol.ResponseMetadata) error { - return &KmsKeyNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *KmsKeyNotFoundException) Code() string { - return "KmsKeyNotFoundException" -} - -// Message returns the exception's message. -func (s *KmsKeyNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *KmsKeyNotFoundException) OrigErr() error { - return nil -} - -func (s *KmsKeyNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *KmsKeyNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *KmsKeyNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -type ListChannelsInput struct { - _ struct{} `type:"structure"` - - // The maximum number of CloudTrail channels to display on a single page. - MaxResults *int64 `min:"1" type:"integer"` - - // The token to use to get the next page of results after a previous API call. - // This token must be passed in with the same parameters that were specified - // in the original call. For example, if the original call specified an AttributeKey - // of 'Username' with a value of 'root', the call with NextToken should include - // those same parameters. - NextToken *string `min:"4" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListChannelsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListChannelsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListChannelsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListChannelsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 4 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListChannelsInput) SetMaxResults(v int64) *ListChannelsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListChannelsInput) SetNextToken(v string) *ListChannelsInput { - s.NextToken = &v - return s -} - -type ListChannelsOutput struct { - _ struct{} `type:"structure"` - - // The list of channels in the account. - Channels []*Channel `type:"list"` - - // The token to use to get the next page of results after a previous API call. - NextToken *string `min:"4" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListChannelsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListChannelsOutput) GoString() string { - return s.String() -} - -// SetChannels sets the Channels field's value. -func (s *ListChannelsOutput) SetChannels(v []*Channel) *ListChannelsOutput { - s.Channels = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListChannelsOutput) SetNextToken(v string) *ListChannelsOutput { - s.NextToken = &v - return s -} - -type ListEventDataStoresInput struct { - _ struct{} `type:"structure"` - - // The maximum number of event data stores to display on a single page. - MaxResults *int64 `min:"1" type:"integer"` - - // A token you can use to get the next page of event data store results. - NextToken *string `min:"4" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListEventDataStoresInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListEventDataStoresInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListEventDataStoresInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListEventDataStoresInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 4 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListEventDataStoresInput) SetMaxResults(v int64) *ListEventDataStoresInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEventDataStoresInput) SetNextToken(v string) *ListEventDataStoresInput { - s.NextToken = &v - return s -} - -type ListEventDataStoresOutput struct { - _ struct{} `type:"structure"` - - // Contains information about event data stores in the account, in the current - // region. - EventDataStores []*EventDataStore `type:"list"` - - // A token you can use to get the next page of results. - NextToken *string `min:"4" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListEventDataStoresOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListEventDataStoresOutput) GoString() string { - return s.String() -} - -// SetEventDataStores sets the EventDataStores field's value. -func (s *ListEventDataStoresOutput) SetEventDataStores(v []*EventDataStore) *ListEventDataStoresOutput { - s.EventDataStores = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListEventDataStoresOutput) SetNextToken(v string) *ListEventDataStoresOutput { - s.NextToken = &v - return s -} - -type ListImportFailuresInput struct { - _ struct{} `type:"structure"` - - // The ID of the import. - // - // ImportId is a required field - ImportId *string `min:"36" type:"string" required:"true"` - - // The maximum number of failures to display on a single page. - MaxResults *int64 `min:"1" type:"integer"` - - // A token you can use to get the next page of import failures. - NextToken *string `min:"4" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListImportFailuresInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListImportFailuresInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListImportFailuresInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListImportFailuresInput"} - if s.ImportId == nil { - invalidParams.Add(request.NewErrParamRequired("ImportId")) - } - if s.ImportId != nil && len(*s.ImportId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ImportId", 36)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 4 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetImportId sets the ImportId field's value. -func (s *ListImportFailuresInput) SetImportId(v string) *ListImportFailuresInput { - s.ImportId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListImportFailuresInput) SetMaxResults(v int64) *ListImportFailuresInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListImportFailuresInput) SetNextToken(v string) *ListImportFailuresInput { - s.NextToken = &v - return s -} - -type ListImportFailuresOutput struct { - _ struct{} `type:"structure"` - - // Contains information about the import failures. - Failures []*ImportFailureListItem `type:"list"` - - // A token you can use to get the next page of results. - NextToken *string `min:"4" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListImportFailuresOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListImportFailuresOutput) GoString() string { - return s.String() -} - -// SetFailures sets the Failures field's value. -func (s *ListImportFailuresOutput) SetFailures(v []*ImportFailureListItem) *ListImportFailuresOutput { - s.Failures = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListImportFailuresOutput) SetNextToken(v string) *ListImportFailuresOutput { - s.NextToken = &v - return s -} - -type ListImportsInput struct { - _ struct{} `type:"structure"` - - // The ARN of the destination event data store. - Destination *string `min:"3" type:"string"` - - // The status of the import. - ImportStatus *string `type:"string" enum:"ImportStatus"` - - // The maximum number of imports to display on a single page. - MaxResults *int64 `min:"1" type:"integer"` - - // A token you can use to get the next page of import results. - NextToken *string `min:"4" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListImportsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListImportsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListImportsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListImportsInput"} - if s.Destination != nil && len(*s.Destination) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Destination", 3)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 4 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestination sets the Destination field's value. -func (s *ListImportsInput) SetDestination(v string) *ListImportsInput { - s.Destination = &v - return s -} - -// SetImportStatus sets the ImportStatus field's value. -func (s *ListImportsInput) SetImportStatus(v string) *ListImportsInput { - s.ImportStatus = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListImportsInput) SetMaxResults(v int64) *ListImportsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListImportsInput) SetNextToken(v string) *ListImportsInput { - s.NextToken = &v - return s -} - -type ListImportsOutput struct { - _ struct{} `type:"structure"` - - // The list of returned imports. - Imports []*ImportsListItem `type:"list"` - - // A token you can use to get the next page of import results. - NextToken *string `min:"4" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListImportsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListImportsOutput) GoString() string { - return s.String() -} - -// SetImports sets the Imports field's value. -func (s *ListImportsOutput) SetImports(v []*ImportsListItem) *ListImportsOutput { - s.Imports = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListImportsOutput) SetNextToken(v string) *ListImportsOutput { - s.NextToken = &v - return s -} - -// Requests the public keys for a specified time range. -type ListPublicKeysInput struct { - _ struct{} `type:"structure"` - - // Optionally specifies, in UTC, the end of the time range to look up public - // keys for CloudTrail digest files. If not specified, the current time is used. - EndTime *time.Time `type:"timestamp"` - - // Reserved for future use. - NextToken *string `type:"string"` - - // Optionally specifies, in UTC, the start of the time range to look up public - // keys for CloudTrail digest files. If not specified, the current time is used, - // and the current public key is returned. - StartTime *time.Time `type:"timestamp"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListPublicKeysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListPublicKeysInput) GoString() string { - return s.String() -} - -// SetEndTime sets the EndTime field's value. -func (s *ListPublicKeysInput) SetEndTime(v time.Time) *ListPublicKeysInput { - s.EndTime = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPublicKeysInput) SetNextToken(v string) *ListPublicKeysInput { - s.NextToken = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *ListPublicKeysInput) SetStartTime(v time.Time) *ListPublicKeysInput { - s.StartTime = &v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -type ListPublicKeysOutput struct { - _ struct{} `type:"structure"` - - // Reserved for future use. - NextToken *string `type:"string"` - - // Contains an array of PublicKey objects. - // - // The returned public keys may have validity time ranges that overlap. - PublicKeyList []*PublicKey `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListPublicKeysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListPublicKeysOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPublicKeysOutput) SetNextToken(v string) *ListPublicKeysOutput { - s.NextToken = &v - return s -} - -// SetPublicKeyList sets the PublicKeyList field's value. -func (s *ListPublicKeysOutput) SetPublicKeyList(v []*PublicKey) *ListPublicKeysOutput { - s.PublicKeyList = v - return s -} - -type ListQueriesInput struct { - _ struct{} `type:"structure"` - - // Use with StartTime to bound a ListQueries request, and limit its results - // to only those queries run within a specified time period. - EndTime *time.Time `type:"timestamp"` - - // The ARN (or the ID suffix of the ARN) of an event data store on which queries - // were run. - // - // EventDataStore is a required field - EventDataStore *string `min:"3" type:"string" required:"true"` - - // The maximum number of queries to show on a page. - MaxResults *int64 `min:"1" type:"integer"` - - // A token you can use to get the next page of results. - NextToken *string `min:"4" type:"string"` - - // The status of queries that you want to return in results. Valid values for - // QueryStatus include QUEUED, RUNNING, FINISHED, FAILED, TIMED_OUT, or CANCELLED. - QueryStatus *string `type:"string" enum:"QueryStatus"` - - // Use with EndTime to bound a ListQueries request, and limit its results to - // only those queries run within a specified time period. - StartTime *time.Time `type:"timestamp"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListQueriesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListQueriesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListQueriesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListQueriesInput"} - if s.EventDataStore == nil { - invalidParams.Add(request.NewErrParamRequired("EventDataStore")) - } - if s.EventDataStore != nil && len(*s.EventDataStore) < 3 { - invalidParams.Add(request.NewErrParamMinLen("EventDataStore", 3)) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.NextToken != nil && len(*s.NextToken) < 4 { - invalidParams.Add(request.NewErrParamMinLen("NextToken", 4)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndTime sets the EndTime field's value. -func (s *ListQueriesInput) SetEndTime(v time.Time) *ListQueriesInput { - s.EndTime = &v - return s -} - -// SetEventDataStore sets the EventDataStore field's value. -func (s *ListQueriesInput) SetEventDataStore(v string) *ListQueriesInput { - s.EventDataStore = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListQueriesInput) SetMaxResults(v int64) *ListQueriesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListQueriesInput) SetNextToken(v string) *ListQueriesInput { - s.NextToken = &v - return s -} - -// SetQueryStatus sets the QueryStatus field's value. -func (s *ListQueriesInput) SetQueryStatus(v string) *ListQueriesInput { - s.QueryStatus = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *ListQueriesInput) SetStartTime(v time.Time) *ListQueriesInput { - s.StartTime = &v - return s -} - -type ListQueriesOutput struct { - _ struct{} `type:"structure"` - - // A token you can use to get the next page of results. - NextToken *string `min:"4" type:"string"` - - // Lists matching query results, and shows query ID, status, and creation time - // of each query. - Queries []*Query `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListQueriesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListQueriesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListQueriesOutput) SetNextToken(v string) *ListQueriesOutput { - s.NextToken = &v - return s -} - -// SetQueries sets the Queries field's value. -func (s *ListQueriesOutput) SetQueries(v []*Query) *ListQueriesOutput { - s.Queries = v - return s -} - -// Specifies a list of tags to return. -type ListTagsInput struct { - _ struct{} `type:"structure"` - - // Reserved for future use. - NextToken *string `type:"string"` - - // Specifies a list of trail, event data store, or channel ARNs whose tags will - // be listed. The list has a limit of 20 ARNs. - // - // ResourceIdList is a required field - ResourceIdList []*string `type:"list" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsInput"} - if s.ResourceIdList == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceIdList")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTagsInput) SetNextToken(v string) *ListTagsInput { - s.NextToken = &v - return s -} - -// SetResourceIdList sets the ResourceIdList field's value. -func (s *ListTagsInput) SetResourceIdList(v []*string) *ListTagsInput { - s.ResourceIdList = v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -type ListTagsOutput struct { - _ struct{} `type:"structure"` - - // Reserved for future use. - NextToken *string `type:"string"` - - // A list of resource tags. - ResourceTagList []*ResourceTag `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListTagsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTagsOutput) SetNextToken(v string) *ListTagsOutput { - s.NextToken = &v - return s -} - -// SetResourceTagList sets the ResourceTagList field's value. -func (s *ListTagsOutput) SetResourceTagList(v []*ResourceTag) *ListTagsOutput { - s.ResourceTagList = v - return s -} - -type ListTrailsInput struct { - _ struct{} `type:"structure"` - - // The token to use to get the next page of results after a previous API call. - // This token must be passed in with the same parameters that were specified - // in the original call. For example, if the original call specified an AttributeKey - // of 'Username' with a value of 'root', the call with NextToken should include - // those same parameters. - NextToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListTrailsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListTrailsInput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTrailsInput) SetNextToken(v string) *ListTrailsInput { - s.NextToken = &v - return s -} - -type ListTrailsOutput struct { - _ struct{} `type:"structure"` - - // The token to use to get the next page of results after a previous API call. - // If the token does not appear, there are no more results to return. The token - // must be passed in with the same parameters as the previous call. For example, - // if the original call specified an AttributeKey of 'Username' with a value - // of 'root', the call with NextToken should include those same parameters. - NextToken *string `type:"string"` - - // Returns the name, ARN, and home region of trails in the current account. - Trails []*TrailInfo `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListTrailsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListTrailsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTrailsOutput) SetNextToken(v string) *ListTrailsOutput { - s.NextToken = &v - return s -} - -// SetTrails sets the Trails field's value. -func (s *ListTrailsOutput) SetTrails(v []*TrailInfo) *ListTrailsOutput { - s.Trails = v - return s -} - -// Specifies an attribute and value that filter the events returned. -type LookupAttribute struct { - _ struct{} `type:"structure"` - - // Specifies an attribute on which to filter the events returned. - // - // AttributeKey is a required field - AttributeKey *string `type:"string" required:"true" enum:"LookupAttributeKey"` - - // Specifies a value for the specified AttributeKey. - // - // AttributeValue is a required field - AttributeValue *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LookupAttribute) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LookupAttribute) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LookupAttribute) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LookupAttribute"} - if s.AttributeKey == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeKey")) - } - if s.AttributeValue == nil { - invalidParams.Add(request.NewErrParamRequired("AttributeValue")) - } - if s.AttributeValue != nil && len(*s.AttributeValue) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AttributeValue", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAttributeKey sets the AttributeKey field's value. -func (s *LookupAttribute) SetAttributeKey(v string) *LookupAttribute { - s.AttributeKey = &v - return s -} - -// SetAttributeValue sets the AttributeValue field's value. -func (s *LookupAttribute) SetAttributeValue(v string) *LookupAttribute { - s.AttributeValue = &v - return s -} - -// Contains a request for LookupEvents. -type LookupEventsInput struct { - _ struct{} `type:"structure"` - - // Specifies that only events that occur before or at the specified time are - // returned. If the specified end time is before the specified start time, an - // error is returned. - EndTime *time.Time `type:"timestamp"` - - // Specifies the event category. If you do not specify an event category, events - // of the category are not returned in the response. For example, if you do - // not specify insight as the value of EventCategory, no Insights events are - // returned. - EventCategory *string `type:"string" enum:"EventCategory"` - - // Contains a list of lookup attributes. Currently the list can contain only - // one item. - LookupAttributes []*LookupAttribute `type:"list"` - - // The number of events to return. Possible values are 1 through 50. The default - // is 50. - MaxResults *int64 `min:"1" type:"integer"` - - // The token to use to get the next page of results after a previous API call. - // This token must be passed in with the same parameters that were specified - // in the original call. For example, if the original call specified an AttributeKey - // of 'Username' with a value of 'root', the call with NextToken should include - // those same parameters. - NextToken *string `type:"string"` - - // Specifies that only events that occur after or at the specified time are - // returned. If the specified start time is after the specified end time, an - // error is returned. - StartTime *time.Time `type:"timestamp"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LookupEventsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LookupEventsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LookupEventsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LookupEventsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.LookupAttributes != nil { - for i, v := range s.LookupAttributes { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LookupAttributes", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEndTime sets the EndTime field's value. -func (s *LookupEventsInput) SetEndTime(v time.Time) *LookupEventsInput { - s.EndTime = &v - return s -} - -// SetEventCategory sets the EventCategory field's value. -func (s *LookupEventsInput) SetEventCategory(v string) *LookupEventsInput { - s.EventCategory = &v - return s -} - -// SetLookupAttributes sets the LookupAttributes field's value. -func (s *LookupEventsInput) SetLookupAttributes(v []*LookupAttribute) *LookupEventsInput { - s.LookupAttributes = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *LookupEventsInput) SetMaxResults(v int64) *LookupEventsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *LookupEventsInput) SetNextToken(v string) *LookupEventsInput { - s.NextToken = &v - return s -} - -// SetStartTime sets the StartTime field's value. -func (s *LookupEventsInput) SetStartTime(v time.Time) *LookupEventsInput { - s.StartTime = &v - return s -} - -// Contains a response to a LookupEvents action. -type LookupEventsOutput struct { - _ struct{} `type:"structure"` - - // A list of events returned based on the lookup attributes specified and the - // CloudTrail event. The events list is sorted by time. The most recent event - // is listed first. - Events []*Event `type:"list"` - - // The token to use to get the next page of results after a previous API call. - // If the token does not appear, there are no more results to return. The token - // must be passed in with the same parameters as the previous call. For example, - // if the original call specified an AttributeKey of 'Username' with a value - // of 'root', the call with NextToken should include those same parameters. - NextToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LookupEventsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LookupEventsOutput) GoString() string { - return s.String() -} - -// SetEvents sets the Events field's value. -func (s *LookupEventsOutput) SetEvents(v []*Event) *LookupEventsOutput { - s.Events = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *LookupEventsOutput) SetNextToken(v string) *LookupEventsOutput { - s.NextToken = &v - return s -} - -// You are already running the maximum number of concurrent queries. Wait a -// minute for some queries to finish, and then run the query again. -type MaxConcurrentQueriesException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MaxConcurrentQueriesException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MaxConcurrentQueriesException) GoString() string { - return s.String() -} - -func newErrorMaxConcurrentQueriesException(v protocol.ResponseMetadata) error { - return &MaxConcurrentQueriesException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *MaxConcurrentQueriesException) Code() string { - return "MaxConcurrentQueriesException" -} - -// Message returns the exception's message. -func (s *MaxConcurrentQueriesException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *MaxConcurrentQueriesException) OrigErr() error { - return nil -} - -func (s *MaxConcurrentQueriesException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *MaxConcurrentQueriesException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *MaxConcurrentQueriesException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the maximum number of trails is reached. -type MaximumNumberOfTrailsExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MaximumNumberOfTrailsExceededException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MaximumNumberOfTrailsExceededException) GoString() string { - return s.String() -} - -func newErrorMaximumNumberOfTrailsExceededException(v protocol.ResponseMetadata) error { - return &MaximumNumberOfTrailsExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *MaximumNumberOfTrailsExceededException) Code() string { - return "MaximumNumberOfTrailsExceededException" -} - -// Message returns the exception's message. -func (s *MaximumNumberOfTrailsExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *MaximumNumberOfTrailsExceededException) OrigErr() error { - return nil -} - -func (s *MaximumNumberOfTrailsExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *MaximumNumberOfTrailsExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *MaximumNumberOfTrailsExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the management account does not have a service-linked -// role. -type NoManagementAccountSLRExistsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s NoManagementAccountSLRExistsException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s NoManagementAccountSLRExistsException) GoString() string { - return s.String() -} - -func newErrorNoManagementAccountSLRExistsException(v protocol.ResponseMetadata) error { - return &NoManagementAccountSLRExistsException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *NoManagementAccountSLRExistsException) Code() string { - return "NoManagementAccountSLRExistsException" -} - -// Message returns the exception's message. -func (s *NoManagementAccountSLRExistsException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *NoManagementAccountSLRExistsException) OrigErr() error { - return nil -} - -func (s *NoManagementAccountSLRExistsException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *NoManagementAccountSLRExistsException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *NoManagementAccountSLRExistsException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the account making the request is not the organization's -// management account. -type NotOrganizationManagementAccountException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s NotOrganizationManagementAccountException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s NotOrganizationManagementAccountException) GoString() string { - return s.String() -} - -func newErrorNotOrganizationManagementAccountException(v protocol.ResponseMetadata) error { - return &NotOrganizationManagementAccountException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *NotOrganizationManagementAccountException) Code() string { - return "NotOrganizationManagementAccountException" -} - -// Message returns the exception's message. -func (s *NotOrganizationManagementAccountException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *NotOrganizationManagementAccountException) OrigErr() error { - return nil -} - -func (s *NotOrganizationManagementAccountException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *NotOrganizationManagementAccountException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *NotOrganizationManagementAccountException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the Amazon Web Services account making the -// request to create or update an organization trail or event data store is -// not the management account for an organization in Organizations. For more -// information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) -// or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). -type NotOrganizationMasterAccountException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s NotOrganizationMasterAccountException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s NotOrganizationMasterAccountException) GoString() string { - return s.String() -} - -func newErrorNotOrganizationMasterAccountException(v protocol.ResponseMetadata) error { - return &NotOrganizationMasterAccountException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *NotOrganizationMasterAccountException) Code() string { - return "NotOrganizationMasterAccountException" -} - -// Message returns the exception's message. -func (s *NotOrganizationMasterAccountException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *NotOrganizationMasterAccountException) OrigErr() error { - return nil -} - -func (s *NotOrganizationMasterAccountException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *NotOrganizationMasterAccountException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *NotOrganizationMasterAccountException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the requested operation is not permitted. -type OperationNotPermittedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OperationNotPermittedException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OperationNotPermittedException) GoString() string { - return s.String() -} - -func newErrorOperationNotPermittedException(v protocol.ResponseMetadata) error { - return &OperationNotPermittedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *OperationNotPermittedException) Code() string { - return "OperationNotPermittedException" -} - -// Message returns the exception's message. -func (s *OperationNotPermittedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *OperationNotPermittedException) OrigErr() error { - return nil -} - -func (s *OperationNotPermittedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *OperationNotPermittedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *OperationNotPermittedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when Organizations is not configured to support -// all features. All features must be enabled in Organizations to support creating -// an organization trail or event data store. -type OrganizationNotInAllFeaturesModeException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OrganizationNotInAllFeaturesModeException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OrganizationNotInAllFeaturesModeException) GoString() string { - return s.String() -} - -func newErrorOrganizationNotInAllFeaturesModeException(v protocol.ResponseMetadata) error { - return &OrganizationNotInAllFeaturesModeException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *OrganizationNotInAllFeaturesModeException) Code() string { - return "OrganizationNotInAllFeaturesModeException" -} - -// Message returns the exception's message. -func (s *OrganizationNotInAllFeaturesModeException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *OrganizationNotInAllFeaturesModeException) OrigErr() error { - return nil -} - -func (s *OrganizationNotInAllFeaturesModeException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *OrganizationNotInAllFeaturesModeException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *OrganizationNotInAllFeaturesModeException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the request is made from an Amazon Web Services -// account that is not a member of an organization. To make this request, sign -// in using the credentials of an account that belongs to an organization. -type OrganizationsNotInUseException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OrganizationsNotInUseException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OrganizationsNotInUseException) GoString() string { - return s.String() -} - -func newErrorOrganizationsNotInUseException(v protocol.ResponseMetadata) error { - return &OrganizationsNotInUseException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *OrganizationsNotInUseException) Code() string { - return "OrganizationsNotInUseException" -} - -// Message returns the exception's message. -func (s *OrganizationsNotInUseException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *OrganizationsNotInUseException) OrigErr() error { - return nil -} - -func (s *OrganizationsNotInUseException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *OrganizationsNotInUseException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *OrganizationsNotInUseException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains information about a returned public key. -type PublicKey struct { - _ struct{} `type:"structure"` - - // The fingerprint of the public key. - Fingerprint *string `type:"string"` - - // The ending time of validity of the public key. - ValidityEndTime *time.Time `type:"timestamp"` - - // The starting time of validity of the public key. - ValidityStartTime *time.Time `type:"timestamp"` - - // The DER encoded public key value in PKCS#1 format. - // Value is automatically base64 encoded/decoded by the SDK. - Value []byte `type:"blob"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PublicKey) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PublicKey) GoString() string { - return s.String() -} - -// SetFingerprint sets the Fingerprint field's value. -func (s *PublicKey) SetFingerprint(v string) *PublicKey { - s.Fingerprint = &v - return s -} - -// SetValidityEndTime sets the ValidityEndTime field's value. -func (s *PublicKey) SetValidityEndTime(v time.Time) *PublicKey { - s.ValidityEndTime = &v - return s -} - -// SetValidityStartTime sets the ValidityStartTime field's value. -func (s *PublicKey) SetValidityStartTime(v time.Time) *PublicKey { - s.ValidityStartTime = &v - return s -} - -// SetValue sets the Value field's value. -func (s *PublicKey) SetValue(v []byte) *PublicKey { - s.Value = v - return s -} - -type PutEventSelectorsInput struct { - _ struct{} `type:"structure"` - - // Specifies the settings for advanced event selectors. You can add advanced - // event selectors, and conditions for your advanced event selectors, up to - // a maximum of 500 values for all conditions and selectors on a trail. You - // can use either AdvancedEventSelectors or EventSelectors, but not both. If - // you apply AdvancedEventSelectors to a trail, any existing EventSelectors - // are overwritten. For more information about advanced event selectors, see - // Logging data events for trails (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-data-events-with-cloudtrail.html) - // in the CloudTrail User Guide. - AdvancedEventSelectors []*AdvancedEventSelector `type:"list"` - - // Specifies the settings for your event selectors. You can configure up to - // five event selectors for a trail. You can use either EventSelectors or AdvancedEventSelectors - // in a PutEventSelectors request, but not both. If you apply EventSelectors - // to a trail, any existing AdvancedEventSelectors are overwritten. - EventSelectors []*EventSelector `type:"list"` - - // Specifies the name of the trail or trail ARN. If you specify a trail name, - // the string must meet the following requirements: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores - // (_), or dashes (-) - // - // * Start with a letter or number, and end with a letter or number - // - // * Be between 3 and 128 characters - // - // * Have no adjacent periods, underscores or dashes. Names like my-_namespace - // and my--namespace are not valid. - // - // * Not be in IP address format (for example, 192.168.5.4) - // - // If you specify a trail ARN, it must be in the following format. - // - // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail - // - // TrailName is a required field - TrailName *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutEventSelectorsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutEventSelectorsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutEventSelectorsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutEventSelectorsInput"} - if s.TrailName == nil { - invalidParams.Add(request.NewErrParamRequired("TrailName")) - } - if s.AdvancedEventSelectors != nil { - for i, v := range s.AdvancedEventSelectors { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AdvancedEventSelectors", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdvancedEventSelectors sets the AdvancedEventSelectors field's value. -func (s *PutEventSelectorsInput) SetAdvancedEventSelectors(v []*AdvancedEventSelector) *PutEventSelectorsInput { - s.AdvancedEventSelectors = v - return s -} - -// SetEventSelectors sets the EventSelectors field's value. -func (s *PutEventSelectorsInput) SetEventSelectors(v []*EventSelector) *PutEventSelectorsInput { - s.EventSelectors = v - return s -} - -// SetTrailName sets the TrailName field's value. -func (s *PutEventSelectorsInput) SetTrailName(v string) *PutEventSelectorsInput { - s.TrailName = &v - return s -} - -type PutEventSelectorsOutput struct { - _ struct{} `type:"structure"` - - // Specifies the advanced event selectors configured for your trail. - AdvancedEventSelectors []*AdvancedEventSelector `type:"list"` - - // Specifies the event selectors configured for your trail. - EventSelectors []*EventSelector `type:"list"` - - // Specifies the ARN of the trail that was updated with event selectors. The - // following is the format of a trail ARN. - // - // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail - TrailARN *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutEventSelectorsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutEventSelectorsOutput) GoString() string { - return s.String() -} - -// SetAdvancedEventSelectors sets the AdvancedEventSelectors field's value. -func (s *PutEventSelectorsOutput) SetAdvancedEventSelectors(v []*AdvancedEventSelector) *PutEventSelectorsOutput { - s.AdvancedEventSelectors = v - return s -} - -// SetEventSelectors sets the EventSelectors field's value. -func (s *PutEventSelectorsOutput) SetEventSelectors(v []*EventSelector) *PutEventSelectorsOutput { - s.EventSelectors = v - return s -} - -// SetTrailARN sets the TrailARN field's value. -func (s *PutEventSelectorsOutput) SetTrailARN(v string) *PutEventSelectorsOutput { - s.TrailARN = &v - return s -} - -type PutInsightSelectorsInput struct { - _ struct{} `type:"structure"` - - // A JSON string that contains the insight types you want to log on a trail. - // ApiCallRateInsight and ApiErrorRateInsight are valid insight types. - // - // InsightSelectors is a required field - InsightSelectors []*InsightSelector `type:"list" required:"true"` - - // The name of the CloudTrail trail for which you want to change or add Insights - // selectors. - // - // TrailName is a required field - TrailName *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutInsightSelectorsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutInsightSelectorsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutInsightSelectorsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutInsightSelectorsInput"} - if s.InsightSelectors == nil { - invalidParams.Add(request.NewErrParamRequired("InsightSelectors")) - } - if s.TrailName == nil { - invalidParams.Add(request.NewErrParamRequired("TrailName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInsightSelectors sets the InsightSelectors field's value. -func (s *PutInsightSelectorsInput) SetInsightSelectors(v []*InsightSelector) *PutInsightSelectorsInput { - s.InsightSelectors = v - return s -} - -// SetTrailName sets the TrailName field's value. -func (s *PutInsightSelectorsInput) SetTrailName(v string) *PutInsightSelectorsInput { - s.TrailName = &v - return s -} - -type PutInsightSelectorsOutput struct { - _ struct{} `type:"structure"` - - // A JSON string that contains the Insights event types that you want to log - // on a trail. The valid Insights types in this release are ApiErrorRateInsight - // and ApiCallRateInsight. - InsightSelectors []*InsightSelector `type:"list"` - - // The Amazon Resource Name (ARN) of a trail for which you want to change or - // add Insights selectors. - TrailARN *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutInsightSelectorsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutInsightSelectorsOutput) GoString() string { - return s.String() -} - -// SetInsightSelectors sets the InsightSelectors field's value. -func (s *PutInsightSelectorsOutput) SetInsightSelectors(v []*InsightSelector) *PutInsightSelectorsOutput { - s.InsightSelectors = v - return s -} - -// SetTrailARN sets the TrailARN field's value. -func (s *PutInsightSelectorsOutput) SetTrailARN(v string) *PutInsightSelectorsOutput { - s.TrailARN = &v - return s -} - -type PutResourcePolicyInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the CloudTrail channel attached to the - // resource-based policy. The following is the format of a resource ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/MyChannel. - // - // ResourceArn is a required field - ResourceArn *string `min:"3" type:"string" required:"true"` - - // A JSON-formatted string for an Amazon Web Services resource-based policy. - // - // The following are requirements for the resource policy: - // - // * Contains only one action: cloudtrail-data:PutAuditEvents - // - // * Contains at least one statement. The policy can have a maximum of 20 - // statements. - // - // * Each statement contains at least one principal. A statement can have - // a maximum of 50 principals. - // - // ResourcePolicy is a required field - ResourcePolicy *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutResourcePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutResourcePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutResourcePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutResourcePolicyInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 3 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 3)) - } - if s.ResourcePolicy == nil { - invalidParams.Add(request.NewErrParamRequired("ResourcePolicy")) - } - if s.ResourcePolicy != nil && len(*s.ResourcePolicy) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourcePolicy", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *PutResourcePolicyInput) SetResourceArn(v string) *PutResourcePolicyInput { - s.ResourceArn = &v - return s -} - -// SetResourcePolicy sets the ResourcePolicy field's value. -func (s *PutResourcePolicyInput) SetResourcePolicy(v string) *PutResourcePolicyInput { - s.ResourcePolicy = &v - return s -} - -type PutResourcePolicyOutput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the CloudTrail channel attached to the - // resource-based policy. - ResourceArn *string `min:"3" type:"string"` - - // The JSON-formatted string of the Amazon Web Services resource-based policy - // attached to the CloudTrail channel. - ResourcePolicy *string `min:"1" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutResourcePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutResourcePolicyOutput) GoString() string { - return s.String() -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *PutResourcePolicyOutput) SetResourceArn(v string) *PutResourcePolicyOutput { - s.ResourceArn = &v - return s -} - -// SetResourcePolicy sets the ResourcePolicy field's value. -func (s *PutResourcePolicyOutput) SetResourcePolicy(v string) *PutResourcePolicyOutput { - s.ResourcePolicy = &v - return s -} - -// A SQL string of criteria about events that you want to collect in an event -// data store. -type Query struct { - _ struct{} `type:"structure"` - - // The creation time of a query. - CreationTime *time.Time `type:"timestamp"` - - // The ID of a query. - QueryId *string `min:"36" type:"string"` - - // The status of the query. This can be QUEUED, RUNNING, FINISHED, FAILED, TIMED_OUT, - // or CANCELLED. - QueryStatus *string `type:"string" enum:"QueryStatus"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Query) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Query) GoString() string { - return s.String() -} - -// SetCreationTime sets the CreationTime field's value. -func (s *Query) SetCreationTime(v time.Time) *Query { - s.CreationTime = &v - return s -} - -// SetQueryId sets the QueryId field's value. -func (s *Query) SetQueryId(v string) *Query { - s.QueryId = &v - return s -} - -// SetQueryStatus sets the QueryStatus field's value. -func (s *Query) SetQueryStatus(v string) *Query { - s.QueryStatus = &v - return s -} - -// The query ID does not exist or does not map to a query. -type QueryIdNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s QueryIdNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s QueryIdNotFoundException) GoString() string { - return s.String() -} - -func newErrorQueryIdNotFoundException(v protocol.ResponseMetadata) error { - return &QueryIdNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *QueryIdNotFoundException) Code() string { - return "QueryIdNotFoundException" -} - -// Message returns the exception's message. -func (s *QueryIdNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *QueryIdNotFoundException) OrigErr() error { - return nil -} - -func (s *QueryIdNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *QueryIdNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *QueryIdNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Metadata about a query, such as the number of results. -type QueryStatistics struct { - _ struct{} `type:"structure"` - - // The total bytes that the query scanned in the event data store. This value - // matches the number of bytes for which your account is billed for the query, - // unless the query is still running. - BytesScanned *int64 `type:"long"` - - // The number of results returned. - ResultsCount *int64 `type:"integer"` - - // The total number of results returned by a query. - TotalResultsCount *int64 `type:"integer"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s QueryStatistics) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s QueryStatistics) GoString() string { - return s.String() -} - -// SetBytesScanned sets the BytesScanned field's value. -func (s *QueryStatistics) SetBytesScanned(v int64) *QueryStatistics { - s.BytesScanned = &v - return s -} - -// SetResultsCount sets the ResultsCount field's value. -func (s *QueryStatistics) SetResultsCount(v int64) *QueryStatistics { - s.ResultsCount = &v - return s -} - -// SetTotalResultsCount sets the TotalResultsCount field's value. -func (s *QueryStatistics) SetTotalResultsCount(v int64) *QueryStatistics { - s.TotalResultsCount = &v - return s -} - -// Gets metadata about a query, including the number of events that were matched, -// the total number of events scanned, the query run time in milliseconds, and -// the query's creation time. -type QueryStatisticsForDescribeQuery struct { - _ struct{} `type:"structure"` - - // The total bytes that the query scanned in the event data store. This value - // matches the number of bytes for which your account is billed for the query, - // unless the query is still running. - BytesScanned *int64 `type:"long"` - - // The creation time of the query. - CreationTime *time.Time `type:"timestamp"` - - // The number of events that matched a query. - EventsMatched *int64 `type:"long"` - - // The number of events that the query scanned in the event data store. - EventsScanned *int64 `type:"long"` - - // The query's run time, in milliseconds. - ExecutionTimeInMillis *int64 `type:"integer"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s QueryStatisticsForDescribeQuery) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s QueryStatisticsForDescribeQuery) GoString() string { - return s.String() -} - -// SetBytesScanned sets the BytesScanned field's value. -func (s *QueryStatisticsForDescribeQuery) SetBytesScanned(v int64) *QueryStatisticsForDescribeQuery { - s.BytesScanned = &v - return s -} - -// SetCreationTime sets the CreationTime field's value. -func (s *QueryStatisticsForDescribeQuery) SetCreationTime(v time.Time) *QueryStatisticsForDescribeQuery { - s.CreationTime = &v - return s -} - -// SetEventsMatched sets the EventsMatched field's value. -func (s *QueryStatisticsForDescribeQuery) SetEventsMatched(v int64) *QueryStatisticsForDescribeQuery { - s.EventsMatched = &v - return s -} - -// SetEventsScanned sets the EventsScanned field's value. -func (s *QueryStatisticsForDescribeQuery) SetEventsScanned(v int64) *QueryStatisticsForDescribeQuery { - s.EventsScanned = &v - return s -} - -// SetExecutionTimeInMillis sets the ExecutionTimeInMillis field's value. -func (s *QueryStatisticsForDescribeQuery) SetExecutionTimeInMillis(v int64) *QueryStatisticsForDescribeQuery { - s.ExecutionTimeInMillis = &v - return s -} - -// Specifies an organization member account ID as a CloudTrail delegated administrator. -type RegisterOrganizationDelegatedAdminInput struct { - _ struct{} `type:"structure"` - - // An organization member account ID that you want to designate as a delegated - // administrator. - // - // MemberAccountId is a required field - MemberAccountId *string `min:"12" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RegisterOrganizationDelegatedAdminInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RegisterOrganizationDelegatedAdminInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterOrganizationDelegatedAdminInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterOrganizationDelegatedAdminInput"} - if s.MemberAccountId == nil { - invalidParams.Add(request.NewErrParamRequired("MemberAccountId")) - } - if s.MemberAccountId != nil && len(*s.MemberAccountId) < 12 { - invalidParams.Add(request.NewErrParamMinLen("MemberAccountId", 12)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMemberAccountId sets the MemberAccountId field's value. -func (s *RegisterOrganizationDelegatedAdminInput) SetMemberAccountId(v string) *RegisterOrganizationDelegatedAdminInput { - s.MemberAccountId = &v - return s -} - -// Returns the following response if successful. Otherwise, returns an error. -type RegisterOrganizationDelegatedAdminOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RegisterOrganizationDelegatedAdminOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RegisterOrganizationDelegatedAdminOutput) GoString() string { - return s.String() -} - -// Specifies the tags to remove from a trail, event data store, or channel. -type RemoveTagsInput struct { - _ struct{} `type:"structure"` - - // Specifies the ARN of the trail, event data store, or channel from which tags - // should be removed. - // - // Example trail ARN format: arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail - // - // Example event data store ARN format: arn:aws:cloudtrail:us-east-2:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE - // - // Example channel ARN format: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 - // - // ResourceId is a required field - ResourceId *string `type:"string" required:"true"` - - // Specifies a list of tags to be removed. - // - // TagsList is a required field - TagsList []*Tag `type:"list" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RemoveTagsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RemoveTagsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveTagsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveTagsInput"} - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.TagsList == nil { - invalidParams.Add(request.NewErrParamRequired("TagsList")) - } - if s.TagsList != nil { - for i, v := range s.TagsList { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagsList", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceId sets the ResourceId field's value. -func (s *RemoveTagsInput) SetResourceId(v string) *RemoveTagsInput { - s.ResourceId = &v - return s -} - -// SetTagsList sets the TagsList field's value. -func (s *RemoveTagsInput) SetTagsList(v []*Tag) *RemoveTagsInput { - s.TagsList = v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -type RemoveTagsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RemoveTagsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RemoveTagsOutput) GoString() string { - return s.String() -} - -// Specifies the type and name of a resource referenced by an event. -type Resource struct { - _ struct{} `type:"structure"` - - // The name of the resource referenced by the event returned. These are user-created - // names whose values will depend on the environment. For example, the resource - // name might be "auto-scaling-test-group" for an Auto Scaling Group or "i-1234567" - // for an EC2 Instance. - ResourceName *string `type:"string"` - - // The type of a resource referenced by the event returned. When the resource - // type cannot be determined, null is returned. Some examples of resource types - // are: Instance for EC2, Trail for CloudTrail, DBInstance for Amazon RDS, and - // AccessKey for IAM. To learn more about how to look up and filter events by - // the resource types supported for a service, see Filtering CloudTrail Events - // (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/view-cloudtrail-events-console.html#filtering-cloudtrail-events). - ResourceType *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Resource) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Resource) GoString() string { - return s.String() -} - -// SetResourceName sets the ResourceName field's value. -func (s *Resource) SetResourceName(v string) *Resource { - s.ResourceName = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *Resource) SetResourceType(v string) *Resource { - s.ResourceType = &v - return s -} - -// This exception is thrown when the provided resource does not exist, or the -// ARN format of the resource is not valid. The following is the valid format -// for a resource ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/MyChannel. -type ResourceARNNotValidException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ResourceARNNotValidException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ResourceARNNotValidException) GoString() string { - return s.String() -} - -func newErrorResourceARNNotValidException(v protocol.ResponseMetadata) error { - return &ResourceARNNotValidException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceARNNotValidException) Code() string { - return "ResourceARNNotValidException" -} - -// Message returns the exception's message. -func (s *ResourceARNNotValidException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceARNNotValidException) OrigErr() error { - return nil -} - -func (s *ResourceARNNotValidException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceARNNotValidException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceARNNotValidException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the specified resource is not found. -type ResourceNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ResourceNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ResourceNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourceNotFoundException(v protocol.ResponseMetadata) error { - return &ResourceNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceNotFoundException) Code() string { - return "ResourceNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourceNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourceNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the specified resource policy is not found. -type ResourcePolicyNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ResourcePolicyNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ResourcePolicyNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourcePolicyNotFoundException(v protocol.ResponseMetadata) error { - return &ResourcePolicyNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourcePolicyNotFoundException) Code() string { - return "ResourcePolicyNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourcePolicyNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourcePolicyNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourcePolicyNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourcePolicyNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourcePolicyNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the resouce-based policy has syntax errors, -// or contains a principal that is not valid. -// -// The following are requirements for the resource policy: -// -// - Contains only one action: cloudtrail-data:PutAuditEvents -// -// - Contains at least one statement. The policy can have a maximum of 20 -// statements. -// -// - Each statement contains at least one principal. A statement can have -// a maximum of 50 principals. -type ResourcePolicyNotValidException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ResourcePolicyNotValidException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ResourcePolicyNotValidException) GoString() string { - return s.String() -} - -func newErrorResourcePolicyNotValidException(v protocol.ResponseMetadata) error { - return &ResourcePolicyNotValidException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourcePolicyNotValidException) Code() string { - return "ResourcePolicyNotValidException" -} - -// Message returns the exception's message. -func (s *ResourcePolicyNotValidException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourcePolicyNotValidException) OrigErr() error { - return nil -} - -func (s *ResourcePolicyNotValidException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourcePolicyNotValidException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourcePolicyNotValidException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A resource tag. -type ResourceTag struct { - _ struct{} `type:"structure"` - - // Specifies the ARN of the resource. - ResourceId *string `type:"string"` - - // A list of tags. - TagsList []*Tag `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ResourceTag) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ResourceTag) GoString() string { - return s.String() -} - -// SetResourceId sets the ResourceId field's value. -func (s *ResourceTag) SetResourceId(v string) *ResourceTag { - s.ResourceId = &v - return s -} - -// SetTagsList sets the TagsList field's value. -func (s *ResourceTag) SetTagsList(v []*Tag) *ResourceTag { - s.TagsList = v - return s -} - -// This exception is thrown when the specified resource type is not supported -// by CloudTrail. -type ResourceTypeNotSupportedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ResourceTypeNotSupportedException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ResourceTypeNotSupportedException) GoString() string { - return s.String() -} - -func newErrorResourceTypeNotSupportedException(v protocol.ResponseMetadata) error { - return &ResourceTypeNotSupportedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourceTypeNotSupportedException) Code() string { - return "ResourceTypeNotSupportedException" -} - -// Message returns the exception's message. -func (s *ResourceTypeNotSupportedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourceTypeNotSupportedException) OrigErr() error { - return nil -} - -func (s *ResourceTypeNotSupportedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourceTypeNotSupportedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourceTypeNotSupportedException) RequestID() string { - return s.RespMetadata.RequestID -} - -type RestoreEventDataStoreInput struct { - _ struct{} `type:"structure"` - - // The ARN (or the ID suffix of the ARN) of the event data store that you want - // to restore. - // - // EventDataStore is a required field - EventDataStore *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RestoreEventDataStoreInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RestoreEventDataStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreEventDataStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreEventDataStoreInput"} - if s.EventDataStore == nil { - invalidParams.Add(request.NewErrParamRequired("EventDataStore")) - } - if s.EventDataStore != nil && len(*s.EventDataStore) < 3 { - invalidParams.Add(request.NewErrParamMinLen("EventDataStore", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEventDataStore sets the EventDataStore field's value. -func (s *RestoreEventDataStoreInput) SetEventDataStore(v string) *RestoreEventDataStoreInput { - s.EventDataStore = &v - return s -} - -type RestoreEventDataStoreOutput struct { - _ struct{} `type:"structure"` - - // The advanced event selectors that were used to select events. - AdvancedEventSelectors []*AdvancedEventSelector `type:"list"` - - // The timestamp of an event data store's creation. - CreatedTimestamp *time.Time `type:"timestamp"` - - // The event data store ARN. - EventDataStoreArn *string `min:"3" type:"string"` - - // Specifies the KMS key ID that encrypts the events delivered by CloudTrail. - // The value is a fully specified ARN to a KMS key in the following format. - // - // arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 - KmsKeyId *string `min:"1" type:"string"` - - // Indicates whether the event data store is collecting events from all regions, - // or only from the region in which the event data store was created. - MultiRegionEnabled *bool `type:"boolean"` - - // The name of the event data store. - Name *string `min:"3" type:"string"` - - // Indicates whether an event data store is collecting logged events for an - // organization in Organizations. - OrganizationEnabled *bool `type:"boolean"` - - // The retention period, in days. - RetentionPeriod *int64 `min:"7" type:"integer"` - - // The status of the event data store. - Status *string `type:"string" enum:"EventDataStoreStatus"` - - // Indicates that termination protection is enabled and the event data store - // cannot be automatically deleted. - TerminationProtectionEnabled *bool `type:"boolean"` - - // The timestamp that shows when an event data store was updated, if applicable. - // UpdatedTimestamp is always either the same or newer than the time shown in - // CreatedTimestamp. - UpdatedTimestamp *time.Time `type:"timestamp"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RestoreEventDataStoreOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RestoreEventDataStoreOutput) GoString() string { - return s.String() -} - -// SetAdvancedEventSelectors sets the AdvancedEventSelectors field's value. -func (s *RestoreEventDataStoreOutput) SetAdvancedEventSelectors(v []*AdvancedEventSelector) *RestoreEventDataStoreOutput { - s.AdvancedEventSelectors = v - return s -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *RestoreEventDataStoreOutput) SetCreatedTimestamp(v time.Time) *RestoreEventDataStoreOutput { - s.CreatedTimestamp = &v - return s -} - -// SetEventDataStoreArn sets the EventDataStoreArn field's value. -func (s *RestoreEventDataStoreOutput) SetEventDataStoreArn(v string) *RestoreEventDataStoreOutput { - s.EventDataStoreArn = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *RestoreEventDataStoreOutput) SetKmsKeyId(v string) *RestoreEventDataStoreOutput { - s.KmsKeyId = &v - return s -} - -// SetMultiRegionEnabled sets the MultiRegionEnabled field's value. -func (s *RestoreEventDataStoreOutput) SetMultiRegionEnabled(v bool) *RestoreEventDataStoreOutput { - s.MultiRegionEnabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *RestoreEventDataStoreOutput) SetName(v string) *RestoreEventDataStoreOutput { - s.Name = &v - return s -} - -// SetOrganizationEnabled sets the OrganizationEnabled field's value. -func (s *RestoreEventDataStoreOutput) SetOrganizationEnabled(v bool) *RestoreEventDataStoreOutput { - s.OrganizationEnabled = &v - return s -} - -// SetRetentionPeriod sets the RetentionPeriod field's value. -func (s *RestoreEventDataStoreOutput) SetRetentionPeriod(v int64) *RestoreEventDataStoreOutput { - s.RetentionPeriod = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *RestoreEventDataStoreOutput) SetStatus(v string) *RestoreEventDataStoreOutput { - s.Status = &v - return s -} - -// SetTerminationProtectionEnabled sets the TerminationProtectionEnabled field's value. -func (s *RestoreEventDataStoreOutput) SetTerminationProtectionEnabled(v bool) *RestoreEventDataStoreOutput { - s.TerminationProtectionEnabled = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *RestoreEventDataStoreOutput) SetUpdatedTimestamp(v time.Time) *RestoreEventDataStoreOutput { - s.UpdatedTimestamp = &v - return s -} - -// This exception is thrown when the specified S3 bucket does not exist. -type S3BucketDoesNotExistException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s S3BucketDoesNotExistException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s S3BucketDoesNotExistException) GoString() string { - return s.String() -} - -func newErrorS3BucketDoesNotExistException(v protocol.ResponseMetadata) error { - return &S3BucketDoesNotExistException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *S3BucketDoesNotExistException) Code() string { - return "S3BucketDoesNotExistException" -} - -// Message returns the exception's message. -func (s *S3BucketDoesNotExistException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *S3BucketDoesNotExistException) OrigErr() error { - return nil -} - -func (s *S3BucketDoesNotExistException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *S3BucketDoesNotExistException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *S3BucketDoesNotExistException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The settings for the source S3 bucket. -type S3ImportSource struct { - _ struct{} `type:"structure"` - - // The IAM ARN role used to access the source S3 bucket. - // - // S3BucketAccessRoleArn is a required field - S3BucketAccessRoleArn *string `type:"string" required:"true"` - - // The region associated with the source S3 bucket. - // - // S3BucketRegion is a required field - S3BucketRegion *string `type:"string" required:"true"` - - // The URI for the source S3 bucket. - // - // S3LocationUri is a required field - S3LocationUri *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s S3ImportSource) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s S3ImportSource) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *S3ImportSource) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "S3ImportSource"} - if s.S3BucketAccessRoleArn == nil { - invalidParams.Add(request.NewErrParamRequired("S3BucketAccessRoleArn")) - } - if s.S3BucketRegion == nil { - invalidParams.Add(request.NewErrParamRequired("S3BucketRegion")) - } - if s.S3LocationUri == nil { - invalidParams.Add(request.NewErrParamRequired("S3LocationUri")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3BucketAccessRoleArn sets the S3BucketAccessRoleArn field's value. -func (s *S3ImportSource) SetS3BucketAccessRoleArn(v string) *S3ImportSource { - s.S3BucketAccessRoleArn = &v - return s -} - -// SetS3BucketRegion sets the S3BucketRegion field's value. -func (s *S3ImportSource) SetS3BucketRegion(v string) *S3ImportSource { - s.S3BucketRegion = &v - return s -} - -// SetS3LocationUri sets the S3LocationUri field's value. -func (s *S3ImportSource) SetS3LocationUri(v string) *S3ImportSource { - s.S3LocationUri = &v - return s -} - -// Contains configuration information about the channel. -type SourceConfig struct { - _ struct{} `type:"structure"` - - // The advanced event selectors that are configured for the channel. - AdvancedEventSelectors []*AdvancedEventSelector `type:"list"` - - // Specifies whether the channel applies to a single region or to all regions. - ApplyToAllRegions *bool `type:"boolean"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s SourceConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s SourceConfig) GoString() string { - return s.String() -} - -// SetAdvancedEventSelectors sets the AdvancedEventSelectors field's value. -func (s *SourceConfig) SetAdvancedEventSelectors(v []*AdvancedEventSelector) *SourceConfig { - s.AdvancedEventSelectors = v - return s -} - -// SetApplyToAllRegions sets the ApplyToAllRegions field's value. -func (s *SourceConfig) SetApplyToAllRegions(v bool) *SourceConfig { - s.ApplyToAllRegions = &v - return s -} - -type StartImportInput struct { - _ struct{} `type:"structure"` - - // The ARN of the destination event data store. Use this parameter for a new - // import. - Destinations []*string `min:"1" type:"list"` - - // Use with StartEventTime to bound a StartImport request, and limit imported - // trail events to only those events logged within a specified time period. - // When you specify a time range, CloudTrail checks the prefix and log file - // names to verify the names contain a date between the specified StartEventTime - // and EndEventTime before attempting to import events. - EndEventTime *time.Time `type:"timestamp"` - - // The ID of the import. Use this parameter when you are retrying an import. - ImportId *string `min:"36" type:"string"` - - // The source S3 bucket for the import. Use this parameter for a new import. - ImportSource *ImportSource `type:"structure"` - - // Use with EndEventTime to bound a StartImport request, and limit imported - // trail events to only those events logged within a specified time period. - // When you specify a time range, CloudTrail checks the prefix and log file - // names to verify the names contain a date between the specified StartEventTime - // and EndEventTime before attempting to import events. - StartEventTime *time.Time `type:"timestamp"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StartImportInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StartImportInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartImportInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartImportInput"} - if s.Destinations != nil && len(s.Destinations) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Destinations", 1)) - } - if s.ImportId != nil && len(*s.ImportId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ImportId", 36)) - } - if s.ImportSource != nil { - if err := s.ImportSource.Validate(); err != nil { - invalidParams.AddNested("ImportSource", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestinations sets the Destinations field's value. -func (s *StartImportInput) SetDestinations(v []*string) *StartImportInput { - s.Destinations = v - return s -} - -// SetEndEventTime sets the EndEventTime field's value. -func (s *StartImportInput) SetEndEventTime(v time.Time) *StartImportInput { - s.EndEventTime = &v - return s -} - -// SetImportId sets the ImportId field's value. -func (s *StartImportInput) SetImportId(v string) *StartImportInput { - s.ImportId = &v - return s -} - -// SetImportSource sets the ImportSource field's value. -func (s *StartImportInput) SetImportSource(v *ImportSource) *StartImportInput { - s.ImportSource = v - return s -} - -// SetStartEventTime sets the StartEventTime field's value. -func (s *StartImportInput) SetStartEventTime(v time.Time) *StartImportInput { - s.StartEventTime = &v - return s -} - -type StartImportOutput struct { - _ struct{} `type:"structure"` - - // The timestamp for the import's creation. - CreatedTimestamp *time.Time `type:"timestamp"` - - // The ARN of the destination event data store. - Destinations []*string `min:"1" type:"list"` - - // Used with StartEventTime to bound a StartImport request, and limit imported - // trail events to only those events logged within a specified time period. - EndEventTime *time.Time `type:"timestamp"` - - // The ID of the import. - ImportId *string `min:"36" type:"string"` - - // The source S3 bucket for the import. - ImportSource *ImportSource `type:"structure"` - - // Shows the status of the import after a StartImport request. An import finishes - // with a status of COMPLETED if there were no failures, or FAILED if there - // were failures. - ImportStatus *string `type:"string" enum:"ImportStatus"` - - // Used with EndEventTime to bound a StartImport request, and limit imported - // trail events to only those events logged within a specified time period. - StartEventTime *time.Time `type:"timestamp"` - - // The timestamp of the import's last update, if applicable. - UpdatedTimestamp *time.Time `type:"timestamp"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StartImportOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StartImportOutput) GoString() string { - return s.String() -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *StartImportOutput) SetCreatedTimestamp(v time.Time) *StartImportOutput { - s.CreatedTimestamp = &v - return s -} - -// SetDestinations sets the Destinations field's value. -func (s *StartImportOutput) SetDestinations(v []*string) *StartImportOutput { - s.Destinations = v - return s -} - -// SetEndEventTime sets the EndEventTime field's value. -func (s *StartImportOutput) SetEndEventTime(v time.Time) *StartImportOutput { - s.EndEventTime = &v - return s -} - -// SetImportId sets the ImportId field's value. -func (s *StartImportOutput) SetImportId(v string) *StartImportOutput { - s.ImportId = &v - return s -} - -// SetImportSource sets the ImportSource field's value. -func (s *StartImportOutput) SetImportSource(v *ImportSource) *StartImportOutput { - s.ImportSource = v - return s -} - -// SetImportStatus sets the ImportStatus field's value. -func (s *StartImportOutput) SetImportStatus(v string) *StartImportOutput { - s.ImportStatus = &v - return s -} - -// SetStartEventTime sets the StartEventTime field's value. -func (s *StartImportOutput) SetStartEventTime(v time.Time) *StartImportOutput { - s.StartEventTime = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *StartImportOutput) SetUpdatedTimestamp(v time.Time) *StartImportOutput { - s.UpdatedTimestamp = &v - return s -} - -// The request to CloudTrail to start logging Amazon Web Services API calls -// for an account. -type StartLoggingInput struct { - _ struct{} `type:"structure"` - - // Specifies the name or the CloudTrail ARN of the trail for which CloudTrail - // logs Amazon Web Services API calls. The following is the format of a trail - // ARN. - // - // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StartLoggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StartLoggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartLoggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartLoggingInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *StartLoggingInput) SetName(v string) *StartLoggingInput { - s.Name = &v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -type StartLoggingOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StartLoggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StartLoggingOutput) GoString() string { - return s.String() -} - -type StartQueryInput struct { - _ struct{} `type:"structure"` - - // The URI for the S3 bucket where CloudTrail delivers the query results. - DeliveryS3Uri *string `type:"string"` - - // The SQL code of your query. - // - // QueryStatement is a required field - QueryStatement *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StartQueryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StartQueryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartQueryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartQueryInput"} - if s.QueryStatement == nil { - invalidParams.Add(request.NewErrParamRequired("QueryStatement")) - } - if s.QueryStatement != nil && len(*s.QueryStatement) < 1 { - invalidParams.Add(request.NewErrParamMinLen("QueryStatement", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeliveryS3Uri sets the DeliveryS3Uri field's value. -func (s *StartQueryInput) SetDeliveryS3Uri(v string) *StartQueryInput { - s.DeliveryS3Uri = &v - return s -} - -// SetQueryStatement sets the QueryStatement field's value. -func (s *StartQueryInput) SetQueryStatement(v string) *StartQueryInput { - s.QueryStatement = &v - return s -} - -type StartQueryOutput struct { - _ struct{} `type:"structure"` - - // The ID of the started query. - QueryId *string `min:"36" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StartQueryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StartQueryOutput) GoString() string { - return s.String() -} - -// SetQueryId sets the QueryId field's value. -func (s *StartQueryOutput) SetQueryId(v string) *StartQueryOutput { - s.QueryId = &v - return s -} - -type StopImportInput struct { - _ struct{} `type:"structure"` - - // The ID of the import. - // - // ImportId is a required field - ImportId *string `min:"36" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StopImportInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StopImportInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopImportInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopImportInput"} - if s.ImportId == nil { - invalidParams.Add(request.NewErrParamRequired("ImportId")) - } - if s.ImportId != nil && len(*s.ImportId) < 36 { - invalidParams.Add(request.NewErrParamMinLen("ImportId", 36)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetImportId sets the ImportId field's value. -func (s *StopImportInput) SetImportId(v string) *StopImportInput { - s.ImportId = &v - return s -} - -type StopImportOutput struct { - _ struct{} `type:"structure"` - - // The timestamp of the import's creation. - CreatedTimestamp *time.Time `type:"timestamp"` - - // The ARN of the destination event data store. - Destinations []*string `min:"1" type:"list"` - - // Used with StartEventTime to bound a StartImport request, and limit imported - // trail events to only those events logged within a specified time period. - EndEventTime *time.Time `type:"timestamp"` - - // The ID for the import. - ImportId *string `min:"36" type:"string"` - - // The source S3 bucket for the import. - ImportSource *ImportSource `type:"structure"` - - // Returns information on the stopped import. - ImportStatistics *ImportStatistics `type:"structure"` - - // The status of the import. - ImportStatus *string `type:"string" enum:"ImportStatus"` - - // Used with EndEventTime to bound a StartImport request, and limit imported - // trail events to only those events logged within a specified time period. - StartEventTime *time.Time `type:"timestamp"` - - // The timestamp of the import's last update. - UpdatedTimestamp *time.Time `type:"timestamp"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StopImportOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StopImportOutput) GoString() string { - return s.String() -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *StopImportOutput) SetCreatedTimestamp(v time.Time) *StopImportOutput { - s.CreatedTimestamp = &v - return s -} - -// SetDestinations sets the Destinations field's value. -func (s *StopImportOutput) SetDestinations(v []*string) *StopImportOutput { - s.Destinations = v - return s -} - -// SetEndEventTime sets the EndEventTime field's value. -func (s *StopImportOutput) SetEndEventTime(v time.Time) *StopImportOutput { - s.EndEventTime = &v - return s -} - -// SetImportId sets the ImportId field's value. -func (s *StopImportOutput) SetImportId(v string) *StopImportOutput { - s.ImportId = &v - return s -} - -// SetImportSource sets the ImportSource field's value. -func (s *StopImportOutput) SetImportSource(v *ImportSource) *StopImportOutput { - s.ImportSource = v - return s -} - -// SetImportStatistics sets the ImportStatistics field's value. -func (s *StopImportOutput) SetImportStatistics(v *ImportStatistics) *StopImportOutput { - s.ImportStatistics = v - return s -} - -// SetImportStatus sets the ImportStatus field's value. -func (s *StopImportOutput) SetImportStatus(v string) *StopImportOutput { - s.ImportStatus = &v - return s -} - -// SetStartEventTime sets the StartEventTime field's value. -func (s *StopImportOutput) SetStartEventTime(v time.Time) *StopImportOutput { - s.StartEventTime = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *StopImportOutput) SetUpdatedTimestamp(v time.Time) *StopImportOutput { - s.UpdatedTimestamp = &v - return s -} - -// Passes the request to CloudTrail to stop logging Amazon Web Services API -// calls for the specified account. -type StopLoggingInput struct { - _ struct{} `type:"structure"` - - // Specifies the name or the CloudTrail ARN of the trail for which CloudTrail - // will stop logging Amazon Web Services API calls. The following is the format - // of a trail ARN. - // - // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail - // - // Name is a required field - Name *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StopLoggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StopLoggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StopLoggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StopLoggingInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *StopLoggingInput) SetName(v string) *StopLoggingInput { - s.Name = &v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -type StopLoggingOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StopLoggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StopLoggingOutput) GoString() string { - return s.String() -} - -// A custom key-value pair associated with a resource such as a CloudTrail trail, -// event data store, or channel. -type Tag struct { - _ struct{} `type:"structure"` - - // The key in a key-value pair. The key must be must be no longer than 128 Unicode - // characters. The key must be unique for the resource to which it applies. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The value in a key-value pair of a tag. The value must be no longer than - // 256 Unicode characters. - Value *string `min:"1" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Tag) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value != nil && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -// The number of tags per trail, event data store, or channel has exceeded the -// permitted amount. Currently, the limit is 50. -type TagsLimitExceededException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TagsLimitExceededException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TagsLimitExceededException) GoString() string { - return s.String() -} - -func newErrorTagsLimitExceededException(v protocol.ResponseMetadata) error { - return &TagsLimitExceededException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *TagsLimitExceededException) Code() string { - return "TagsLimitExceededException" -} - -// Message returns the exception's message. -func (s *TagsLimitExceededException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *TagsLimitExceededException) OrigErr() error { - return nil -} - -func (s *TagsLimitExceededException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *TagsLimitExceededException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *TagsLimitExceededException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The settings for a trail. -type Trail struct { - _ struct{} `type:"structure"` - - // Specifies an Amazon Resource Name (ARN), a unique identifier that represents - // the log group to which CloudTrail logs will be delivered. - CloudWatchLogsLogGroupArn *string `type:"string"` - - // Specifies the role for the CloudWatch Logs endpoint to assume to write to - // a user's log group. - CloudWatchLogsRoleArn *string `type:"string"` - - // Specifies if the trail has custom event selectors. - HasCustomEventSelectors *bool `type:"boolean"` - - // Specifies whether a trail has insight types specified in an InsightSelector - // list. - HasInsightSelectors *bool `type:"boolean"` - - // The region in which the trail was created. - HomeRegion *string `type:"string"` - - // Set to True to include Amazon Web Services API calls from Amazon Web Services - // global services such as IAM. Otherwise, False. - IncludeGlobalServiceEvents *bool `type:"boolean"` - - // Specifies whether the trail exists only in one region or exists in all regions. - IsMultiRegionTrail *bool `type:"boolean"` - - // Specifies whether the trail is an organization trail. - IsOrganizationTrail *bool `type:"boolean"` - - // Specifies the KMS key ID that encrypts the logs delivered by CloudTrail. - // The value is a fully specified ARN to a KMS key in the following format. - // - // arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 - KmsKeyId *string `type:"string"` - - // Specifies whether log file validation is enabled. - LogFileValidationEnabled *bool `type:"boolean"` - - // Name of the trail set by calling CreateTrail. The maximum length is 128 characters. - Name *string `type:"string"` - - // Name of the Amazon S3 bucket into which CloudTrail delivers your trail files. - // See Amazon S3 Bucket Naming Requirements (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html). - S3BucketName *string `type:"string"` - - // Specifies the Amazon S3 key prefix that comes after the name of the bucket - // you have designated for log file delivery. For more information, see Finding - // Your CloudTrail Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html). - // The maximum length is 200 characters. - S3KeyPrefix *string `type:"string"` - - // Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications - // when log files are delivered. The following is the format of a topic ARN. - // - // arn:aws:sns:us-east-2:123456789012:MyTopic - SnsTopicARN *string `type:"string"` - - // This field is no longer in use. Use SnsTopicARN. - // - // Deprecated: SnsTopicName has been deprecated - SnsTopicName *string `deprecated:"true" type:"string"` - - // Specifies the ARN of the trail. The following is the format of a trail ARN. - // - // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail - TrailARN *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Trail) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Trail) GoString() string { - return s.String() -} - -// SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value. -func (s *Trail) SetCloudWatchLogsLogGroupArn(v string) *Trail { - s.CloudWatchLogsLogGroupArn = &v - return s -} - -// SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value. -func (s *Trail) SetCloudWatchLogsRoleArn(v string) *Trail { - s.CloudWatchLogsRoleArn = &v - return s -} - -// SetHasCustomEventSelectors sets the HasCustomEventSelectors field's value. -func (s *Trail) SetHasCustomEventSelectors(v bool) *Trail { - s.HasCustomEventSelectors = &v - return s -} - -// SetHasInsightSelectors sets the HasInsightSelectors field's value. -func (s *Trail) SetHasInsightSelectors(v bool) *Trail { - s.HasInsightSelectors = &v - return s -} - -// SetHomeRegion sets the HomeRegion field's value. -func (s *Trail) SetHomeRegion(v string) *Trail { - s.HomeRegion = &v - return s -} - -// SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value. -func (s *Trail) SetIncludeGlobalServiceEvents(v bool) *Trail { - s.IncludeGlobalServiceEvents = &v - return s -} - -// SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value. -func (s *Trail) SetIsMultiRegionTrail(v bool) *Trail { - s.IsMultiRegionTrail = &v - return s -} - -// SetIsOrganizationTrail sets the IsOrganizationTrail field's value. -func (s *Trail) SetIsOrganizationTrail(v bool) *Trail { - s.IsOrganizationTrail = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *Trail) SetKmsKeyId(v string) *Trail { - s.KmsKeyId = &v - return s -} - -// SetLogFileValidationEnabled sets the LogFileValidationEnabled field's value. -func (s *Trail) SetLogFileValidationEnabled(v bool) *Trail { - s.LogFileValidationEnabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *Trail) SetName(v string) *Trail { - s.Name = &v - return s -} - -// SetS3BucketName sets the S3BucketName field's value. -func (s *Trail) SetS3BucketName(v string) *Trail { - s.S3BucketName = &v - return s -} - -// SetS3KeyPrefix sets the S3KeyPrefix field's value. -func (s *Trail) SetS3KeyPrefix(v string) *Trail { - s.S3KeyPrefix = &v - return s -} - -// SetSnsTopicARN sets the SnsTopicARN field's value. -func (s *Trail) SetSnsTopicARN(v string) *Trail { - s.SnsTopicARN = &v - return s -} - -// SetSnsTopicName sets the SnsTopicName field's value. -func (s *Trail) SetSnsTopicName(v string) *Trail { - s.SnsTopicName = &v - return s -} - -// SetTrailARN sets the TrailARN field's value. -func (s *Trail) SetTrailARN(v string) *Trail { - s.TrailARN = &v - return s -} - -// This exception is thrown when the specified trail already exists. -type TrailAlreadyExistsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TrailAlreadyExistsException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TrailAlreadyExistsException) GoString() string { - return s.String() -} - -func newErrorTrailAlreadyExistsException(v protocol.ResponseMetadata) error { - return &TrailAlreadyExistsException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *TrailAlreadyExistsException) Code() string { - return "TrailAlreadyExistsException" -} - -// Message returns the exception's message. -func (s *TrailAlreadyExistsException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *TrailAlreadyExistsException) OrigErr() error { - return nil -} - -func (s *TrailAlreadyExistsException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *TrailAlreadyExistsException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *TrailAlreadyExistsException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Information about a CloudTrail trail, including the trail's name, home region, -// and Amazon Resource Name (ARN). -type TrailInfo struct { - _ struct{} `type:"structure"` - - // The Amazon Web Services Region in which a trail was created. - HomeRegion *string `type:"string"` - - // The name of a trail. - Name *string `type:"string"` - - // The ARN of a trail. - TrailARN *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TrailInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TrailInfo) GoString() string { - return s.String() -} - -// SetHomeRegion sets the HomeRegion field's value. -func (s *TrailInfo) SetHomeRegion(v string) *TrailInfo { - s.HomeRegion = &v - return s -} - -// SetName sets the Name field's value. -func (s *TrailInfo) SetName(v string) *TrailInfo { - s.Name = &v - return s -} - -// SetTrailARN sets the TrailARN field's value. -func (s *TrailInfo) SetTrailARN(v string) *TrailInfo { - s.TrailARN = &v - return s -} - -// This exception is thrown when the trail with the given name is not found. -type TrailNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TrailNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TrailNotFoundException) GoString() string { - return s.String() -} - -func newErrorTrailNotFoundException(v protocol.ResponseMetadata) error { - return &TrailNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *TrailNotFoundException) Code() string { - return "TrailNotFoundException" -} - -// Message returns the exception's message. -func (s *TrailNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *TrailNotFoundException) OrigErr() error { - return nil -} - -func (s *TrailNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *TrailNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *TrailNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is no longer in use. -type TrailNotProvidedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TrailNotProvidedException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TrailNotProvidedException) GoString() string { - return s.String() -} - -func newErrorTrailNotProvidedException(v protocol.ResponseMetadata) error { - return &TrailNotProvidedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *TrailNotProvidedException) Code() string { - return "TrailNotProvidedException" -} - -// Message returns the exception's message. -func (s *TrailNotProvidedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *TrailNotProvidedException) OrigErr() error { - return nil -} - -func (s *TrailNotProvidedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *TrailNotProvidedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *TrailNotProvidedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This exception is thrown when the requested operation is not supported. -type UnsupportedOperationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UnsupportedOperationException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UnsupportedOperationException) GoString() string { - return s.String() -} - -func newErrorUnsupportedOperationException(v protocol.ResponseMetadata) error { - return &UnsupportedOperationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *UnsupportedOperationException) Code() string { - return "UnsupportedOperationException" -} - -// Message returns the exception's message. -func (s *UnsupportedOperationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *UnsupportedOperationException) OrigErr() error { - return nil -} - -func (s *UnsupportedOperationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *UnsupportedOperationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *UnsupportedOperationException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UpdateChannelInput struct { - _ struct{} `type:"structure"` - - // The ARN or ID (the ARN suffix) of the channel that you want to update. - // - // Channel is a required field - Channel *string `min:"3" type:"string" required:"true"` - - // The ARNs of event data stores that you want to log events arriving through - // the channel. - Destinations []*Destination `min:"1" type:"list"` - - // Changes the name of the channel. - Name *string `min:"3" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UpdateChannelInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UpdateChannelInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateChannelInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateChannelInput"} - if s.Channel == nil { - invalidParams.Add(request.NewErrParamRequired("Channel")) - } - if s.Channel != nil && len(*s.Channel) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Channel", 3)) - } - if s.Destinations != nil && len(s.Destinations) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Destinations", 1)) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.Destinations != nil { - for i, v := range s.Destinations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Destinations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChannel sets the Channel field's value. -func (s *UpdateChannelInput) SetChannel(v string) *UpdateChannelInput { - s.Channel = &v - return s -} - -// SetDestinations sets the Destinations field's value. -func (s *UpdateChannelInput) SetDestinations(v []*Destination) *UpdateChannelInput { - s.Destinations = v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateChannelInput) SetName(v string) *UpdateChannelInput { - s.Name = &v - return s -} - -type UpdateChannelOutput struct { - _ struct{} `type:"structure"` - - // The ARN of the channel that was updated. - ChannelArn *string `min:"3" type:"string"` - - // The event data stores that log events arriving through the channel. - Destinations []*Destination `min:"1" type:"list"` - - // The name of the channel that was updated. - Name *string `min:"3" type:"string"` - - // The event source of the channel that was updated. - Source *string `min:"1" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UpdateChannelOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UpdateChannelOutput) GoString() string { - return s.String() -} - -// SetChannelArn sets the ChannelArn field's value. -func (s *UpdateChannelOutput) SetChannelArn(v string) *UpdateChannelOutput { - s.ChannelArn = &v - return s -} - -// SetDestinations sets the Destinations field's value. -func (s *UpdateChannelOutput) SetDestinations(v []*Destination) *UpdateChannelOutput { - s.Destinations = v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateChannelOutput) SetName(v string) *UpdateChannelOutput { - s.Name = &v - return s -} - -// SetSource sets the Source field's value. -func (s *UpdateChannelOutput) SetSource(v string) *UpdateChannelOutput { - s.Source = &v - return s -} - -type UpdateEventDataStoreInput struct { - _ struct{} `type:"structure"` - - // The advanced event selectors used to select events for the event data store. - // You can configure up to five advanced event selectors for each event data - // store. - AdvancedEventSelectors []*AdvancedEventSelector `type:"list"` - - // The ARN (or the ID suffix of the ARN) of the event data store that you want - // to update. - // - // EventDataStore is a required field - EventDataStore *string `min:"3" type:"string" required:"true"` - - // Specifies the KMS key ID to use to encrypt the events delivered by CloudTrail. - // The value can be an alias name prefixed by alias/, a fully specified ARN - // to an alias, a fully specified ARN to a key, or a globally unique identifier. - // - // Disabling or deleting the KMS key, or removing CloudTrail permissions on - // the key, prevents CloudTrail from logging events to the event data store, - // and prevents users from querying the data in the event data store that was - // encrypted with the key. After you associate an event data store with a KMS - // key, the KMS key cannot be removed or changed. Before you disable or delete - // a KMS key that you are using with an event data store, delete or back up - // your event data store. - // - // CloudTrail also supports KMS multi-Region keys. For more information about - // multi-Region keys, see Using multi-Region keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) - // in the Key Management Service Developer Guide. - // - // Examples: - // - // * alias/MyAliasName - // - // * arn:aws:kms:us-east-2:123456789012:alias/MyAliasName - // - // * arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // * 12345678-1234-1234-1234-123456789012 - KmsKeyId *string `min:"1" type:"string"` - - // Specifies whether an event data store collects events from all regions, or - // only from the region in which it was created. - MultiRegionEnabled *bool `type:"boolean"` - - // The event data store name. - Name *string `min:"3" type:"string"` - - // Specifies whether an event data store collects events logged for an organization - // in Organizations. - OrganizationEnabled *bool `type:"boolean"` - - // The retention period, in days. - RetentionPeriod *int64 `min:"7" type:"integer"` - - // Indicates that termination protection is enabled and the event data store - // cannot be automatically deleted. - TerminationProtectionEnabled *bool `type:"boolean"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UpdateEventDataStoreInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UpdateEventDataStoreInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateEventDataStoreInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateEventDataStoreInput"} - if s.EventDataStore == nil { - invalidParams.Add(request.NewErrParamRequired("EventDataStore")) - } - if s.EventDataStore != nil && len(*s.EventDataStore) < 3 { - invalidParams.Add(request.NewErrParamMinLen("EventDataStore", 3)) - } - if s.KmsKeyId != nil && len(*s.KmsKeyId) < 1 { - invalidParams.Add(request.NewErrParamMinLen("KmsKeyId", 1)) - } - if s.Name != nil && len(*s.Name) < 3 { - invalidParams.Add(request.NewErrParamMinLen("Name", 3)) - } - if s.RetentionPeriod != nil && *s.RetentionPeriod < 7 { - invalidParams.Add(request.NewErrParamMinValue("RetentionPeriod", 7)) - } - if s.AdvancedEventSelectors != nil { - for i, v := range s.AdvancedEventSelectors { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AdvancedEventSelectors", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAdvancedEventSelectors sets the AdvancedEventSelectors field's value. -func (s *UpdateEventDataStoreInput) SetAdvancedEventSelectors(v []*AdvancedEventSelector) *UpdateEventDataStoreInput { - s.AdvancedEventSelectors = v - return s -} - -// SetEventDataStore sets the EventDataStore field's value. -func (s *UpdateEventDataStoreInput) SetEventDataStore(v string) *UpdateEventDataStoreInput { - s.EventDataStore = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *UpdateEventDataStoreInput) SetKmsKeyId(v string) *UpdateEventDataStoreInput { - s.KmsKeyId = &v - return s -} - -// SetMultiRegionEnabled sets the MultiRegionEnabled field's value. -func (s *UpdateEventDataStoreInput) SetMultiRegionEnabled(v bool) *UpdateEventDataStoreInput { - s.MultiRegionEnabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateEventDataStoreInput) SetName(v string) *UpdateEventDataStoreInput { - s.Name = &v - return s -} - -// SetOrganizationEnabled sets the OrganizationEnabled field's value. -func (s *UpdateEventDataStoreInput) SetOrganizationEnabled(v bool) *UpdateEventDataStoreInput { - s.OrganizationEnabled = &v - return s -} - -// SetRetentionPeriod sets the RetentionPeriod field's value. -func (s *UpdateEventDataStoreInput) SetRetentionPeriod(v int64) *UpdateEventDataStoreInput { - s.RetentionPeriod = &v - return s -} - -// SetTerminationProtectionEnabled sets the TerminationProtectionEnabled field's value. -func (s *UpdateEventDataStoreInput) SetTerminationProtectionEnabled(v bool) *UpdateEventDataStoreInput { - s.TerminationProtectionEnabled = &v - return s -} - -type UpdateEventDataStoreOutput struct { - _ struct{} `type:"structure"` - - // The advanced event selectors that are applied to the event data store. - AdvancedEventSelectors []*AdvancedEventSelector `type:"list"` - - // The timestamp that shows when an event data store was first created. - CreatedTimestamp *time.Time `type:"timestamp"` - - // The ARN of the event data store. - EventDataStoreArn *string `min:"3" type:"string"` - - // Specifies the KMS key ID that encrypts the events delivered by CloudTrail. - // The value is a fully specified ARN to a KMS key in the following format. - // - // arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 - KmsKeyId *string `min:"1" type:"string"` - - // Indicates whether the event data store includes events from all regions, - // or only from the region in which it was created. - MultiRegionEnabled *bool `type:"boolean"` - - // The name of the event data store. - Name *string `min:"3" type:"string"` - - // Indicates whether an event data store is collecting logged events for an - // organization in Organizations. - OrganizationEnabled *bool `type:"boolean"` - - // The retention period, in days. - RetentionPeriod *int64 `min:"7" type:"integer"` - - // The status of an event data store. Values can be ENABLED and PENDING_DELETION. - Status *string `type:"string" enum:"EventDataStoreStatus"` - - // Indicates whether termination protection is enabled for the event data store. - TerminationProtectionEnabled *bool `type:"boolean"` - - // The timestamp that shows when the event data store was last updated. UpdatedTimestamp - // is always either the same or newer than the time shown in CreatedTimestamp. - UpdatedTimestamp *time.Time `type:"timestamp"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UpdateEventDataStoreOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UpdateEventDataStoreOutput) GoString() string { - return s.String() -} - -// SetAdvancedEventSelectors sets the AdvancedEventSelectors field's value. -func (s *UpdateEventDataStoreOutput) SetAdvancedEventSelectors(v []*AdvancedEventSelector) *UpdateEventDataStoreOutput { - s.AdvancedEventSelectors = v - return s -} - -// SetCreatedTimestamp sets the CreatedTimestamp field's value. -func (s *UpdateEventDataStoreOutput) SetCreatedTimestamp(v time.Time) *UpdateEventDataStoreOutput { - s.CreatedTimestamp = &v - return s -} - -// SetEventDataStoreArn sets the EventDataStoreArn field's value. -func (s *UpdateEventDataStoreOutput) SetEventDataStoreArn(v string) *UpdateEventDataStoreOutput { - s.EventDataStoreArn = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *UpdateEventDataStoreOutput) SetKmsKeyId(v string) *UpdateEventDataStoreOutput { - s.KmsKeyId = &v - return s -} - -// SetMultiRegionEnabled sets the MultiRegionEnabled field's value. -func (s *UpdateEventDataStoreOutput) SetMultiRegionEnabled(v bool) *UpdateEventDataStoreOutput { - s.MultiRegionEnabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateEventDataStoreOutput) SetName(v string) *UpdateEventDataStoreOutput { - s.Name = &v - return s -} - -// SetOrganizationEnabled sets the OrganizationEnabled field's value. -func (s *UpdateEventDataStoreOutput) SetOrganizationEnabled(v bool) *UpdateEventDataStoreOutput { - s.OrganizationEnabled = &v - return s -} - -// SetRetentionPeriod sets the RetentionPeriod field's value. -func (s *UpdateEventDataStoreOutput) SetRetentionPeriod(v int64) *UpdateEventDataStoreOutput { - s.RetentionPeriod = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *UpdateEventDataStoreOutput) SetStatus(v string) *UpdateEventDataStoreOutput { - s.Status = &v - return s -} - -// SetTerminationProtectionEnabled sets the TerminationProtectionEnabled field's value. -func (s *UpdateEventDataStoreOutput) SetTerminationProtectionEnabled(v bool) *UpdateEventDataStoreOutput { - s.TerminationProtectionEnabled = &v - return s -} - -// SetUpdatedTimestamp sets the UpdatedTimestamp field's value. -func (s *UpdateEventDataStoreOutput) SetUpdatedTimestamp(v time.Time) *UpdateEventDataStoreOutput { - s.UpdatedTimestamp = &v - return s -} - -// Specifies settings to update for the trail. -type UpdateTrailInput struct { - _ struct{} `type:"structure"` - - // Specifies a log group name using an Amazon Resource Name (ARN), a unique - // identifier that represents the log group to which CloudTrail logs are delivered. - // You must use a log group that exists in your account. - // - // Not required unless you specify CloudWatchLogsRoleArn. - CloudWatchLogsLogGroupArn *string `type:"string"` - - // Specifies the role for the CloudWatch Logs endpoint to assume to write to - // a user's log group. You must use a role that exists in your account. - CloudWatchLogsRoleArn *string `type:"string"` - - // Specifies whether log file validation is enabled. The default is false. - // - // When you disable log file integrity validation, the chain of digest files - // is broken after one hour. CloudTrail does not create digest files for log - // files that were delivered during a period in which log file integrity validation - // was disabled. For example, if you enable log file integrity validation at - // noon on January 1, disable it at noon on January 2, and re-enable it at noon - // on January 10, digest files will not be created for the log files delivered - // from noon on January 2 to noon on January 10. The same applies whenever you - // stop CloudTrail logging or delete a trail. - EnableLogFileValidation *bool `type:"boolean"` - - // Specifies whether the trail is publishing events from global services such - // as IAM to the log files. - IncludeGlobalServiceEvents *bool `type:"boolean"` - - // Specifies whether the trail applies only to the current region or to all - // regions. The default is false. If the trail exists only in the current region - // and this value is set to true, shadow trails (replications of the trail) - // will be created in the other regions. If the trail exists in all regions - // and this value is set to false, the trail will remain in the region where - // it was created, and its shadow trails in other regions will be deleted. As - // a best practice, consider using trails that log events in all regions. - IsMultiRegionTrail *bool `type:"boolean"` - - // Specifies whether the trail is applied to all accounts in an organization - // in Organizations, or only for the current Amazon Web Services account. The - // default is false, and cannot be true unless the call is made on behalf of - // an Amazon Web Services account that is the management account or delegated - // administrator account for an organization in Organizations. If the trail - // is not an organization trail and this is set to true, the trail will be created - // in all Amazon Web Services accounts that belong to the organization. If the - // trail is an organization trail and this is set to false, the trail will remain - // in the current Amazon Web Services account but be deleted from all member - // accounts in the organization. - IsOrganizationTrail *bool `type:"boolean"` - - // Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. - // The value can be an alias name prefixed by "alias/", a fully specified ARN - // to an alias, a fully specified ARN to a key, or a globally unique identifier. - // - // CloudTrail also supports KMS multi-Region keys. For more information about - // multi-Region keys, see Using multi-Region keys (https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html) - // in the Key Management Service Developer Guide. - // - // Examples: - // - // * alias/MyAliasName - // - // * arn:aws:kms:us-east-2:123456789012:alias/MyAliasName - // - // * arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 - // - // * 12345678-1234-1234-1234-123456789012 - KmsKeyId *string `type:"string"` - - // Specifies the name of the trail or trail ARN. If Name is a trail name, the - // string must meet the following requirements: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores - // (_), or dashes (-) - // - // * Start with a letter or number, and end with a letter or number - // - // * Be between 3 and 128 characters - // - // * Have no adjacent periods, underscores or dashes. Names like my-_namespace - // and my--namespace are not valid. - // - // * Not be in IP address format (for example, 192.168.5.4) - // - // If Name is a trail ARN, it must be in the following format. - // - // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail - // - // Name is a required field - Name *string `type:"string" required:"true"` - - // Specifies the name of the Amazon S3 bucket designated for publishing log - // files. See Amazon S3 Bucket Naming Requirements (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/create_trail_naming_policy.html). - S3BucketName *string `type:"string"` - - // Specifies the Amazon S3 key prefix that comes after the name of the bucket - // you have designated for log file delivery. For more information, see Finding - // Your CloudTrail Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html). - // The maximum length is 200 characters. - S3KeyPrefix *string `type:"string"` - - // Specifies the name of the Amazon SNS topic defined for notification of log - // file delivery. The maximum length is 256 characters. - SnsTopicName *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UpdateTrailInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UpdateTrailInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateTrailInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateTrailInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value. -func (s *UpdateTrailInput) SetCloudWatchLogsLogGroupArn(v string) *UpdateTrailInput { - s.CloudWatchLogsLogGroupArn = &v - return s -} - -// SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value. -func (s *UpdateTrailInput) SetCloudWatchLogsRoleArn(v string) *UpdateTrailInput { - s.CloudWatchLogsRoleArn = &v - return s -} - -// SetEnableLogFileValidation sets the EnableLogFileValidation field's value. -func (s *UpdateTrailInput) SetEnableLogFileValidation(v bool) *UpdateTrailInput { - s.EnableLogFileValidation = &v - return s -} - -// SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value. -func (s *UpdateTrailInput) SetIncludeGlobalServiceEvents(v bool) *UpdateTrailInput { - s.IncludeGlobalServiceEvents = &v - return s -} - -// SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value. -func (s *UpdateTrailInput) SetIsMultiRegionTrail(v bool) *UpdateTrailInput { - s.IsMultiRegionTrail = &v - return s -} - -// SetIsOrganizationTrail sets the IsOrganizationTrail field's value. -func (s *UpdateTrailInput) SetIsOrganizationTrail(v bool) *UpdateTrailInput { - s.IsOrganizationTrail = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *UpdateTrailInput) SetKmsKeyId(v string) *UpdateTrailInput { - s.KmsKeyId = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateTrailInput) SetName(v string) *UpdateTrailInput { - s.Name = &v - return s -} - -// SetS3BucketName sets the S3BucketName field's value. -func (s *UpdateTrailInput) SetS3BucketName(v string) *UpdateTrailInput { - s.S3BucketName = &v - return s -} - -// SetS3KeyPrefix sets the S3KeyPrefix field's value. -func (s *UpdateTrailInput) SetS3KeyPrefix(v string) *UpdateTrailInput { - s.S3KeyPrefix = &v - return s -} - -// SetSnsTopicName sets the SnsTopicName field's value. -func (s *UpdateTrailInput) SetSnsTopicName(v string) *UpdateTrailInput { - s.SnsTopicName = &v - return s -} - -// Returns the objects or data listed below if successful. Otherwise, returns -// an error. -type UpdateTrailOutput struct { - _ struct{} `type:"structure"` - - // Specifies the Amazon Resource Name (ARN) of the log group to which CloudTrail - // logs are delivered. - CloudWatchLogsLogGroupArn *string `type:"string"` - - // Specifies the role for the CloudWatch Logs endpoint to assume to write to - // a user's log group. - CloudWatchLogsRoleArn *string `type:"string"` - - // Specifies whether the trail is publishing events from global services such - // as IAM to the log files. - IncludeGlobalServiceEvents *bool `type:"boolean"` - - // Specifies whether the trail exists in one region or in all regions. - IsMultiRegionTrail *bool `type:"boolean"` - - // Specifies whether the trail is an organization trail. - IsOrganizationTrail *bool `type:"boolean"` - - // Specifies the KMS key ID that encrypts the logs delivered by CloudTrail. - // The value is a fully specified ARN to a KMS key in the following format. - // - // arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012 - KmsKeyId *string `type:"string"` - - // Specifies whether log file integrity validation is enabled. - LogFileValidationEnabled *bool `type:"boolean"` - - // Specifies the name of the trail. - Name *string `type:"string"` - - // Specifies the name of the Amazon S3 bucket designated for publishing log - // files. - S3BucketName *string `type:"string"` - - // Specifies the Amazon S3 key prefix that comes after the name of the bucket - // you have designated for log file delivery. For more information, see Finding - // Your IAM Log Files (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-find-log-files.html). - S3KeyPrefix *string `type:"string"` - - // Specifies the ARN of the Amazon SNS topic that CloudTrail uses to send notifications - // when log files are delivered. The following is the format of a topic ARN. - // - // arn:aws:sns:us-east-2:123456789012:MyTopic - SnsTopicARN *string `type:"string"` - - // This field is no longer in use. Use UpdateTrailResponse$SnsTopicARN. - // - // Deprecated: SnsTopicName has been deprecated - SnsTopicName *string `deprecated:"true" type:"string"` - - // Specifies the ARN of the trail that was updated. The following is the format - // of a trail ARN. - // - // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail - TrailARN *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UpdateTrailOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UpdateTrailOutput) GoString() string { - return s.String() -} - -// SetCloudWatchLogsLogGroupArn sets the CloudWatchLogsLogGroupArn field's value. -func (s *UpdateTrailOutput) SetCloudWatchLogsLogGroupArn(v string) *UpdateTrailOutput { - s.CloudWatchLogsLogGroupArn = &v - return s -} - -// SetCloudWatchLogsRoleArn sets the CloudWatchLogsRoleArn field's value. -func (s *UpdateTrailOutput) SetCloudWatchLogsRoleArn(v string) *UpdateTrailOutput { - s.CloudWatchLogsRoleArn = &v - return s -} - -// SetIncludeGlobalServiceEvents sets the IncludeGlobalServiceEvents field's value. -func (s *UpdateTrailOutput) SetIncludeGlobalServiceEvents(v bool) *UpdateTrailOutput { - s.IncludeGlobalServiceEvents = &v - return s -} - -// SetIsMultiRegionTrail sets the IsMultiRegionTrail field's value. -func (s *UpdateTrailOutput) SetIsMultiRegionTrail(v bool) *UpdateTrailOutput { - s.IsMultiRegionTrail = &v - return s -} - -// SetIsOrganizationTrail sets the IsOrganizationTrail field's value. -func (s *UpdateTrailOutput) SetIsOrganizationTrail(v bool) *UpdateTrailOutput { - s.IsOrganizationTrail = &v - return s -} - -// SetKmsKeyId sets the KmsKeyId field's value. -func (s *UpdateTrailOutput) SetKmsKeyId(v string) *UpdateTrailOutput { - s.KmsKeyId = &v - return s -} - -// SetLogFileValidationEnabled sets the LogFileValidationEnabled field's value. -func (s *UpdateTrailOutput) SetLogFileValidationEnabled(v bool) *UpdateTrailOutput { - s.LogFileValidationEnabled = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdateTrailOutput) SetName(v string) *UpdateTrailOutput { - s.Name = &v - return s -} - -// SetS3BucketName sets the S3BucketName field's value. -func (s *UpdateTrailOutput) SetS3BucketName(v string) *UpdateTrailOutput { - s.S3BucketName = &v - return s -} - -// SetS3KeyPrefix sets the S3KeyPrefix field's value. -func (s *UpdateTrailOutput) SetS3KeyPrefix(v string) *UpdateTrailOutput { - s.S3KeyPrefix = &v - return s -} - -// SetSnsTopicARN sets the SnsTopicARN field's value. -func (s *UpdateTrailOutput) SetSnsTopicARN(v string) *UpdateTrailOutput { - s.SnsTopicARN = &v - return s -} - -// SetSnsTopicName sets the SnsTopicName field's value. -func (s *UpdateTrailOutput) SetSnsTopicName(v string) *UpdateTrailOutput { - s.SnsTopicName = &v - return s -} - -// SetTrailARN sets the TrailARN field's value. -func (s *UpdateTrailOutput) SetTrailARN(v string) *UpdateTrailOutput { - s.TrailARN = &v - return s -} - -const ( - // DeliveryStatusSuccess is a DeliveryStatus enum value - DeliveryStatusSuccess = "SUCCESS" - - // DeliveryStatusFailed is a DeliveryStatus enum value - DeliveryStatusFailed = "FAILED" - - // DeliveryStatusFailedSigningFile is a DeliveryStatus enum value - DeliveryStatusFailedSigningFile = "FAILED_SIGNING_FILE" - - // DeliveryStatusPending is a DeliveryStatus enum value - DeliveryStatusPending = "PENDING" - - // DeliveryStatusResourceNotFound is a DeliveryStatus enum value - DeliveryStatusResourceNotFound = "RESOURCE_NOT_FOUND" - - // DeliveryStatusAccessDenied is a DeliveryStatus enum value - DeliveryStatusAccessDenied = "ACCESS_DENIED" - - // DeliveryStatusAccessDeniedSigningFile is a DeliveryStatus enum value - DeliveryStatusAccessDeniedSigningFile = "ACCESS_DENIED_SIGNING_FILE" - - // DeliveryStatusCancelled is a DeliveryStatus enum value - DeliveryStatusCancelled = "CANCELLED" - - // DeliveryStatusUnknown is a DeliveryStatus enum value - DeliveryStatusUnknown = "UNKNOWN" -) - -// DeliveryStatus_Values returns all elements of the DeliveryStatus enum -func DeliveryStatus_Values() []string { - return []string{ - DeliveryStatusSuccess, - DeliveryStatusFailed, - DeliveryStatusFailedSigningFile, - DeliveryStatusPending, - DeliveryStatusResourceNotFound, - DeliveryStatusAccessDenied, - DeliveryStatusAccessDeniedSigningFile, - DeliveryStatusCancelled, - DeliveryStatusUnknown, - } -} - -const ( - // DestinationTypeEventDataStore is a DestinationType enum value - DestinationTypeEventDataStore = "EVENT_DATA_STORE" - - // DestinationTypeAwsService is a DestinationType enum value - DestinationTypeAwsService = "AWS_SERVICE" -) - -// DestinationType_Values returns all elements of the DestinationType enum -func DestinationType_Values() []string { - return []string{ - DestinationTypeEventDataStore, - DestinationTypeAwsService, - } -} - -const ( - // EventCategoryInsight is a EventCategory enum value - EventCategoryInsight = "insight" -) - -// EventCategory_Values returns all elements of the EventCategory enum -func EventCategory_Values() []string { - return []string{ - EventCategoryInsight, - } -} - -const ( - // EventDataStoreStatusCreated is a EventDataStoreStatus enum value - EventDataStoreStatusCreated = "CREATED" - - // EventDataStoreStatusEnabled is a EventDataStoreStatus enum value - EventDataStoreStatusEnabled = "ENABLED" - - // EventDataStoreStatusPendingDeletion is a EventDataStoreStatus enum value - EventDataStoreStatusPendingDeletion = "PENDING_DELETION" -) - -// EventDataStoreStatus_Values returns all elements of the EventDataStoreStatus enum -func EventDataStoreStatus_Values() []string { - return []string{ - EventDataStoreStatusCreated, - EventDataStoreStatusEnabled, - EventDataStoreStatusPendingDeletion, - } -} - -const ( - // ImportFailureStatusFailed is a ImportFailureStatus enum value - ImportFailureStatusFailed = "FAILED" - - // ImportFailureStatusRetry is a ImportFailureStatus enum value - ImportFailureStatusRetry = "RETRY" - - // ImportFailureStatusSucceeded is a ImportFailureStatus enum value - ImportFailureStatusSucceeded = "SUCCEEDED" -) - -// ImportFailureStatus_Values returns all elements of the ImportFailureStatus enum -func ImportFailureStatus_Values() []string { - return []string{ - ImportFailureStatusFailed, - ImportFailureStatusRetry, - ImportFailureStatusSucceeded, - } -} - -const ( - // ImportStatusInitializing is a ImportStatus enum value - ImportStatusInitializing = "INITIALIZING" - - // ImportStatusInProgress is a ImportStatus enum value - ImportStatusInProgress = "IN_PROGRESS" - - // ImportStatusFailed is a ImportStatus enum value - ImportStatusFailed = "FAILED" - - // ImportStatusStopped is a ImportStatus enum value - ImportStatusStopped = "STOPPED" - - // ImportStatusCompleted is a ImportStatus enum value - ImportStatusCompleted = "COMPLETED" -) - -// ImportStatus_Values returns all elements of the ImportStatus enum -func ImportStatus_Values() []string { - return []string{ - ImportStatusInitializing, - ImportStatusInProgress, - ImportStatusFailed, - ImportStatusStopped, - ImportStatusCompleted, - } -} - -const ( - // InsightTypeApiCallRateInsight is a InsightType enum value - InsightTypeApiCallRateInsight = "ApiCallRateInsight" - - // InsightTypeApiErrorRateInsight is a InsightType enum value - InsightTypeApiErrorRateInsight = "ApiErrorRateInsight" -) - -// InsightType_Values returns all elements of the InsightType enum -func InsightType_Values() []string { - return []string{ - InsightTypeApiCallRateInsight, - InsightTypeApiErrorRateInsight, - } -} - -const ( - // LookupAttributeKeyEventId is a LookupAttributeKey enum value - LookupAttributeKeyEventId = "EventId" - - // LookupAttributeKeyEventName is a LookupAttributeKey enum value - LookupAttributeKeyEventName = "EventName" - - // LookupAttributeKeyReadOnly is a LookupAttributeKey enum value - LookupAttributeKeyReadOnly = "ReadOnly" - - // LookupAttributeKeyUsername is a LookupAttributeKey enum value - LookupAttributeKeyUsername = "Username" - - // LookupAttributeKeyResourceType is a LookupAttributeKey enum value - LookupAttributeKeyResourceType = "ResourceType" - - // LookupAttributeKeyResourceName is a LookupAttributeKey enum value - LookupAttributeKeyResourceName = "ResourceName" - - // LookupAttributeKeyEventSource is a LookupAttributeKey enum value - LookupAttributeKeyEventSource = "EventSource" - - // LookupAttributeKeyAccessKeyId is a LookupAttributeKey enum value - LookupAttributeKeyAccessKeyId = "AccessKeyId" -) - -// LookupAttributeKey_Values returns all elements of the LookupAttributeKey enum -func LookupAttributeKey_Values() []string { - return []string{ - LookupAttributeKeyEventId, - LookupAttributeKeyEventName, - LookupAttributeKeyReadOnly, - LookupAttributeKeyUsername, - LookupAttributeKeyResourceType, - LookupAttributeKeyResourceName, - LookupAttributeKeyEventSource, - LookupAttributeKeyAccessKeyId, - } -} - -const ( - // QueryStatusQueued is a QueryStatus enum value - QueryStatusQueued = "QUEUED" - - // QueryStatusRunning is a QueryStatus enum value - QueryStatusRunning = "RUNNING" - - // QueryStatusFinished is a QueryStatus enum value - QueryStatusFinished = "FINISHED" - - // QueryStatusFailed is a QueryStatus enum value - QueryStatusFailed = "FAILED" - - // QueryStatusCancelled is a QueryStatus enum value - QueryStatusCancelled = "CANCELLED" - - // QueryStatusTimedOut is a QueryStatus enum value - QueryStatusTimedOut = "TIMED_OUT" -) - -// QueryStatus_Values returns all elements of the QueryStatus enum -func QueryStatus_Values() []string { - return []string{ - QueryStatusQueued, - QueryStatusRunning, - QueryStatusFinished, - QueryStatusFailed, - QueryStatusCancelled, - QueryStatusTimedOut, - } -} - -const ( - // ReadWriteTypeReadOnly is a ReadWriteType enum value - ReadWriteTypeReadOnly = "ReadOnly" - - // ReadWriteTypeWriteOnly is a ReadWriteType enum value - ReadWriteTypeWriteOnly = "WriteOnly" - - // ReadWriteTypeAll is a ReadWriteType enum value - ReadWriteTypeAll = "All" -) - -// ReadWriteType_Values returns all elements of the ReadWriteType enum -func ReadWriteType_Values() []string { - return []string{ - ReadWriteTypeReadOnly, - ReadWriteTypeWriteOnly, - ReadWriteTypeAll, - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/doc.go b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/doc.go deleted file mode 100644 index 18f38341d6..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/doc.go +++ /dev/null @@ -1,47 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package cloudtrail provides the client and types for making API -// requests to AWS CloudTrail. -// -// This is the CloudTrail API Reference. It provides descriptions of actions, -// data types, common parameters, and common errors for CloudTrail. -// -// CloudTrail is a web service that records Amazon Web Services API calls for -// your Amazon Web Services account and delivers log files to an Amazon S3 bucket. -// The recorded information includes the identity of the user, the start time -// of the Amazon Web Services API call, the source IP address, the request parameters, -// and the response elements returned by the service. -// -// As an alternative to the API, you can use one of the Amazon Web Services -// SDKs, which consist of libraries and sample code for various programming -// languages and platforms (Java, Ruby, .NET, iOS, Android, etc.). The SDKs -// provide programmatic access to CloudTrail. For example, the SDKs handle cryptographically -// signing requests, managing errors, and retrying requests automatically. For -// more information about the Amazon Web Services SDKs, including how to download -// and install them, see Tools to Build on Amazon Web Services (http://aws.amazon.com/tools/). -// -// See the CloudTrail User Guide (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html) -// for information about the data that is included with each Amazon Web Services -// API call listed in the log files. -// -// See https://docs.aws.amazon.com/goto/WebAPI/cloudtrail-2013-11-01 for more information on this service. -// -// See cloudtrail package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/cloudtrail/ -// -// # Using the Client -// -// To contact AWS CloudTrail with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS CloudTrail client CloudTrail for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/cloudtrail/#New -package cloudtrail diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/errors.go b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/errors.go deleted file mode 100644 index a9e1c90dfa..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/errors.go +++ /dev/null @@ -1,683 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package cloudtrail - -import ( - "github.com/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeARNInvalidException for service response error code - // "CloudTrailARNInvalidException". - // - // This exception is thrown when an operation is called with a trail ARN that - // is not valid. The following is the format of a trail ARN. - // - // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail - // - // This exception is also thrown when you call AddTags or RemoveTags on a trail, - // event data store, or channel with a resource ARN that is not valid. - // - // The following is the format of an event data store ARN: arn:aws:cloudtrail:us-east-2:12345678910:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE - // - // The following is the format of a channel ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 - ErrCodeARNInvalidException = "CloudTrailARNInvalidException" - - // ErrCodeAccessNotEnabledException for service response error code - // "CloudTrailAccessNotEnabledException". - // - // This exception is thrown when trusted access has not been enabled between - // CloudTrail and Organizations. For more information, see Enabling Trusted - // Access with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) - // and Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html). - ErrCodeAccessNotEnabledException = "CloudTrailAccessNotEnabledException" - - // ErrCodeAccountHasOngoingImportException for service response error code - // "AccountHasOngoingImportException". - // - // This exception is thrown when you start a new import and a previous import - // is still in progress. - ErrCodeAccountHasOngoingImportException = "AccountHasOngoingImportException" - - // ErrCodeAccountNotFoundException for service response error code - // "AccountNotFoundException". - // - // This exception is thrown when the specified account is not found or not part - // of an organization. - ErrCodeAccountNotFoundException = "AccountNotFoundException" - - // ErrCodeAccountNotRegisteredException for service response error code - // "AccountNotRegisteredException". - // - // This exception is thrown when the specified account is not registered as - // the CloudTrail delegated administrator. - ErrCodeAccountNotRegisteredException = "AccountNotRegisteredException" - - // ErrCodeAccountRegisteredException for service response error code - // "AccountRegisteredException". - // - // This exception is thrown when the account is already registered as the CloudTrail - // delegated administrator. - ErrCodeAccountRegisteredException = "AccountRegisteredException" - - // ErrCodeCannotDelegateManagementAccountException for service response error code - // "CannotDelegateManagementAccountException". - // - // This exception is thrown when the management account of an organization is - // registered as the CloudTrail delegated administrator. - ErrCodeCannotDelegateManagementAccountException = "CannotDelegateManagementAccountException" - - // ErrCodeChannelARNInvalidException for service response error code - // "ChannelARNInvalidException". - // - // This exception is thrown when the specified value of ChannelARN is not valid. - ErrCodeChannelARNInvalidException = "ChannelARNInvalidException" - - // ErrCodeChannelAlreadyExistsException for service response error code - // "ChannelAlreadyExistsException". - // - // This exception is thrown when the provided channel already exists. - ErrCodeChannelAlreadyExistsException = "ChannelAlreadyExistsException" - - // ErrCodeChannelExistsForEDSException for service response error code - // "ChannelExistsForEDSException". - // - // This exception is thrown when the specified event data store cannot yet be - // deleted because it is in use by a channel. - ErrCodeChannelExistsForEDSException = "ChannelExistsForEDSException" - - // ErrCodeChannelMaxLimitExceededException for service response error code - // "ChannelMaxLimitExceededException". - // - // This exception is thrown when the maximum number of channels limit is exceeded. - ErrCodeChannelMaxLimitExceededException = "ChannelMaxLimitExceededException" - - // ErrCodeChannelNotFoundException for service response error code - // "ChannelNotFoundException". - // - // This exception is thrown when CloudTrail cannot find the specified channel. - ErrCodeChannelNotFoundException = "ChannelNotFoundException" - - // ErrCodeCloudTrailInvalidClientTokenIdException for service response error code - // "CloudTrailInvalidClientTokenIdException". - // - // This exception is thrown when a call results in the InvalidClientTokenId - // error code. This can occur when you are creating or updating a trail to send - // notifications to an Amazon SNS topic that is in a suspended Amazon Web Services - // account. - ErrCodeCloudTrailInvalidClientTokenIdException = "CloudTrailInvalidClientTokenIdException" - - // ErrCodeCloudWatchLogsDeliveryUnavailableException for service response error code - // "CloudWatchLogsDeliveryUnavailableException". - // - // Cannot set a CloudWatch Logs delivery for this region. - ErrCodeCloudWatchLogsDeliveryUnavailableException = "CloudWatchLogsDeliveryUnavailableException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // This exception is thrown when the specified resource is not ready for an - // operation. This can occur when you try to run an operation on a resource - // before CloudTrail has time to fully load the resource, or because another - // operation is modifying the resource. If this exception occurs, wait a few - // minutes, and then try the operation again. - ErrCodeConflictException = "ConflictException" - - // ErrCodeDelegatedAdminAccountLimitExceededException for service response error code - // "DelegatedAdminAccountLimitExceededException". - // - // This exception is thrown when the maximum number of CloudTrail delegated - // administrators is reached. - ErrCodeDelegatedAdminAccountLimitExceededException = "DelegatedAdminAccountLimitExceededException" - - // ErrCodeEventDataStoreARNInvalidException for service response error code - // "EventDataStoreARNInvalidException". - // - // The specified event data store ARN is not valid or does not map to an event - // data store in your account. - ErrCodeEventDataStoreARNInvalidException = "EventDataStoreARNInvalidException" - - // ErrCodeEventDataStoreAlreadyExistsException for service response error code - // "EventDataStoreAlreadyExistsException". - // - // An event data store with that name already exists. - ErrCodeEventDataStoreAlreadyExistsException = "EventDataStoreAlreadyExistsException" - - // ErrCodeEventDataStoreHasOngoingImportException for service response error code - // "EventDataStoreHasOngoingImportException". - // - // This exception is thrown when you try to update or delete an event data store - // that currently has an import in progress. - ErrCodeEventDataStoreHasOngoingImportException = "EventDataStoreHasOngoingImportException" - - // ErrCodeEventDataStoreMaxLimitExceededException for service response error code - // "EventDataStoreMaxLimitExceededException". - // - // Your account has used the maximum number of event data stores. - ErrCodeEventDataStoreMaxLimitExceededException = "EventDataStoreMaxLimitExceededException" - - // ErrCodeEventDataStoreNotFoundException for service response error code - // "EventDataStoreNotFoundException". - // - // The specified event data store was not found. - ErrCodeEventDataStoreNotFoundException = "EventDataStoreNotFoundException" - - // ErrCodeEventDataStoreTerminationProtectedException for service response error code - // "EventDataStoreTerminationProtectedException". - // - // The event data store cannot be deleted because termination protection is - // enabled for it. - ErrCodeEventDataStoreTerminationProtectedException = "EventDataStoreTerminationProtectedException" - - // ErrCodeImportNotFoundException for service response error code - // "ImportNotFoundException". - // - // The specified import was not found. - ErrCodeImportNotFoundException = "ImportNotFoundException" - - // ErrCodeInactiveEventDataStoreException for service response error code - // "InactiveEventDataStoreException". - // - // The event data store is inactive. - ErrCodeInactiveEventDataStoreException = "InactiveEventDataStoreException" - - // ErrCodeInactiveQueryException for service response error code - // "InactiveQueryException". - // - // The specified query cannot be canceled because it is in the FINISHED, FAILED, - // TIMED_OUT, or CANCELLED state. - ErrCodeInactiveQueryException = "InactiveQueryException" - - // ErrCodeInsightNotEnabledException for service response error code - // "InsightNotEnabledException". - // - // If you run GetInsightSelectors on a trail that does not have Insights events - // enabled, the operation throws the exception InsightNotEnabledException. - ErrCodeInsightNotEnabledException = "InsightNotEnabledException" - - // ErrCodeInsufficientDependencyServiceAccessPermissionException for service response error code - // "InsufficientDependencyServiceAccessPermissionException". - // - // This exception is thrown when the IAM user or role that is used to create - // the organization resource lacks one or more required permissions for creating - // an organization resource in a required service. - ErrCodeInsufficientDependencyServiceAccessPermissionException = "InsufficientDependencyServiceAccessPermissionException" - - // ErrCodeInsufficientEncryptionPolicyException for service response error code - // "InsufficientEncryptionPolicyException". - // - // This exception is thrown when the policy on the S3 bucket or KMS key does - // not have sufficient permissions for the operation. - ErrCodeInsufficientEncryptionPolicyException = "InsufficientEncryptionPolicyException" - - // ErrCodeInsufficientS3BucketPolicyException for service response error code - // "InsufficientS3BucketPolicyException". - // - // This exception is thrown when the policy on the S3 bucket is not sufficient. - ErrCodeInsufficientS3BucketPolicyException = "InsufficientS3BucketPolicyException" - - // ErrCodeInsufficientSnsTopicPolicyException for service response error code - // "InsufficientSnsTopicPolicyException". - // - // This exception is thrown when the policy on the Amazon SNS topic is not sufficient. - ErrCodeInsufficientSnsTopicPolicyException = "InsufficientSnsTopicPolicyException" - - // ErrCodeInvalidCloudWatchLogsLogGroupArnException for service response error code - // "InvalidCloudWatchLogsLogGroupArnException". - // - // This exception is thrown when the provided CloudWatch Logs log group is not - // valid. - ErrCodeInvalidCloudWatchLogsLogGroupArnException = "InvalidCloudWatchLogsLogGroupArnException" - - // ErrCodeInvalidCloudWatchLogsRoleArnException for service response error code - // "InvalidCloudWatchLogsRoleArnException". - // - // This exception is thrown when the provided role is not valid. - ErrCodeInvalidCloudWatchLogsRoleArnException = "InvalidCloudWatchLogsRoleArnException" - - // ErrCodeInvalidDateRangeException for service response error code - // "InvalidDateRangeException". - // - // A date range for the query was specified that is not valid. Be sure that - // the start time is chronologically before the end time. For more information - // about writing a query, see Create or edit a query (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-create-edit-query.html) - // in the CloudTrail User Guide. - ErrCodeInvalidDateRangeException = "InvalidDateRangeException" - - // ErrCodeInvalidEventCategoryException for service response error code - // "InvalidEventCategoryException". - // - // Occurs if an event category that is not valid is specified as a value of - // EventCategory. - ErrCodeInvalidEventCategoryException = "InvalidEventCategoryException" - - // ErrCodeInvalidEventDataStoreCategoryException for service response error code - // "InvalidEventDataStoreCategoryException". - // - // This exception is thrown when event categories of specified event data stores - // are not valid. - ErrCodeInvalidEventDataStoreCategoryException = "InvalidEventDataStoreCategoryException" - - // ErrCodeInvalidEventDataStoreStatusException for service response error code - // "InvalidEventDataStoreStatusException". - // - // The event data store is not in a status that supports the operation. - ErrCodeInvalidEventDataStoreStatusException = "InvalidEventDataStoreStatusException" - - // ErrCodeInvalidEventSelectorsException for service response error code - // "InvalidEventSelectorsException". - // - // This exception is thrown when the PutEventSelectors operation is called with - // a number of event selectors, advanced event selectors, or data resources - // that is not valid. The combination of event selectors or advanced event selectors - // and data resources is not valid. A trail can have up to 5 event selectors. - // If a trail uses advanced event selectors, a maximum of 500 total values for - // all conditions in all advanced event selectors is allowed. A trail is limited - // to 250 data resources. These data resources can be distributed across event - // selectors, but the overall total cannot exceed 250. - // - // You can: - // - // * Specify a valid number of event selectors (1 to 5) for a trail. - // - // * Specify a valid number of data resources (1 to 250) for an event selector. - // The limit of number of resources on an individual event selector is configurable - // up to 250. However, this upper limit is allowed only if the total number - // of data resources does not exceed 250 across all event selectors for a - // trail. - // - // * Specify up to 500 values for all conditions in all advanced event selectors - // for a trail. - // - // * Specify a valid value for a parameter. For example, specifying the ReadWriteType - // parameter with a value of read-only is not valid. - ErrCodeInvalidEventSelectorsException = "InvalidEventSelectorsException" - - // ErrCodeInvalidHomeRegionException for service response error code - // "InvalidHomeRegionException". - // - // This exception is thrown when an operation is called on a trail from a region - // other than the region in which the trail was created. - ErrCodeInvalidHomeRegionException = "InvalidHomeRegionException" - - // ErrCodeInvalidImportSourceException for service response error code - // "InvalidImportSourceException". - // - // This exception is thrown when the provided source S3 bucket is not valid - // for import. - ErrCodeInvalidImportSourceException = "InvalidImportSourceException" - - // ErrCodeInvalidInsightSelectorsException for service response error code - // "InvalidInsightSelectorsException". - // - // The formatting or syntax of the InsightSelectors JSON statement in your PutInsightSelectors - // or GetInsightSelectors request is not valid, or the specified insight type - // in the InsightSelectors statement is not a valid insight type. - ErrCodeInvalidInsightSelectorsException = "InvalidInsightSelectorsException" - - // ErrCodeInvalidKmsKeyIdException for service response error code - // "InvalidKmsKeyIdException". - // - // This exception is thrown when the KMS key ARN is not valid. - ErrCodeInvalidKmsKeyIdException = "InvalidKmsKeyIdException" - - // ErrCodeInvalidLookupAttributesException for service response error code - // "InvalidLookupAttributesException". - // - // Occurs when a lookup attribute is specified that is not valid. - ErrCodeInvalidLookupAttributesException = "InvalidLookupAttributesException" - - // ErrCodeInvalidMaxResultsException for service response error code - // "InvalidMaxResultsException". - // - // This exception is thrown if the limit specified is not valid. - ErrCodeInvalidMaxResultsException = "InvalidMaxResultsException" - - // ErrCodeInvalidNextTokenException for service response error code - // "InvalidNextTokenException". - // - // A token that is not valid, or a token that was previously used in a request - // with different parameters. This exception is thrown if the token is not valid. - ErrCodeInvalidNextTokenException = "InvalidNextTokenException" - - // ErrCodeInvalidParameterCombinationException for service response error code - // "InvalidParameterCombinationException". - // - // This exception is thrown when the combination of parameters provided is not - // valid. - ErrCodeInvalidParameterCombinationException = "InvalidParameterCombinationException" - - // ErrCodeInvalidParameterException for service response error code - // "InvalidParameterException". - // - // The request includes a parameter that is not valid. - ErrCodeInvalidParameterException = "InvalidParameterException" - - // ErrCodeInvalidQueryStatementException for service response error code - // "InvalidQueryStatementException". - // - // The query that was submitted has validation errors, or uses incorrect syntax - // or unsupported keywords. For more information about writing a query, see - // Create or edit a query (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-create-edit-query.html) - // in the CloudTrail User Guide. - ErrCodeInvalidQueryStatementException = "InvalidQueryStatementException" - - // ErrCodeInvalidQueryStatusException for service response error code - // "InvalidQueryStatusException". - // - // The query status is not valid for the operation. - ErrCodeInvalidQueryStatusException = "InvalidQueryStatusException" - - // ErrCodeInvalidS3BucketNameException for service response error code - // "InvalidS3BucketNameException". - // - // This exception is thrown when the provided S3 bucket name is not valid. - ErrCodeInvalidS3BucketNameException = "InvalidS3BucketNameException" - - // ErrCodeInvalidS3PrefixException for service response error code - // "InvalidS3PrefixException". - // - // This exception is thrown when the provided S3 prefix is not valid. - ErrCodeInvalidS3PrefixException = "InvalidS3PrefixException" - - // ErrCodeInvalidSnsTopicNameException for service response error code - // "InvalidSnsTopicNameException". - // - // This exception is thrown when the provided SNS topic name is not valid. - ErrCodeInvalidSnsTopicNameException = "InvalidSnsTopicNameException" - - // ErrCodeInvalidSourceException for service response error code - // "InvalidSourceException". - // - // This exception is thrown when the specified value of Source is not valid. - ErrCodeInvalidSourceException = "InvalidSourceException" - - // ErrCodeInvalidTagParameterException for service response error code - // "InvalidTagParameterException". - // - // This exception is thrown when the specified tag key or values are not valid. - // It can also occur if there are duplicate tags or too many tags on the resource. - ErrCodeInvalidTagParameterException = "InvalidTagParameterException" - - // ErrCodeInvalidTimeRangeException for service response error code - // "InvalidTimeRangeException". - // - // Occurs if the timestamp values are not valid. Either the start time occurs - // after the end time, or the time range is outside the range of possible values. - ErrCodeInvalidTimeRangeException = "InvalidTimeRangeException" - - // ErrCodeInvalidTokenException for service response error code - // "InvalidTokenException". - // - // Reserved for future use. - ErrCodeInvalidTokenException = "InvalidTokenException" - - // ErrCodeInvalidTrailNameException for service response error code - // "InvalidTrailNameException". - // - // This exception is thrown when the provided trail name is not valid. Trail - // names must meet the following requirements: - // - // * Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores - // (_), or dashes (-) - // - // * Start with a letter or number, and end with a letter or number - // - // * Be between 3 and 128 characters - // - // * Have no adjacent periods, underscores or dashes. Names like my-_namespace - // and my--namespace are not valid. - // - // * Not be in IP address format (for example, 192.168.5.4) - ErrCodeInvalidTrailNameException = "InvalidTrailNameException" - - // ErrCodeKmsException for service response error code - // "KmsException". - // - // This exception is thrown when there is an issue with the specified KMS key - // and the trail or event data store can't be updated. - ErrCodeKmsException = "KmsException" - - // ErrCodeKmsKeyDisabledException for service response error code - // "KmsKeyDisabledException". - // - // This exception is no longer in use. - ErrCodeKmsKeyDisabledException = "KmsKeyDisabledException" - - // ErrCodeKmsKeyNotFoundException for service response error code - // "KmsKeyNotFoundException". - // - // This exception is thrown when the KMS key does not exist, when the S3 bucket - // and the KMS key are not in the same region, or when the KMS key associated - // with the Amazon SNS topic either does not exist or is not in the same region. - ErrCodeKmsKeyNotFoundException = "KmsKeyNotFoundException" - - // ErrCodeMaxConcurrentQueriesException for service response error code - // "MaxConcurrentQueriesException". - // - // You are already running the maximum number of concurrent queries. Wait a - // minute for some queries to finish, and then run the query again. - ErrCodeMaxConcurrentQueriesException = "MaxConcurrentQueriesException" - - // ErrCodeMaximumNumberOfTrailsExceededException for service response error code - // "MaximumNumberOfTrailsExceededException". - // - // This exception is thrown when the maximum number of trails is reached. - ErrCodeMaximumNumberOfTrailsExceededException = "MaximumNumberOfTrailsExceededException" - - // ErrCodeNoManagementAccountSLRExistsException for service response error code - // "NoManagementAccountSLRExistsException". - // - // This exception is thrown when the management account does not have a service-linked - // role. - ErrCodeNoManagementAccountSLRExistsException = "NoManagementAccountSLRExistsException" - - // ErrCodeNotOrganizationManagementAccountException for service response error code - // "NotOrganizationManagementAccountException". - // - // This exception is thrown when the account making the request is not the organization's - // management account. - ErrCodeNotOrganizationManagementAccountException = "NotOrganizationManagementAccountException" - - // ErrCodeNotOrganizationMasterAccountException for service response error code - // "NotOrganizationMasterAccountException". - // - // This exception is thrown when the Amazon Web Services account making the - // request to create or update an organization trail or event data store is - // not the management account for an organization in Organizations. For more - // information, see Prepare For Creating a Trail For Your Organization (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/creating-an-organizational-trail-prepare.html) - // or Create an event data store (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/query-event-data-store.html). - ErrCodeNotOrganizationMasterAccountException = "NotOrganizationMasterAccountException" - - // ErrCodeOperationNotPermittedException for service response error code - // "OperationNotPermittedException". - // - // This exception is thrown when the requested operation is not permitted. - ErrCodeOperationNotPermittedException = "OperationNotPermittedException" - - // ErrCodeOrganizationNotInAllFeaturesModeException for service response error code - // "OrganizationNotInAllFeaturesModeException". - // - // This exception is thrown when Organizations is not configured to support - // all features. All features must be enabled in Organizations to support creating - // an organization trail or event data store. - ErrCodeOrganizationNotInAllFeaturesModeException = "OrganizationNotInAllFeaturesModeException" - - // ErrCodeOrganizationsNotInUseException for service response error code - // "OrganizationsNotInUseException". - // - // This exception is thrown when the request is made from an Amazon Web Services - // account that is not a member of an organization. To make this request, sign - // in using the credentials of an account that belongs to an organization. - ErrCodeOrganizationsNotInUseException = "OrganizationsNotInUseException" - - // ErrCodeQueryIdNotFoundException for service response error code - // "QueryIdNotFoundException". - // - // The query ID does not exist or does not map to a query. - ErrCodeQueryIdNotFoundException = "QueryIdNotFoundException" - - // ErrCodeResourceARNNotValidException for service response error code - // "ResourceARNNotValidException". - // - // This exception is thrown when the provided resource does not exist, or the - // ARN format of the resource is not valid. The following is the valid format - // for a resource ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/MyChannel. - ErrCodeResourceARNNotValidException = "ResourceARNNotValidException" - - // ErrCodeResourceNotFoundException for service response error code - // "ResourceNotFoundException". - // - // This exception is thrown when the specified resource is not found. - ErrCodeResourceNotFoundException = "ResourceNotFoundException" - - // ErrCodeResourcePolicyNotFoundException for service response error code - // "ResourcePolicyNotFoundException". - // - // This exception is thrown when the specified resource policy is not found. - ErrCodeResourcePolicyNotFoundException = "ResourcePolicyNotFoundException" - - // ErrCodeResourcePolicyNotValidException for service response error code - // "ResourcePolicyNotValidException". - // - // This exception is thrown when the resouce-based policy has syntax errors, - // or contains a principal that is not valid. - // - // The following are requirements for the resource policy: - // - // * Contains only one action: cloudtrail-data:PutAuditEvents - // - // * Contains at least one statement. The policy can have a maximum of 20 - // statements. - // - // * Each statement contains at least one principal. A statement can have - // a maximum of 50 principals. - ErrCodeResourcePolicyNotValidException = "ResourcePolicyNotValidException" - - // ErrCodeResourceTypeNotSupportedException for service response error code - // "ResourceTypeNotSupportedException". - // - // This exception is thrown when the specified resource type is not supported - // by CloudTrail. - ErrCodeResourceTypeNotSupportedException = "ResourceTypeNotSupportedException" - - // ErrCodeS3BucketDoesNotExistException for service response error code - // "S3BucketDoesNotExistException". - // - // This exception is thrown when the specified S3 bucket does not exist. - ErrCodeS3BucketDoesNotExistException = "S3BucketDoesNotExistException" - - // ErrCodeTagsLimitExceededException for service response error code - // "TagsLimitExceededException". - // - // The number of tags per trail, event data store, or channel has exceeded the - // permitted amount. Currently, the limit is 50. - ErrCodeTagsLimitExceededException = "TagsLimitExceededException" - - // ErrCodeTrailAlreadyExistsException for service response error code - // "TrailAlreadyExistsException". - // - // This exception is thrown when the specified trail already exists. - ErrCodeTrailAlreadyExistsException = "TrailAlreadyExistsException" - - // ErrCodeTrailNotFoundException for service response error code - // "TrailNotFoundException". - // - // This exception is thrown when the trail with the given name is not found. - ErrCodeTrailNotFoundException = "TrailNotFoundException" - - // ErrCodeTrailNotProvidedException for service response error code - // "TrailNotProvidedException". - // - // This exception is no longer in use. - ErrCodeTrailNotProvidedException = "TrailNotProvidedException" - - // ErrCodeUnsupportedOperationException for service response error code - // "UnsupportedOperationException". - // - // This exception is thrown when the requested operation is not supported. - ErrCodeUnsupportedOperationException = "UnsupportedOperationException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "CloudTrailARNInvalidException": newErrorARNInvalidException, - "CloudTrailAccessNotEnabledException": newErrorAccessNotEnabledException, - "AccountHasOngoingImportException": newErrorAccountHasOngoingImportException, - "AccountNotFoundException": newErrorAccountNotFoundException, - "AccountNotRegisteredException": newErrorAccountNotRegisteredException, - "AccountRegisteredException": newErrorAccountRegisteredException, - "CannotDelegateManagementAccountException": newErrorCannotDelegateManagementAccountException, - "ChannelARNInvalidException": newErrorChannelARNInvalidException, - "ChannelAlreadyExistsException": newErrorChannelAlreadyExistsException, - "ChannelExistsForEDSException": newErrorChannelExistsForEDSException, - "ChannelMaxLimitExceededException": newErrorChannelMaxLimitExceededException, - "ChannelNotFoundException": newErrorChannelNotFoundException, - "CloudTrailInvalidClientTokenIdException": newErrorCloudTrailInvalidClientTokenIdException, - "CloudWatchLogsDeliveryUnavailableException": newErrorCloudWatchLogsDeliveryUnavailableException, - "ConflictException": newErrorConflictException, - "DelegatedAdminAccountLimitExceededException": newErrorDelegatedAdminAccountLimitExceededException, - "EventDataStoreARNInvalidException": newErrorEventDataStoreARNInvalidException, - "EventDataStoreAlreadyExistsException": newErrorEventDataStoreAlreadyExistsException, - "EventDataStoreHasOngoingImportException": newErrorEventDataStoreHasOngoingImportException, - "EventDataStoreMaxLimitExceededException": newErrorEventDataStoreMaxLimitExceededException, - "EventDataStoreNotFoundException": newErrorEventDataStoreNotFoundException, - "EventDataStoreTerminationProtectedException": newErrorEventDataStoreTerminationProtectedException, - "ImportNotFoundException": newErrorImportNotFoundException, - "InactiveEventDataStoreException": newErrorInactiveEventDataStoreException, - "InactiveQueryException": newErrorInactiveQueryException, - "InsightNotEnabledException": newErrorInsightNotEnabledException, - "InsufficientDependencyServiceAccessPermissionException": newErrorInsufficientDependencyServiceAccessPermissionException, - "InsufficientEncryptionPolicyException": newErrorInsufficientEncryptionPolicyException, - "InsufficientS3BucketPolicyException": newErrorInsufficientS3BucketPolicyException, - "InsufficientSnsTopicPolicyException": newErrorInsufficientSnsTopicPolicyException, - "InvalidCloudWatchLogsLogGroupArnException": newErrorInvalidCloudWatchLogsLogGroupArnException, - "InvalidCloudWatchLogsRoleArnException": newErrorInvalidCloudWatchLogsRoleArnException, - "InvalidDateRangeException": newErrorInvalidDateRangeException, - "InvalidEventCategoryException": newErrorInvalidEventCategoryException, - "InvalidEventDataStoreCategoryException": newErrorInvalidEventDataStoreCategoryException, - "InvalidEventDataStoreStatusException": newErrorInvalidEventDataStoreStatusException, - "InvalidEventSelectorsException": newErrorInvalidEventSelectorsException, - "InvalidHomeRegionException": newErrorInvalidHomeRegionException, - "InvalidImportSourceException": newErrorInvalidImportSourceException, - "InvalidInsightSelectorsException": newErrorInvalidInsightSelectorsException, - "InvalidKmsKeyIdException": newErrorInvalidKmsKeyIdException, - "InvalidLookupAttributesException": newErrorInvalidLookupAttributesException, - "InvalidMaxResultsException": newErrorInvalidMaxResultsException, - "InvalidNextTokenException": newErrorInvalidNextTokenException, - "InvalidParameterCombinationException": newErrorInvalidParameterCombinationException, - "InvalidParameterException": newErrorInvalidParameterException, - "InvalidQueryStatementException": newErrorInvalidQueryStatementException, - "InvalidQueryStatusException": newErrorInvalidQueryStatusException, - "InvalidS3BucketNameException": newErrorInvalidS3BucketNameException, - "InvalidS3PrefixException": newErrorInvalidS3PrefixException, - "InvalidSnsTopicNameException": newErrorInvalidSnsTopicNameException, - "InvalidSourceException": newErrorInvalidSourceException, - "InvalidTagParameterException": newErrorInvalidTagParameterException, - "InvalidTimeRangeException": newErrorInvalidTimeRangeException, - "InvalidTokenException": newErrorInvalidTokenException, - "InvalidTrailNameException": newErrorInvalidTrailNameException, - "KmsException": newErrorKmsException, - "KmsKeyDisabledException": newErrorKmsKeyDisabledException, - "KmsKeyNotFoundException": newErrorKmsKeyNotFoundException, - "MaxConcurrentQueriesException": newErrorMaxConcurrentQueriesException, - "MaximumNumberOfTrailsExceededException": newErrorMaximumNumberOfTrailsExceededException, - "NoManagementAccountSLRExistsException": newErrorNoManagementAccountSLRExistsException, - "NotOrganizationManagementAccountException": newErrorNotOrganizationManagementAccountException, - "NotOrganizationMasterAccountException": newErrorNotOrganizationMasterAccountException, - "OperationNotPermittedException": newErrorOperationNotPermittedException, - "OrganizationNotInAllFeaturesModeException": newErrorOrganizationNotInAllFeaturesModeException, - "OrganizationsNotInUseException": newErrorOrganizationsNotInUseException, - "QueryIdNotFoundException": newErrorQueryIdNotFoundException, - "ResourceARNNotValidException": newErrorResourceARNNotValidException, - "ResourceNotFoundException": newErrorResourceNotFoundException, - "ResourcePolicyNotFoundException": newErrorResourcePolicyNotFoundException, - "ResourcePolicyNotValidException": newErrorResourcePolicyNotValidException, - "ResourceTypeNotSupportedException": newErrorResourceTypeNotSupportedException, - "S3BucketDoesNotExistException": newErrorS3BucketDoesNotExistException, - "TagsLimitExceededException": newErrorTagsLimitExceededException, - "TrailAlreadyExistsException": newErrorTrailAlreadyExistsException, - "TrailNotFoundException": newErrorTrailNotFoundException, - "TrailNotProvidedException": newErrorTrailNotProvidedException, - "UnsupportedOperationException": newErrorUnsupportedOperationException, -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/service.go b/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/service.go deleted file mode 100644 index 106a75688a..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/cloudtrail/service.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package cloudtrail - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/signer/v4" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -// CloudTrail provides the API operation methods for making requests to -// AWS CloudTrail. See this package's package overview docs -// for details on the service. -// -// CloudTrail methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type CloudTrail struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "cloudtrail" // Name of service. - EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "CloudTrail" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the CloudTrail client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a CloudTrail client from just a session. -// svc := cloudtrail.New(mySession) -// -// // Create a CloudTrail client with additional configuration -// svc := cloudtrail.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *CloudTrail { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = EndpointsID - // No Fallback - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *CloudTrail { - svc := &CloudTrail{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2013-11-01", - ResolvedRegion: resolvedRegion, - JSONVersion: "1.1", - TargetPrefix: "com.amazonaws.cloudtrail.v20131101.CloudTrail_20131101", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a CloudTrail operation and runs any -// custom request initialization. -func (c *CloudTrail) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/organizations/api.go b/vendor/github.com/aws/aws-sdk-go/service/organizations/api.go deleted file mode 100644 index b09fd7c069..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/organizations/api.go +++ /dev/null @@ -1,27671 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package organizations - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -const opAcceptHandshake = "AcceptHandshake" - -// AcceptHandshakeRequest generates a "aws/request.Request" representing the -// client's request for the AcceptHandshake operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AcceptHandshake for more information on using the AcceptHandshake -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the AcceptHandshakeRequest method. -// req, resp := client.AcceptHandshakeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/AcceptHandshake -func (c *Organizations) AcceptHandshakeRequest(input *AcceptHandshakeInput) (req *request.Request, output *AcceptHandshakeOutput) { - op := &request.Operation{ - Name: opAcceptHandshake, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AcceptHandshakeInput{} - } - - output = &AcceptHandshakeOutput{} - req = c.newRequest(op, input, output) - return -} - -// AcceptHandshake API operation for AWS Organizations. -// -// Sends a response to the originator of a handshake agreeing to the action -// proposed by the handshake request. -// -// You can only call this operation by the following principals when they also -// have the relevant IAM permissions: -// -// - Invitation to join or Approve all features request handshakes: only -// a principal from the member account. The user who calls the API for an -// invitation to join must have the organizations:AcceptHandshake permission. -// If you enabled all features in the organization, the user must also have -// the iam:CreateServiceLinkedRole permission so that Organizations can create -// the required service-linked role named AWSServiceRoleForOrganizations. -// For more information, see Organizations and Service-Linked Roles (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integration_services.html#orgs_integration_service-linked-roles) -// in the Organizations User Guide. -// -// - Enable all features final confirmation handshake: only a principal from -// the management account. For more information about invitations, see Inviting -// an Amazon Web Services account to join your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_invites.html) -// in the Organizations User Guide. For more information about requests to -// enable all features in the organization, see Enabling all features in -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) -// in the Organizations User Guide. -// -// After you accept a handshake, it continues to appear in the results of relevant -// APIs for only 30 days. After that, it's deleted. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation AcceptHandshake for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - HandshakeConstraintViolationException -// The requested operation would violate the constraint identified in the reason -// code. -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation: -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. Note that deleted and closed -// accounts still count toward your limit. If you get this exception immediately -// after creating the organization, wait one hour and try again. If after -// an hour it continues to fail with this error, contact Amazon Web Services -// Support (https://docs.aws.amazon.com/support/home#/). -// -// - ALREADY_IN_AN_ORGANIZATION: The handshake request is invalid because -// the invited account is already a member of an organization. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVITE_DISABLED_DURING_ENABLE_ALL_FEATURES: You can't issue new invitations -// to join an organization while it's in the process of enabling all features. -// You can resume inviting accounts after you finalize the process when all -// accounts have agreed to the change. -// -// - ORGANIZATION_ALREADY_HAS_ALL_FEATURES: The handshake request is invalid -// because the organization has already enabled all features. -// -// - ORGANIZATION_IS_ALREADY_PENDING_ALL_FEATURES_MIGRATION: The handshake -// request is invalid because the organization has already started the process -// to enable all features. -// -// - ORGANIZATION_FROM_DIFFERENT_SELLER_OF_RECORD: The request failed because -// the account is from a different marketplace than the accounts in the organization. -// For example, accounts with India addresses must be associated with the -// AISPL marketplace. All accounts in an organization must be from the same -// marketplace. -// -// - ORGANIZATION_MEMBERSHIP_CHANGE_RATE_LIMIT_EXCEEDED: You attempted to -// change the membership of an account too quickly after its previous change. -// -// - PAYMENT_INSTRUMENT_REQUIRED: You can't complete the operation with an -// account that doesn't have a payment instrument, such as a credit card, -// associated with it. -// -// - HandshakeNotFoundException -// We can't find a handshake with the HandshakeId that you specified. -// -// - InvalidHandshakeTransitionException -// You can't perform the operation on the handshake in its current state. For -// example, you can't cancel a handshake that was already accepted or accept -// a handshake that was already declined. -// -// - HandshakeAlreadyInStateException -// The specified handshake is already in the requested state. For example, you -// can't accept a handshake that was already accepted. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - AccessDeniedForDependencyException -// The operation that you attempted requires you to have the iam:CreateServiceLinkedRole -// for organizations.amazonaws.com permission so that Organizations can create -// the required service-linked role. You don't have that permission. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/AcceptHandshake -func (c *Organizations) AcceptHandshake(input *AcceptHandshakeInput) (*AcceptHandshakeOutput, error) { - req, out := c.AcceptHandshakeRequest(input) - return out, req.Send() -} - -// AcceptHandshakeWithContext is the same as AcceptHandshake with the addition of -// the ability to pass a context and additional request options. -// -// See AcceptHandshake for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) AcceptHandshakeWithContext(ctx aws.Context, input *AcceptHandshakeInput, opts ...request.Option) (*AcceptHandshakeOutput, error) { - req, out := c.AcceptHandshakeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opAttachPolicy = "AttachPolicy" - -// AttachPolicyRequest generates a "aws/request.Request" representing the -// client's request for the AttachPolicy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AttachPolicy for more information on using the AttachPolicy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the AttachPolicyRequest method. -// req, resp := client.AttachPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/AttachPolicy -func (c *Organizations) AttachPolicyRequest(input *AttachPolicyInput) (req *request.Request, output *AttachPolicyOutput) { - op := &request.Operation{ - Name: opAttachPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AttachPolicyInput{} - } - - output = &AttachPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// AttachPolicy API operation for AWS Organizations. -// -// Attaches a policy to a root, an organizational unit (OU), or an individual -// account. How the policy affects accounts depends on the type of policy. Refer -// to the Organizations User Guide for information about each policy type: -// -// - AISERVICES_OPT_OUT_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html) -// -// - BACKUP_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html) -// -// - SERVICE_CONTROL_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html) -// -// - TAG_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) -// -// This operation can be called only from the organization's management account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation AttachPolicy for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - DuplicatePolicyAttachmentException -// The selected policy is already attached to the specified target. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - PolicyNotFoundException -// We can't find a policy with the PolicyId that you specified. -// -// - PolicyTypeNotEnabledException -// The specified policy type isn't currently enabled in this root. You can't -// attach policies of the specified type to entities in a root until you enable -// that type in the root. For more information, see Enabling All Features in -// Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) -// in the Organizations User Guide. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TargetNotFoundException -// We can't find a root, OU, account, or policy with the TargetId that you specified. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// - PolicyChangesInProgressException -// Changes to the effective policy are in progress, and its contents can't be -// returned. Try the operation again later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/AttachPolicy -func (c *Organizations) AttachPolicy(input *AttachPolicyInput) (*AttachPolicyOutput, error) { - req, out := c.AttachPolicyRequest(input) - return out, req.Send() -} - -// AttachPolicyWithContext is the same as AttachPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See AttachPolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) AttachPolicyWithContext(ctx aws.Context, input *AttachPolicyInput, opts ...request.Option) (*AttachPolicyOutput, error) { - req, out := c.AttachPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCancelHandshake = "CancelHandshake" - -// CancelHandshakeRequest generates a "aws/request.Request" representing the -// client's request for the CancelHandshake operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CancelHandshake for more information on using the CancelHandshake -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the CancelHandshakeRequest method. -// req, resp := client.CancelHandshakeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CancelHandshake -func (c *Organizations) CancelHandshakeRequest(input *CancelHandshakeInput) (req *request.Request, output *CancelHandshakeOutput) { - op := &request.Operation{ - Name: opCancelHandshake, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CancelHandshakeInput{} - } - - output = &CancelHandshakeOutput{} - req = c.newRequest(op, input, output) - return -} - -// CancelHandshake API operation for AWS Organizations. -// -// Cancels a handshake. Canceling a handshake sets the handshake state to CANCELED. -// -// This operation can be called only from the account that originated the handshake. -// The recipient of the handshake can't cancel it, but can use DeclineHandshake -// instead. After a handshake is canceled, the recipient can no longer respond -// to that handshake. -// -// After you cancel a handshake, it continues to appear in the results of relevant -// APIs for only 30 days. After that, it's deleted. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation CancelHandshake for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - HandshakeNotFoundException -// We can't find a handshake with the HandshakeId that you specified. -// -// - InvalidHandshakeTransitionException -// You can't perform the operation on the handshake in its current state. For -// example, you can't cancel a handshake that was already accepted or accept -// a handshake that was already declined. -// -// - HandshakeAlreadyInStateException -// The specified handshake is already in the requested state. For example, you -// can't accept a handshake that was already accepted. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CancelHandshake -func (c *Organizations) CancelHandshake(input *CancelHandshakeInput) (*CancelHandshakeOutput, error) { - req, out := c.CancelHandshakeRequest(input) - return out, req.Send() -} - -// CancelHandshakeWithContext is the same as CancelHandshake with the addition of -// the ability to pass a context and additional request options. -// -// See CancelHandshake for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) CancelHandshakeWithContext(ctx aws.Context, input *CancelHandshakeInput, opts ...request.Option) (*CancelHandshakeOutput, error) { - req, out := c.CancelHandshakeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCloseAccount = "CloseAccount" - -// CloseAccountRequest generates a "aws/request.Request" representing the -// client's request for the CloseAccount operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CloseAccount for more information on using the CloseAccount -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the CloseAccountRequest method. -// req, resp := client.CloseAccountRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CloseAccount -func (c *Organizations) CloseAccountRequest(input *CloseAccountInput) (req *request.Request, output *CloseAccountOutput) { - op := &request.Operation{ - Name: opCloseAccount, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CloseAccountInput{} - } - - output = &CloseAccountOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// CloseAccount API operation for AWS Organizations. -// -// Closes an Amazon Web Services member account within an organization. You -// can't close the management account with this API. This is an asynchronous -// request that Amazon Web Services performs in the background. Because CloseAccount -// operates asynchronously, it can return a successful completion message even -// though account closure might still be in progress. You need to wait a few -// minutes before the account is fully closed. To check the status of the request, -// do one of the following: -// -// - Use the AccountId that you sent in the CloseAccount request to provide -// as a parameter to the DescribeAccount operation. While the close account -// request is in progress, Account status will indicate PENDING_CLOSURE. -// When the close account request completes, the status will change to SUSPENDED. -// -// - Check the CloudTrail log for the CloseAccountResult event that gets -// published after the account closes successfully. For information on using -// CloudTrail with Organizations, see Logging and monitoring in Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_security_incident-response.html#orgs_cloudtrail-integration) -// in the Organizations User Guide. -// -// - You can only close 10% of active member accounts within a rolling 30 -// day period. This quota is not bound by a calendar month, but starts when -// you close an account. Within 30 days of that initial account closure, -// you can't exceed the 10% account closure limit. -// -// - To reinstate a closed account, contact Amazon Web Services Support within -// the 90-day grace period while the account is in SUSPENDED status. -// -// - If the Amazon Web Services account you attempt to close is linked to -// an Amazon Web Services GovCloud (US) account, the CloseAccount request -// will close both accounts. To learn important pre-closure details, see -// Closing an Amazon Web Services GovCloud (US) account (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/Closing-govcloud-account.html) -// in the Amazon Web Services GovCloud User Guide. -// -// For more information about closing accounts, see Closing an Amazon Web Services -// account (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_close.html) -// in the Organizations User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation CloseAccount for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AccountAlreadyClosedException -// You attempted to close an account that is already closed. -// -// - AccountNotFoundException -// We can't find an Amazon Web Services account with the AccountId that you -// specified, or the account whose credentials you used to make this request -// isn't a member of an organization. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ConflictException -// The request failed because it conflicts with the current state of the specified -// resource. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CloseAccount -func (c *Organizations) CloseAccount(input *CloseAccountInput) (*CloseAccountOutput, error) { - req, out := c.CloseAccountRequest(input) - return out, req.Send() -} - -// CloseAccountWithContext is the same as CloseAccount with the addition of -// the ability to pass a context and additional request options. -// -// See CloseAccount for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) CloseAccountWithContext(ctx aws.Context, input *CloseAccountInput, opts ...request.Option) (*CloseAccountOutput, error) { - req, out := c.CloseAccountRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateAccount = "CreateAccount" - -// CreateAccountRequest generates a "aws/request.Request" representing the -// client's request for the CreateAccount operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateAccount for more information on using the CreateAccount -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the CreateAccountRequest method. -// req, resp := client.CreateAccountRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreateAccount -func (c *Organizations) CreateAccountRequest(input *CreateAccountInput) (req *request.Request, output *CreateAccountOutput) { - op := &request.Operation{ - Name: opCreateAccount, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateAccountInput{} - } - - output = &CreateAccountOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateAccount API operation for AWS Organizations. -// -// Creates an Amazon Web Services account that is automatically a member of -// the organization whose credentials made the request. This is an asynchronous -// request that Amazon Web Services performs in the background. Because CreateAccount -// operates asynchronously, it can return a successful completion message even -// though account initialization might still be in progress. You might need -// to wait a few minutes before you can successfully access the account. To -// check the status of the request, do one of the following: -// -// - Use the Id value of the CreateAccountStatus response element from this -// operation to provide as a parameter to the DescribeCreateAccountStatus -// operation. -// -// - Check the CloudTrail log for the CreateAccountResult event. For information -// on using CloudTrail with Organizations, see Logging and monitoring in -// Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_security_incident-response.html#orgs_cloudtrail-integration) -// in the Organizations User Guide. -// -// The user who calls the API to create an account must have the organizations:CreateAccount -// permission. If you enabled all features in the organization, Organizations -// creates the required service-linked role named AWSServiceRoleForOrganizations. -// For more information, see Organizations and Service-Linked Roles (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_integrate_services-using_slrs) -// in the Organizations User Guide. -// -// If the request includes tags, then the requester must have the organizations:TagResource -// permission. -// -// Organizations preconfigures the new member account with a role (named OrganizationAccountAccessRole -// by default) that grants users in the management account administrator permissions -// in the new member account. Principals in the management account can assume -// the role. Organizations clones the company name and address information for -// the new account from the organization's management account. -// -// This operation can be called only from the organization's management account. -// -// For more information about creating accounts, see Creating an Amazon Web -// Services account in Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_create.html) -// in the Organizations User Guide. -// -// - When you create an account in an organization using the Organizations -// console, API, or CLI commands, the information required for the account -// to operate as a standalone account, such as a payment method and signing -// the end user license agreement (EULA) is not automatically collected. -// If you must remove an account from your organization later, you can do -// so only after you provide the missing information. Follow the steps at -// To leave an organization as a member account (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - If you get an exception that indicates that you exceeded your account -// limits for the organization, contact Amazon Web Services Support (https://console.aws.amazon.com/support/home#/). -// -// - If you get an exception that indicates that the operation failed because -// your organization is still initializing, wait one hour and then try again. -// If the error persists, contact Amazon Web Services Support (https://console.aws.amazon.com/support/home#/). -// -// - Using CreateAccount to create multiple temporary accounts isn't recommended. -// You can only close an account from the Billing and Cost Management console, -// and you must be signed in as the root user. For information on the requirements -// and process for closing an account, see Closing an Amazon Web Services -// account (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_close.html) -// in the Organizations User Guide. -// -// When you create a member account with this operation, you can choose whether -// to create the account with the IAM User and Role Access to Billing Information -// switch enabled. If you enable it, IAM users and roles that have appropriate -// permissions can view billing information for the account. If you disable -// it, only the account root user can access billing information. For information -// about how to disable this switch for an account, see Granting Access to Your -// Billing Information and Tools (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation CreateAccount for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - FinalizingOrganizationException -// Organizations couldn't perform the operation because your organization hasn't -// finished initializing. This can take up to an hour. Try again later. If after -// one hour you continue to receive this error, contact Amazon Web Services -// Support (https://console.aws.amazon.com/support/home#/). -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreateAccount -func (c *Organizations) CreateAccount(input *CreateAccountInput) (*CreateAccountOutput, error) { - req, out := c.CreateAccountRequest(input) - return out, req.Send() -} - -// CreateAccountWithContext is the same as CreateAccount with the addition of -// the ability to pass a context and additional request options. -// -// See CreateAccount for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) CreateAccountWithContext(ctx aws.Context, input *CreateAccountInput, opts ...request.Option) (*CreateAccountOutput, error) { - req, out := c.CreateAccountRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateGovCloudAccount = "CreateGovCloudAccount" - -// CreateGovCloudAccountRequest generates a "aws/request.Request" representing the -// client's request for the CreateGovCloudAccount operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateGovCloudAccount for more information on using the CreateGovCloudAccount -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the CreateGovCloudAccountRequest method. -// req, resp := client.CreateGovCloudAccountRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreateGovCloudAccount -func (c *Organizations) CreateGovCloudAccountRequest(input *CreateGovCloudAccountInput) (req *request.Request, output *CreateGovCloudAccountOutput) { - op := &request.Operation{ - Name: opCreateGovCloudAccount, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateGovCloudAccountInput{} - } - - output = &CreateGovCloudAccountOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateGovCloudAccount API operation for AWS Organizations. -// -// This action is available if all of the following are true: -// -// - You're authorized to create accounts in the Amazon Web Services GovCloud -// (US) Region. For more information on the Amazon Web Services GovCloud -// (US) Region, see the Amazon Web Services GovCloud User Guide. (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/welcome.html) -// -// - You already have an account in the Amazon Web Services GovCloud (US) -// Region that is paired with a management account of an organization in -// the commercial Region. -// -// - You call this action from the management account of your organization -// in the commercial Region. -// -// - You have the organizations:CreateGovCloudAccount permission. -// -// Organizations automatically creates the required service-linked role named -// AWSServiceRoleForOrganizations. For more information, see Organizations and -// Service-Linked Roles (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html#orgs_integrate_services-using_slrs) -// in the Organizations User Guide. -// -// Amazon Web Services automatically enables CloudTrail for Amazon Web Services -// GovCloud (US) accounts, but you should also do the following: -// -// - Verify that CloudTrail is enabled to store logs. -// -// - Create an Amazon S3 bucket for CloudTrail log storage. For more information, -// see Verifying CloudTrail Is Enabled (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/verifying-cloudtrail.html) -// in the Amazon Web Services GovCloud User Guide. -// -// If the request includes tags, then the requester must have the organizations:TagResource -// permission. The tags are attached to the commercial account associated with -// the GovCloud account, rather than the GovCloud account itself. To add tags -// to the GovCloud account, call the TagResource operation in the GovCloud Region -// after the new GovCloud account exists. -// -// You call this action from the management account of your organization in -// the commercial Region to create a standalone Amazon Web Services account -// in the Amazon Web Services GovCloud (US) Region. After the account is created, -// the management account of an organization in the Amazon Web Services GovCloud -// (US) Region can invite it to that organization. For more information on inviting -// standalone accounts in the Amazon Web Services GovCloud (US) to join an organization, -// see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// Calling CreateGovCloudAccount is an asynchronous request that Amazon Web -// Services performs in the background. Because CreateGovCloudAccount operates -// asynchronously, it can return a successful completion message even though -// account initialization might still be in progress. You might need to wait -// a few minutes before you can successfully access the account. To check the -// status of the request, do one of the following: -// -// - Use the OperationId response element from this operation to provide -// as a parameter to the DescribeCreateAccountStatus operation. -// -// - Check the CloudTrail log for the CreateAccountResult event. For information -// on using CloudTrail with Organizations, see Monitoring the Activity in -// Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_monitoring.html) -// in the Organizations User Guide. -// -// When you call the CreateGovCloudAccount action, you create two accounts: -// a standalone account in the Amazon Web Services GovCloud (US) Region and -// an associated account in the commercial Region for billing and support purposes. -// The account in the commercial Region is automatically a member of the organization -// whose credentials made the request. Both accounts are associated with the -// same email address. -// -// A role is created in the new account in the commercial Region that allows -// the management account in the organization in the commercial Region to assume -// it. An Amazon Web Services GovCloud (US) account is then created and associated -// with the commercial account that you just created. A role is also created -// in the new Amazon Web Services GovCloud (US) account that can be assumed -// by the Amazon Web Services GovCloud (US) account that is associated with -// the management account of the commercial organization. For more information -// and to view a diagram that explains how account access works, see Organizations -// (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// For more information about creating accounts, see Creating an Amazon Web -// Services account in Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_create.html) -// in the Organizations User Guide. -// -// - When you create an account in an organization using the Organizations -// console, API, or CLI commands, the information required for the account -// to operate as a standalone account is not automatically collected. This -// includes a payment method and signing the end user license agreement (EULA). -// If you must remove an account from your organization later, you can do -// so only after you provide the missing information. Follow the steps at -// To leave an organization as a member account (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - If you get an exception that indicates that you exceeded your account -// limits for the organization, contact Amazon Web Services Support (https://console.aws.amazon.com/support/home#/). -// -// - If you get an exception that indicates that the operation failed because -// your organization is still initializing, wait one hour and then try again. -// If the error persists, contact Amazon Web Services Support (https://console.aws.amazon.com/support/home#/). -// -// - Using CreateGovCloudAccount to create multiple temporary accounts isn't -// recommended. You can only close an account from the Amazon Web Services -// Billing and Cost Management console, and you must be signed in as the -// root user. For information on the requirements and process for closing -// an account, see Closing an Amazon Web Services account (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_close.html) -// in the Organizations User Guide. -// -// When you create a member account with this operation, you can choose whether -// to create the account with the IAM User and Role Access to Billing Information -// switch enabled. If you enable it, IAM users and roles that have appropriate -// permissions can view billing information for the account. If you disable -// it, only the account root user can access billing information. For information -// about how to disable this switch for an account, see Granting Access to Your -// Billing Information and Tools (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation CreateGovCloudAccount for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - FinalizingOrganizationException -// Organizations couldn't perform the operation because your organization hasn't -// finished initializing. This can take up to an hour. Try again later. If after -// one hour you continue to receive this error, contact Amazon Web Services -// Support (https://console.aws.amazon.com/support/home#/). -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreateGovCloudAccount -func (c *Organizations) CreateGovCloudAccount(input *CreateGovCloudAccountInput) (*CreateGovCloudAccountOutput, error) { - req, out := c.CreateGovCloudAccountRequest(input) - return out, req.Send() -} - -// CreateGovCloudAccountWithContext is the same as CreateGovCloudAccount with the addition of -// the ability to pass a context and additional request options. -// -// See CreateGovCloudAccount for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) CreateGovCloudAccountWithContext(ctx aws.Context, input *CreateGovCloudAccountInput, opts ...request.Option) (*CreateGovCloudAccountOutput, error) { - req, out := c.CreateGovCloudAccountRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateOrganization = "CreateOrganization" - -// CreateOrganizationRequest generates a "aws/request.Request" representing the -// client's request for the CreateOrganization operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateOrganization for more information on using the CreateOrganization -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the CreateOrganizationRequest method. -// req, resp := client.CreateOrganizationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreateOrganization -func (c *Organizations) CreateOrganizationRequest(input *CreateOrganizationInput) (req *request.Request, output *CreateOrganizationOutput) { - op := &request.Operation{ - Name: opCreateOrganization, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateOrganizationInput{} - } - - output = &CreateOrganizationOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateOrganization API operation for AWS Organizations. -// -// Creates an Amazon Web Services organization. The account whose user is calling -// the CreateOrganization operation automatically becomes the management account -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#account) -// of the new organization. -// -// This operation must be called using credentials from the account that is -// to become the new organization's management account. The principal must also -// have the relevant IAM permissions. -// -// By default (or if you set the FeatureSet parameter to ALL), the new organization -// is created with all features enabled and service control policies automatically -// enabled in the root. If you instead choose to create the organization supporting -// only the consolidated billing features by setting the FeatureSet parameter -// to CONSOLIDATED_BILLING", no policy types are enabled by default, and you -// can't use organization policies -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation CreateOrganization for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AlreadyInOrganizationException -// This account is already a member of an organization. An account can belong -// to only one organization at a time. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - AccessDeniedForDependencyException -// The operation that you attempted requires you to have the iam:CreateServiceLinkedRole -// for organizations.amazonaws.com permission so that Organizations can create -// the required service-linked role. You don't have that permission. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreateOrganization -func (c *Organizations) CreateOrganization(input *CreateOrganizationInput) (*CreateOrganizationOutput, error) { - req, out := c.CreateOrganizationRequest(input) - return out, req.Send() -} - -// CreateOrganizationWithContext is the same as CreateOrganization with the addition of -// the ability to pass a context and additional request options. -// -// See CreateOrganization for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) CreateOrganizationWithContext(ctx aws.Context, input *CreateOrganizationInput, opts ...request.Option) (*CreateOrganizationOutput, error) { - req, out := c.CreateOrganizationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateOrganizationalUnit = "CreateOrganizationalUnit" - -// CreateOrganizationalUnitRequest generates a "aws/request.Request" representing the -// client's request for the CreateOrganizationalUnit operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateOrganizationalUnit for more information on using the CreateOrganizationalUnit -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the CreateOrganizationalUnitRequest method. -// req, resp := client.CreateOrganizationalUnitRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreateOrganizationalUnit -func (c *Organizations) CreateOrganizationalUnitRequest(input *CreateOrganizationalUnitInput) (req *request.Request, output *CreateOrganizationalUnitOutput) { - op := &request.Operation{ - Name: opCreateOrganizationalUnit, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateOrganizationalUnitInput{} - } - - output = &CreateOrganizationalUnitOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateOrganizationalUnit API operation for AWS Organizations. -// -// Creates an organizational unit (OU) within a root or parent OU. An OU is -// a container for accounts that enables you to organize your accounts to apply -// policies according to your business requirements. The number of levels deep -// that you can nest OUs is dependent upon the policy types enabled for that -// root. For service control policies, the limit is five. -// -// For more information about OUs, see Managing Organizational Units (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_ous.html) -// in the Organizations User Guide. -// -// If the request includes tags, then the requester must have the organizations:TagResource -// permission. -// -// This operation can be called only from the organization's management account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation CreateOrganizationalUnit for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - DuplicateOrganizationalUnitException -// An OU with the same name already exists. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ParentNotFoundException -// We can't find a root or OU with the ParentId that you specified. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreateOrganizationalUnit -func (c *Organizations) CreateOrganizationalUnit(input *CreateOrganizationalUnitInput) (*CreateOrganizationalUnitOutput, error) { - req, out := c.CreateOrganizationalUnitRequest(input) - return out, req.Send() -} - -// CreateOrganizationalUnitWithContext is the same as CreateOrganizationalUnit with the addition of -// the ability to pass a context and additional request options. -// -// See CreateOrganizationalUnit for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) CreateOrganizationalUnitWithContext(ctx aws.Context, input *CreateOrganizationalUnitInput, opts ...request.Option) (*CreateOrganizationalUnitOutput, error) { - req, out := c.CreateOrganizationalUnitRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreatePolicy = "CreatePolicy" - -// CreatePolicyRequest generates a "aws/request.Request" representing the -// client's request for the CreatePolicy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreatePolicy for more information on using the CreatePolicy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the CreatePolicyRequest method. -// req, resp := client.CreatePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreatePolicy -func (c *Organizations) CreatePolicyRequest(input *CreatePolicyInput) (req *request.Request, output *CreatePolicyOutput) { - op := &request.Operation{ - Name: opCreatePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreatePolicyInput{} - } - - output = &CreatePolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreatePolicy API operation for AWS Organizations. -// -// Creates a policy of a specified type that you can attach to a root, an organizational -// unit (OU), or an individual Amazon Web Services account. -// -// For more information about policies and their use, see Managing Organization -// Policies (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html). -// -// If the request includes tags, then the requester must have the organizations:TagResource -// permission. -// -// This operation can be called only from the organization's management account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation CreatePolicy for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - DuplicatePolicyException -// A policy with the same name already exists. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - MalformedPolicyDocumentException -// The provided policy document doesn't meet the requirements of the specified -// policy type. For example, the syntax might be incorrect. For details about -// service control policy syntax, see Service Control Policy Syntax (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_scp-syntax.html) -// in the Organizations User Guide. -// -// - PolicyTypeNotAvailableForOrganizationException -// You can't use the specified policy type with the feature set currently enabled -// for this organization. For example, you can enable SCPs only after you enable -// all features in the organization. For more information, see Managing Organizations -// Policies (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html#enable_policies_on_root)in -// the Organizations User Guide. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/CreatePolicy -func (c *Organizations) CreatePolicy(input *CreatePolicyInput) (*CreatePolicyOutput, error) { - req, out := c.CreatePolicyRequest(input) - return out, req.Send() -} - -// CreatePolicyWithContext is the same as CreatePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See CreatePolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) CreatePolicyWithContext(ctx aws.Context, input *CreatePolicyInput, opts ...request.Option) (*CreatePolicyOutput, error) { - req, out := c.CreatePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeclineHandshake = "DeclineHandshake" - -// DeclineHandshakeRequest generates a "aws/request.Request" representing the -// client's request for the DeclineHandshake operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeclineHandshake for more information on using the DeclineHandshake -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeclineHandshakeRequest method. -// req, resp := client.DeclineHandshakeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DeclineHandshake -func (c *Organizations) DeclineHandshakeRequest(input *DeclineHandshakeInput) (req *request.Request, output *DeclineHandshakeOutput) { - op := &request.Operation{ - Name: opDeclineHandshake, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeclineHandshakeInput{} - } - - output = &DeclineHandshakeOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeclineHandshake API operation for AWS Organizations. -// -// Declines a handshake request. This sets the handshake state to DECLINED and -// effectively deactivates the request. -// -// This operation can be called only from the account that received the handshake. -// The originator of the handshake can use CancelHandshake instead. The originator -// can't reactivate a declined request, but can reinitiate the process with -// a new handshake request. -// -// After you decline a handshake, it continues to appear in the results of relevant -// APIs for only 30 days. After that, it's deleted. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation DeclineHandshake for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - HandshakeNotFoundException -// We can't find a handshake with the HandshakeId that you specified. -// -// - InvalidHandshakeTransitionException -// You can't perform the operation on the handshake in its current state. For -// example, you can't cancel a handshake that was already accepted or accept -// a handshake that was already declined. -// -// - HandshakeAlreadyInStateException -// The specified handshake is already in the requested state. For example, you -// can't accept a handshake that was already accepted. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DeclineHandshake -func (c *Organizations) DeclineHandshake(input *DeclineHandshakeInput) (*DeclineHandshakeOutput, error) { - req, out := c.DeclineHandshakeRequest(input) - return out, req.Send() -} - -// DeclineHandshakeWithContext is the same as DeclineHandshake with the addition of -// the ability to pass a context and additional request options. -// -// See DeclineHandshake for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) DeclineHandshakeWithContext(ctx aws.Context, input *DeclineHandshakeInput, opts ...request.Option) (*DeclineHandshakeOutput, error) { - req, out := c.DeclineHandshakeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteOrganization = "DeleteOrganization" - -// DeleteOrganizationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteOrganization operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteOrganization for more information on using the DeleteOrganization -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteOrganizationRequest method. -// req, resp := client.DeleteOrganizationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DeleteOrganization -func (c *Organizations) DeleteOrganizationRequest(input *DeleteOrganizationInput) (req *request.Request, output *DeleteOrganizationOutput) { - op := &request.Operation{ - Name: opDeleteOrganization, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteOrganizationInput{} - } - - output = &DeleteOrganizationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteOrganization API operation for AWS Organizations. -// -// Deletes the organization. You can delete an organization only by using credentials -// from the management account. The organization must be empty of member accounts. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation DeleteOrganization for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - OrganizationNotEmptyException -// The organization isn't empty. To delete an organization, you must first remove -// all accounts except the management account, delete all OUs, and delete all -// policies. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DeleteOrganization -func (c *Organizations) DeleteOrganization(input *DeleteOrganizationInput) (*DeleteOrganizationOutput, error) { - req, out := c.DeleteOrganizationRequest(input) - return out, req.Send() -} - -// DeleteOrganizationWithContext is the same as DeleteOrganization with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteOrganization for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) DeleteOrganizationWithContext(ctx aws.Context, input *DeleteOrganizationInput, opts ...request.Option) (*DeleteOrganizationOutput, error) { - req, out := c.DeleteOrganizationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteOrganizationalUnit = "DeleteOrganizationalUnit" - -// DeleteOrganizationalUnitRequest generates a "aws/request.Request" representing the -// client's request for the DeleteOrganizationalUnit operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteOrganizationalUnit for more information on using the DeleteOrganizationalUnit -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteOrganizationalUnitRequest method. -// req, resp := client.DeleteOrganizationalUnitRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DeleteOrganizationalUnit -func (c *Organizations) DeleteOrganizationalUnitRequest(input *DeleteOrganizationalUnitInput) (req *request.Request, output *DeleteOrganizationalUnitOutput) { - op := &request.Operation{ - Name: opDeleteOrganizationalUnit, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteOrganizationalUnitInput{} - } - - output = &DeleteOrganizationalUnitOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteOrganizationalUnit API operation for AWS Organizations. -// -// Deletes an organizational unit (OU) from a root or another OU. You must first -// remove all accounts and child OUs from the OU that you want to delete. -// -// This operation can be called only from the organization's management account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation DeleteOrganizationalUnit for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - OrganizationalUnitNotEmptyException -// The specified OU is not empty. Move all accounts to another root or to other -// OUs, remove all child OUs, and try the operation again. -// -// - OrganizationalUnitNotFoundException -// We can't find an OU with the OrganizationalUnitId that you specified. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DeleteOrganizationalUnit -func (c *Organizations) DeleteOrganizationalUnit(input *DeleteOrganizationalUnitInput) (*DeleteOrganizationalUnitOutput, error) { - req, out := c.DeleteOrganizationalUnitRequest(input) - return out, req.Send() -} - -// DeleteOrganizationalUnitWithContext is the same as DeleteOrganizationalUnit with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteOrganizationalUnit for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) DeleteOrganizationalUnitWithContext(ctx aws.Context, input *DeleteOrganizationalUnitInput, opts ...request.Option) (*DeleteOrganizationalUnitOutput, error) { - req, out := c.DeleteOrganizationalUnitRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeletePolicy = "DeletePolicy" - -// DeletePolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeletePolicy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeletePolicy for more information on using the DeletePolicy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeletePolicyRequest method. -// req, resp := client.DeletePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DeletePolicy -func (c *Organizations) DeletePolicyRequest(input *DeletePolicyInput) (req *request.Request, output *DeletePolicyOutput) { - op := &request.Operation{ - Name: opDeletePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeletePolicyInput{} - } - - output = &DeletePolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeletePolicy API operation for AWS Organizations. -// -// Deletes the specified policy from your organization. Before you perform this -// operation, you must first detach the policy from all organizational units -// (OUs), roots, and accounts. -// -// This operation can be called only from the organization's management account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation DeletePolicy for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - PolicyInUseException -// The policy is attached to one or more entities. You must detach it from all -// roots, OUs, and accounts before performing this operation. -// -// - PolicyNotFoundException -// We can't find a policy with the PolicyId that you specified. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DeletePolicy -func (c *Organizations) DeletePolicy(input *DeletePolicyInput) (*DeletePolicyOutput, error) { - req, out := c.DeletePolicyRequest(input) - return out, req.Send() -} - -// DeletePolicyWithContext is the same as DeletePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DeletePolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) DeletePolicyWithContext(ctx aws.Context, input *DeletePolicyInput, opts ...request.Option) (*DeletePolicyOutput, error) { - req, out := c.DeletePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteResourcePolicy = "DeleteResourcePolicy" - -// DeleteResourcePolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteResourcePolicy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteResourcePolicy for more information on using the DeleteResourcePolicy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteResourcePolicyRequest method. -// req, resp := client.DeleteResourcePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DeleteResourcePolicy -func (c *Organizations) DeleteResourcePolicyRequest(input *DeleteResourcePolicyInput) (req *request.Request, output *DeleteResourcePolicyOutput) { - op := &request.Operation{ - Name: opDeleteResourcePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteResourcePolicyInput{} - } - - output = &DeleteResourcePolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteResourcePolicy API operation for AWS Organizations. -// -// Deletes the resource policy from your organization. -// -// You can only call this operation from the organization's management account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation DeleteResourcePolicy for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ResourcePolicyNotFoundException -// We can't find a resource policy request with the parameter that you specified. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DeleteResourcePolicy -func (c *Organizations) DeleteResourcePolicy(input *DeleteResourcePolicyInput) (*DeleteResourcePolicyOutput, error) { - req, out := c.DeleteResourcePolicyRequest(input) - return out, req.Send() -} - -// DeleteResourcePolicyWithContext is the same as DeleteResourcePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteResourcePolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) DeleteResourcePolicyWithContext(ctx aws.Context, input *DeleteResourcePolicyInput, opts ...request.Option) (*DeleteResourcePolicyOutput, error) { - req, out := c.DeleteResourcePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeregisterDelegatedAdministrator = "DeregisterDelegatedAdministrator" - -// DeregisterDelegatedAdministratorRequest generates a "aws/request.Request" representing the -// client's request for the DeregisterDelegatedAdministrator operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeregisterDelegatedAdministrator for more information on using the DeregisterDelegatedAdministrator -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeregisterDelegatedAdministratorRequest method. -// req, resp := client.DeregisterDelegatedAdministratorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DeregisterDelegatedAdministrator -func (c *Organizations) DeregisterDelegatedAdministratorRequest(input *DeregisterDelegatedAdministratorInput) (req *request.Request, output *DeregisterDelegatedAdministratorOutput) { - op := &request.Operation{ - Name: opDeregisterDelegatedAdministrator, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeregisterDelegatedAdministratorInput{} - } - - output = &DeregisterDelegatedAdministratorOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeregisterDelegatedAdministrator API operation for AWS Organizations. -// -// Removes the specified member Amazon Web Services account as a delegated administrator -// for the specified Amazon Web Services service. -// -// Deregistering a delegated administrator can have unintended impacts on the -// functionality of the enabled Amazon Web Services service. See the documentation -// for the enabled service before you deregister a delegated administrator so -// that you understand any potential impacts. -// -// You can run this action only for Amazon Web Services services that support -// this feature. For a current list of services that support it, see the column -// Supports Delegated Administrator in the table at Amazon Web Services Services -// that you can use with Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services_list.html) -// in the Organizations User Guide. -// -// This operation can be called only from the organization's management account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation DeregisterDelegatedAdministrator for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AccountNotFoundException -// We can't find an Amazon Web Services account with the AccountId that you -// specified, or the account whose credentials you used to make this request -// isn't a member of an organization. -// -// - AccountNotRegisteredException -// The specified account is not a delegated administrator for this Amazon Web -// Services service. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DeregisterDelegatedAdministrator -func (c *Organizations) DeregisterDelegatedAdministrator(input *DeregisterDelegatedAdministratorInput) (*DeregisterDelegatedAdministratorOutput, error) { - req, out := c.DeregisterDelegatedAdministratorRequest(input) - return out, req.Send() -} - -// DeregisterDelegatedAdministratorWithContext is the same as DeregisterDelegatedAdministrator with the addition of -// the ability to pass a context and additional request options. -// -// See DeregisterDelegatedAdministrator for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) DeregisterDelegatedAdministratorWithContext(ctx aws.Context, input *DeregisterDelegatedAdministratorInput, opts ...request.Option) (*DeregisterDelegatedAdministratorOutput, error) { - req, out := c.DeregisterDelegatedAdministratorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeAccount = "DescribeAccount" - -// DescribeAccountRequest generates a "aws/request.Request" representing the -// client's request for the DescribeAccount operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeAccount for more information on using the DescribeAccount -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DescribeAccountRequest method. -// req, resp := client.DescribeAccountRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeAccount -func (c *Organizations) DescribeAccountRequest(input *DescribeAccountInput) (req *request.Request, output *DescribeAccountOutput) { - op := &request.Operation{ - Name: opDescribeAccount, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeAccountInput{} - } - - output = &DescribeAccountOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeAccount API operation for AWS Organizations. -// -// Retrieves Organizations-related information about the specified account. -// -// This operation can be called only from the organization's management account -// or by a member account that is a delegated administrator for an Amazon Web -// Services service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation DescribeAccount for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AccountNotFoundException -// We can't find an Amazon Web Services account with the AccountId that you -// specified, or the account whose credentials you used to make this request -// isn't a member of an organization. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeAccount -func (c *Organizations) DescribeAccount(input *DescribeAccountInput) (*DescribeAccountOutput, error) { - req, out := c.DescribeAccountRequest(input) - return out, req.Send() -} - -// DescribeAccountWithContext is the same as DescribeAccount with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeAccount for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) DescribeAccountWithContext(ctx aws.Context, input *DescribeAccountInput, opts ...request.Option) (*DescribeAccountOutput, error) { - req, out := c.DescribeAccountRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeCreateAccountStatus = "DescribeCreateAccountStatus" - -// DescribeCreateAccountStatusRequest generates a "aws/request.Request" representing the -// client's request for the DescribeCreateAccountStatus operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeCreateAccountStatus for more information on using the DescribeCreateAccountStatus -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DescribeCreateAccountStatusRequest method. -// req, resp := client.DescribeCreateAccountStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeCreateAccountStatus -func (c *Organizations) DescribeCreateAccountStatusRequest(input *DescribeCreateAccountStatusInput) (req *request.Request, output *DescribeCreateAccountStatusOutput) { - op := &request.Operation{ - Name: opDescribeCreateAccountStatus, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeCreateAccountStatusInput{} - } - - output = &DescribeCreateAccountStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeCreateAccountStatus API operation for AWS Organizations. -// -// Retrieves the current status of an asynchronous request to create an account. -// -// This operation can be called only from the organization's management account -// or by a member account that is a delegated administrator for an Amazon Web -// Services service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation DescribeCreateAccountStatus for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - CreateAccountStatusNotFoundException -// We can't find an create account request with the CreateAccountRequestId that -// you specified. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeCreateAccountStatus -func (c *Organizations) DescribeCreateAccountStatus(input *DescribeCreateAccountStatusInput) (*DescribeCreateAccountStatusOutput, error) { - req, out := c.DescribeCreateAccountStatusRequest(input) - return out, req.Send() -} - -// DescribeCreateAccountStatusWithContext is the same as DescribeCreateAccountStatus with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeCreateAccountStatus for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) DescribeCreateAccountStatusWithContext(ctx aws.Context, input *DescribeCreateAccountStatusInput, opts ...request.Option) (*DescribeCreateAccountStatusOutput, error) { - req, out := c.DescribeCreateAccountStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeEffectivePolicy = "DescribeEffectivePolicy" - -// DescribeEffectivePolicyRequest generates a "aws/request.Request" representing the -// client's request for the DescribeEffectivePolicy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeEffectivePolicy for more information on using the DescribeEffectivePolicy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DescribeEffectivePolicyRequest method. -// req, resp := client.DescribeEffectivePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeEffectivePolicy -func (c *Organizations) DescribeEffectivePolicyRequest(input *DescribeEffectivePolicyInput) (req *request.Request, output *DescribeEffectivePolicyOutput) { - op := &request.Operation{ - Name: opDescribeEffectivePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeEffectivePolicyInput{} - } - - output = &DescribeEffectivePolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeEffectivePolicy API operation for AWS Organizations. -// -// Returns the contents of the effective policy for specified policy type and -// account. The effective policy is the aggregation of any policies of the specified -// type that the account inherits, plus any policy of that type that is directly -// attached to the account. -// -// This operation applies only to policy types other than service control policies -// (SCPs). -// -// For more information about policy inheritance, see How Policy Inheritance -// Works (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies-inheritance.html) -// in the Organizations User Guide. -// -// This operation can be called only from the organization's management account -// or by a member account that is a delegated administrator for an Amazon Web -// Services service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation DescribeEffectivePolicy for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - TargetNotFoundException -// We can't find a root, OU, account, or policy with the TargetId that you specified. -// -// - EffectivePolicyNotFoundException -// If you ran this action on the management account, this policy type is not -// enabled. If you ran the action on a member account, the account doesn't have -// an effective policy of this type. Contact the administrator of your organization -// about attaching a policy of this type to the account. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeEffectivePolicy -func (c *Organizations) DescribeEffectivePolicy(input *DescribeEffectivePolicyInput) (*DescribeEffectivePolicyOutput, error) { - req, out := c.DescribeEffectivePolicyRequest(input) - return out, req.Send() -} - -// DescribeEffectivePolicyWithContext is the same as DescribeEffectivePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeEffectivePolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) DescribeEffectivePolicyWithContext(ctx aws.Context, input *DescribeEffectivePolicyInput, opts ...request.Option) (*DescribeEffectivePolicyOutput, error) { - req, out := c.DescribeEffectivePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeHandshake = "DescribeHandshake" - -// DescribeHandshakeRequest generates a "aws/request.Request" representing the -// client's request for the DescribeHandshake operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeHandshake for more information on using the DescribeHandshake -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DescribeHandshakeRequest method. -// req, resp := client.DescribeHandshakeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeHandshake -func (c *Organizations) DescribeHandshakeRequest(input *DescribeHandshakeInput) (req *request.Request, output *DescribeHandshakeOutput) { - op := &request.Operation{ - Name: opDescribeHandshake, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeHandshakeInput{} - } - - output = &DescribeHandshakeOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeHandshake API operation for AWS Organizations. -// -// Retrieves information about a previously requested handshake. The handshake -// ID comes from the response to the original InviteAccountToOrganization operation -// that generated the handshake. -// -// You can access handshakes that are ACCEPTED, DECLINED, or CANCELED for only -// 30 days after they change to that state. They're then deleted and no longer -// accessible. -// -// This operation can be called from any account in the organization. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation DescribeHandshake for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - HandshakeNotFoundException -// We can't find a handshake with the HandshakeId that you specified. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeHandshake -func (c *Organizations) DescribeHandshake(input *DescribeHandshakeInput) (*DescribeHandshakeOutput, error) { - req, out := c.DescribeHandshakeRequest(input) - return out, req.Send() -} - -// DescribeHandshakeWithContext is the same as DescribeHandshake with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeHandshake for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) DescribeHandshakeWithContext(ctx aws.Context, input *DescribeHandshakeInput, opts ...request.Option) (*DescribeHandshakeOutput, error) { - req, out := c.DescribeHandshakeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeOrganization = "DescribeOrganization" - -// DescribeOrganizationRequest generates a "aws/request.Request" representing the -// client's request for the DescribeOrganization operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeOrganization for more information on using the DescribeOrganization -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DescribeOrganizationRequest method. -// req, resp := client.DescribeOrganizationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeOrganization -func (c *Organizations) DescribeOrganizationRequest(input *DescribeOrganizationInput) (req *request.Request, output *DescribeOrganizationOutput) { - op := &request.Operation{ - Name: opDescribeOrganization, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeOrganizationInput{} - } - - output = &DescribeOrganizationOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeOrganization API operation for AWS Organizations. -// -// Retrieves information about the organization that the user's account belongs -// to. -// -// This operation can be called from any account in the organization. -// -// Even if a policy type is shown as available in the organization, you can -// disable it separately at the root level with DisablePolicyType. Use ListRoots -// to see the status of policy types for a specified root. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation DescribeOrganization for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeOrganization -func (c *Organizations) DescribeOrganization(input *DescribeOrganizationInput) (*DescribeOrganizationOutput, error) { - req, out := c.DescribeOrganizationRequest(input) - return out, req.Send() -} - -// DescribeOrganizationWithContext is the same as DescribeOrganization with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeOrganization for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) DescribeOrganizationWithContext(ctx aws.Context, input *DescribeOrganizationInput, opts ...request.Option) (*DescribeOrganizationOutput, error) { - req, out := c.DescribeOrganizationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeOrganizationalUnit = "DescribeOrganizationalUnit" - -// DescribeOrganizationalUnitRequest generates a "aws/request.Request" representing the -// client's request for the DescribeOrganizationalUnit operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeOrganizationalUnit for more information on using the DescribeOrganizationalUnit -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DescribeOrganizationalUnitRequest method. -// req, resp := client.DescribeOrganizationalUnitRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeOrganizationalUnit -func (c *Organizations) DescribeOrganizationalUnitRequest(input *DescribeOrganizationalUnitInput) (req *request.Request, output *DescribeOrganizationalUnitOutput) { - op := &request.Operation{ - Name: opDescribeOrganizationalUnit, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeOrganizationalUnitInput{} - } - - output = &DescribeOrganizationalUnitOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeOrganizationalUnit API operation for AWS Organizations. -// -// Retrieves information about an organizational unit (OU). -// -// This operation can be called only from the organization's management account -// or by a member account that is a delegated administrator for an Amazon Web -// Services service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation DescribeOrganizationalUnit for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - OrganizationalUnitNotFoundException -// We can't find an OU with the OrganizationalUnitId that you specified. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeOrganizationalUnit -func (c *Organizations) DescribeOrganizationalUnit(input *DescribeOrganizationalUnitInput) (*DescribeOrganizationalUnitOutput, error) { - req, out := c.DescribeOrganizationalUnitRequest(input) - return out, req.Send() -} - -// DescribeOrganizationalUnitWithContext is the same as DescribeOrganizationalUnit with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeOrganizationalUnit for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) DescribeOrganizationalUnitWithContext(ctx aws.Context, input *DescribeOrganizationalUnitInput, opts ...request.Option) (*DescribeOrganizationalUnitOutput, error) { - req, out := c.DescribeOrganizationalUnitRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribePolicy = "DescribePolicy" - -// DescribePolicyRequest generates a "aws/request.Request" representing the -// client's request for the DescribePolicy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribePolicy for more information on using the DescribePolicy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DescribePolicyRequest method. -// req, resp := client.DescribePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribePolicy -func (c *Organizations) DescribePolicyRequest(input *DescribePolicyInput) (req *request.Request, output *DescribePolicyOutput) { - op := &request.Operation{ - Name: opDescribePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribePolicyInput{} - } - - output = &DescribePolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribePolicy API operation for AWS Organizations. -// -// Retrieves information about a policy. -// -// This operation can be called only from the organization's management account -// or by a member account that is a delegated administrator for an Amazon Web -// Services service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation DescribePolicy for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - PolicyNotFoundException -// We can't find a policy with the PolicyId that you specified. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribePolicy -func (c *Organizations) DescribePolicy(input *DescribePolicyInput) (*DescribePolicyOutput, error) { - req, out := c.DescribePolicyRequest(input) - return out, req.Send() -} - -// DescribePolicyWithContext is the same as DescribePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DescribePolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) DescribePolicyWithContext(ctx aws.Context, input *DescribePolicyInput, opts ...request.Option) (*DescribePolicyOutput, error) { - req, out := c.DescribePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeResourcePolicy = "DescribeResourcePolicy" - -// DescribeResourcePolicyRequest generates a "aws/request.Request" representing the -// client's request for the DescribeResourcePolicy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeResourcePolicy for more information on using the DescribeResourcePolicy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DescribeResourcePolicyRequest method. -// req, resp := client.DescribeResourcePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeResourcePolicy -func (c *Organizations) DescribeResourcePolicyRequest(input *DescribeResourcePolicyInput) (req *request.Request, output *DescribeResourcePolicyOutput) { - op := &request.Operation{ - Name: opDescribeResourcePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeResourcePolicyInput{} - } - - output = &DescribeResourcePolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeResourcePolicy API operation for AWS Organizations. -// -// Retrieves information about a resource policy. -// -// You can only call this operation from the organization's management account -// or by a member account that is a delegated administrator for an AWS service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation DescribeResourcePolicy for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ResourcePolicyNotFoundException -// We can't find a resource policy request with the parameter that you specified. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DescribeResourcePolicy -func (c *Organizations) DescribeResourcePolicy(input *DescribeResourcePolicyInput) (*DescribeResourcePolicyOutput, error) { - req, out := c.DescribeResourcePolicyRequest(input) - return out, req.Send() -} - -// DescribeResourcePolicyWithContext is the same as DescribeResourcePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeResourcePolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) DescribeResourcePolicyWithContext(ctx aws.Context, input *DescribeResourcePolicyInput, opts ...request.Option) (*DescribeResourcePolicyOutput, error) { - req, out := c.DescribeResourcePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDetachPolicy = "DetachPolicy" - -// DetachPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DetachPolicy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DetachPolicy for more information on using the DetachPolicy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DetachPolicyRequest method. -// req, resp := client.DetachPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DetachPolicy -func (c *Organizations) DetachPolicyRequest(input *DetachPolicyInput) (req *request.Request, output *DetachPolicyOutput) { - op := &request.Operation{ - Name: opDetachPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DetachPolicyInput{} - } - - output = &DetachPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DetachPolicy API operation for AWS Organizations. -// -// Detaches a policy from a target root, organizational unit (OU), or account. -// -// If the policy being detached is a service control policy (SCP), the changes -// to permissions for Identity and Access Management (IAM) users and roles in -// affected accounts are immediate. -// -// Every root, OU, and account must have at least one SCP attached. If you want -// to replace the default FullAWSAccess policy with an SCP that limits the permissions -// that can be delegated, you must attach the replacement SCP before you can -// remove the default SCP. This is the authorization strategy of an "allow list -// (https://docs.aws.amazon.com/organizations/latest/userguide/SCP_strategies.html#orgs_policies_allowlist)". -// If you instead attach a second SCP and leave the FullAWSAccess SCP still -// attached, and specify "Effect": "Deny" in the second SCP to override the -// "Effect": "Allow" in the FullAWSAccess policy (or any other attached SCP), -// you're using the authorization strategy of a "deny list (https://docs.aws.amazon.com/organizations/latest/userguide/SCP_strategies.html#orgs_policies_denylist)". -// -// This operation can be called only from the organization's management account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation DetachPolicy for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - PolicyNotAttachedException -// The policy isn't attached to the specified target in the specified root. -// -// - PolicyNotFoundException -// We can't find a policy with the PolicyId that you specified. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TargetNotFoundException -// We can't find a root, OU, account, or policy with the TargetId that you specified. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// - PolicyChangesInProgressException -// Changes to the effective policy are in progress, and its contents can't be -// returned. Try the operation again later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DetachPolicy -func (c *Organizations) DetachPolicy(input *DetachPolicyInput) (*DetachPolicyOutput, error) { - req, out := c.DetachPolicyRequest(input) - return out, req.Send() -} - -// DetachPolicyWithContext is the same as DetachPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DetachPolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) DetachPolicyWithContext(ctx aws.Context, input *DetachPolicyInput, opts ...request.Option) (*DetachPolicyOutput, error) { - req, out := c.DetachPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisableAWSServiceAccess = "DisableAWSServiceAccess" - -// DisableAWSServiceAccessRequest generates a "aws/request.Request" representing the -// client's request for the DisableAWSServiceAccess operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DisableAWSServiceAccess for more information on using the DisableAWSServiceAccess -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DisableAWSServiceAccessRequest method. -// req, resp := client.DisableAWSServiceAccessRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DisableAWSServiceAccess -func (c *Organizations) DisableAWSServiceAccessRequest(input *DisableAWSServiceAccessInput) (req *request.Request, output *DisableAWSServiceAccessOutput) { - op := &request.Operation{ - Name: opDisableAWSServiceAccess, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisableAWSServiceAccessInput{} - } - - output = &DisableAWSServiceAccessOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DisableAWSServiceAccess API operation for AWS Organizations. -// -// Disables the integration of an Amazon Web Services service (the service that -// is specified by ServicePrincipal) with Organizations. When you disable integration, -// the specified service no longer can create a service-linked role (https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html) -// in new accounts in your organization. This means the service can't perform -// operations on your behalf on any new accounts in your organization. The service -// can still perform operations in older accounts until the service completes -// its clean-up from Organizations. -// -// We strongly recommend that you don't use this command to disable integration -// between Organizations and the specified Amazon Web Services service. Instead, -// use the console or commands that are provided by the specified service. This -// lets the trusted service perform any required initialization when enabling -// trusted access, such as creating any required resources and any required -// clean up of resources when disabling trusted access. -// -// For information about how to disable trusted service access to your organization -// using the trusted service, see the Learn more link under the Supports Trusted -// Access column at Amazon Web Services services that you can use with Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services_list.html). -// on this page. -// -// If you disable access by using this command, it causes the following actions -// to occur: -// -// - The service can no longer create a service-linked role in the accounts -// in your organization. This means that the service can't perform operations -// on your behalf on any new accounts in your organization. The service can -// still perform operations in older accounts until the service completes -// its clean-up from Organizations. -// -// - The service can no longer perform tasks in the member accounts in the -// organization, unless those operations are explicitly permitted by the -// IAM policies that are attached to your roles. This includes any data aggregation -// from the member accounts to the management account, or to a delegated -// administrator account, where relevant. -// -// - Some services detect this and clean up any remaining data or resources -// related to the integration, while other services stop accessing the organization -// but leave any historical data and configuration in place to support a -// possible re-enabling of the integration. -// -// Using the other service's console or commands to disable the integration -// ensures that the other service is aware that it can clean up any resources -// that are required only for the integration. How the service cleans up its -// resources in the organization's accounts depends on that service. For more -// information, see the documentation for the other Amazon Web Services service. -// -// After you perform the DisableAWSServiceAccess operation, the specified service -// can no longer perform operations in your organization's accounts -// -// For more information about integrating other services with Organizations, -// including the list of services that work with Organizations, see Integrating -// Organizations with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// in the Organizations User Guide. -// -// This operation can be called only from the organization's management account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation DisableAWSServiceAccess for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DisableAWSServiceAccess -func (c *Organizations) DisableAWSServiceAccess(input *DisableAWSServiceAccessInput) (*DisableAWSServiceAccessOutput, error) { - req, out := c.DisableAWSServiceAccessRequest(input) - return out, req.Send() -} - -// DisableAWSServiceAccessWithContext is the same as DisableAWSServiceAccess with the addition of -// the ability to pass a context and additional request options. -// -// See DisableAWSServiceAccess for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) DisableAWSServiceAccessWithContext(ctx aws.Context, input *DisableAWSServiceAccessInput, opts ...request.Option) (*DisableAWSServiceAccessOutput, error) { - req, out := c.DisableAWSServiceAccessRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisablePolicyType = "DisablePolicyType" - -// DisablePolicyTypeRequest generates a "aws/request.Request" representing the -// client's request for the DisablePolicyType operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DisablePolicyType for more information on using the DisablePolicyType -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DisablePolicyTypeRequest method. -// req, resp := client.DisablePolicyTypeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DisablePolicyType -func (c *Organizations) DisablePolicyTypeRequest(input *DisablePolicyTypeInput) (req *request.Request, output *DisablePolicyTypeOutput) { - op := &request.Operation{ - Name: opDisablePolicyType, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisablePolicyTypeInput{} - } - - output = &DisablePolicyTypeOutput{} - req = c.newRequest(op, input, output) - return -} - -// DisablePolicyType API operation for AWS Organizations. -// -// Disables an organizational policy type in a root. A policy of a certain type -// can be attached to entities in a root only if that type is enabled in the -// root. After you perform this operation, you no longer can attach policies -// of the specified type to that root or to any organizational unit (OU) or -// account in that root. You can undo this by using the EnablePolicyType operation. -// -// This is an asynchronous request that Amazon Web Services performs in the -// background. If you disable a policy type for a root, it still appears enabled -// for the organization if all features (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) -// are enabled for the organization. Amazon Web Services recommends that you -// first use ListRoots to see the status of policy types for a specified root, -// and then use this operation. -// -// This operation can be called only from the organization's management account. -// -// To view the status of available policy types in the organization, use DescribeOrganization. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation DisablePolicyType for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - PolicyTypeNotEnabledException -// The specified policy type isn't currently enabled in this root. You can't -// attach policies of the specified type to entities in a root until you enable -// that type in the root. For more information, see Enabling All Features in -// Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) -// in the Organizations User Guide. -// -// - RootNotFoundException -// We can't find a root with the RootId that you specified. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// - PolicyChangesInProgressException -// Changes to the effective policy are in progress, and its contents can't be -// returned. Try the operation again later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/DisablePolicyType -func (c *Organizations) DisablePolicyType(input *DisablePolicyTypeInput) (*DisablePolicyTypeOutput, error) { - req, out := c.DisablePolicyTypeRequest(input) - return out, req.Send() -} - -// DisablePolicyTypeWithContext is the same as DisablePolicyType with the addition of -// the ability to pass a context and additional request options. -// -// See DisablePolicyType for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) DisablePolicyTypeWithContext(ctx aws.Context, input *DisablePolicyTypeInput, opts ...request.Option) (*DisablePolicyTypeOutput, error) { - req, out := c.DisablePolicyTypeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opEnableAWSServiceAccess = "EnableAWSServiceAccess" - -// EnableAWSServiceAccessRequest generates a "aws/request.Request" representing the -// client's request for the EnableAWSServiceAccess operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See EnableAWSServiceAccess for more information on using the EnableAWSServiceAccess -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the EnableAWSServiceAccessRequest method. -// req, resp := client.EnableAWSServiceAccessRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/EnableAWSServiceAccess -func (c *Organizations) EnableAWSServiceAccessRequest(input *EnableAWSServiceAccessInput) (req *request.Request, output *EnableAWSServiceAccessOutput) { - op := &request.Operation{ - Name: opEnableAWSServiceAccess, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableAWSServiceAccessInput{} - } - - output = &EnableAWSServiceAccessOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// EnableAWSServiceAccess API operation for AWS Organizations. -// -// Enables the integration of an Amazon Web Services service (the service that -// is specified by ServicePrincipal) with Organizations. When you enable integration, -// you allow the specified service to create a service-linked role (https://docs.aws.amazon.com/IAM/latest/UserGuide/using-service-linked-roles.html) -// in all the accounts in your organization. This allows the service to perform -// operations on your behalf in your organization and its accounts. -// -// We recommend that you enable integration between Organizations and the specified -// Amazon Web Services service by using the console or commands that are provided -// by the specified service. Doing so ensures that the service is aware that -// it can create the resources that are required for the integration. How the -// service creates those resources in the organization's accounts depends on -// that service. For more information, see the documentation for the other Amazon -// Web Services service. -// -// For more information about enabling services to integrate with Organizations, -// see Integrating Organizations with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// in the Organizations User Guide. -// -// You can only call this operation from the organization's management account -// and only if the organization has enabled all features (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation EnableAWSServiceAccess for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/EnableAWSServiceAccess -func (c *Organizations) EnableAWSServiceAccess(input *EnableAWSServiceAccessInput) (*EnableAWSServiceAccessOutput, error) { - req, out := c.EnableAWSServiceAccessRequest(input) - return out, req.Send() -} - -// EnableAWSServiceAccessWithContext is the same as EnableAWSServiceAccess with the addition of -// the ability to pass a context and additional request options. -// -// See EnableAWSServiceAccess for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) EnableAWSServiceAccessWithContext(ctx aws.Context, input *EnableAWSServiceAccessInput, opts ...request.Option) (*EnableAWSServiceAccessOutput, error) { - req, out := c.EnableAWSServiceAccessRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opEnableAllFeatures = "EnableAllFeatures" - -// EnableAllFeaturesRequest generates a "aws/request.Request" representing the -// client's request for the EnableAllFeatures operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See EnableAllFeatures for more information on using the EnableAllFeatures -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the EnableAllFeaturesRequest method. -// req, resp := client.EnableAllFeaturesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/EnableAllFeatures -func (c *Organizations) EnableAllFeaturesRequest(input *EnableAllFeaturesInput) (req *request.Request, output *EnableAllFeaturesOutput) { - op := &request.Operation{ - Name: opEnableAllFeatures, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnableAllFeaturesInput{} - } - - output = &EnableAllFeaturesOutput{} - req = c.newRequest(op, input, output) - return -} - -// EnableAllFeatures API operation for AWS Organizations. -// -// Enables all features in an organization. This enables the use of organization -// policies that can restrict the services and actions that can be called in -// each account. Until you enable all features, you have access only to consolidated -// billing, and you can't use any of the advanced account administration features -// that Organizations supports. For more information, see Enabling All Features -// in Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) -// in the Organizations User Guide. -// -// This operation is required only for organizations that were created explicitly -// with only the consolidated billing features enabled. Calling this operation -// sends a handshake to every invited account in the organization. The feature -// set change can be finalized and the additional features enabled only after -// all administrators in the invited accounts approve the change by accepting -// the handshake. -// -// After you enable all features, you can separately enable or disable individual -// policy types in a root using EnablePolicyType and DisablePolicyType. To see -// the status of policy types in a root, use ListRoots. -// -// After all invited member accounts accept the handshake, you finalize the -// feature set change by accepting the handshake that contains "Action": "ENABLE_ALL_FEATURES". -// This completes the change. -// -// After you enable all features in your organization, the management account -// in the organization can apply policies on all member accounts. These policies -// can restrict what users and even administrators in those accounts can do. -// The management account can apply policies that prevent accounts from leaving -// the organization. Ensure that your account administrators are aware of this. -// -// This operation can be called only from the organization's management account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation EnableAllFeatures for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - HandshakeConstraintViolationException -// The requested operation would violate the constraint identified in the reason -// code. -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation: -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. Note that deleted and closed -// accounts still count toward your limit. If you get this exception immediately -// after creating the organization, wait one hour and try again. If after -// an hour it continues to fail with this error, contact Amazon Web Services -// Support (https://docs.aws.amazon.com/support/home#/). -// -// - ALREADY_IN_AN_ORGANIZATION: The handshake request is invalid because -// the invited account is already a member of an organization. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVITE_DISABLED_DURING_ENABLE_ALL_FEATURES: You can't issue new invitations -// to join an organization while it's in the process of enabling all features. -// You can resume inviting accounts after you finalize the process when all -// accounts have agreed to the change. -// -// - ORGANIZATION_ALREADY_HAS_ALL_FEATURES: The handshake request is invalid -// because the organization has already enabled all features. -// -// - ORGANIZATION_IS_ALREADY_PENDING_ALL_FEATURES_MIGRATION: The handshake -// request is invalid because the organization has already started the process -// to enable all features. -// -// - ORGANIZATION_FROM_DIFFERENT_SELLER_OF_RECORD: The request failed because -// the account is from a different marketplace than the accounts in the organization. -// For example, accounts with India addresses must be associated with the -// AISPL marketplace. All accounts in an organization must be from the same -// marketplace. -// -// - ORGANIZATION_MEMBERSHIP_CHANGE_RATE_LIMIT_EXCEEDED: You attempted to -// change the membership of an account too quickly after its previous change. -// -// - PAYMENT_INSTRUMENT_REQUIRED: You can't complete the operation with an -// account that doesn't have a payment instrument, such as a credit card, -// associated with it. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/EnableAllFeatures -func (c *Organizations) EnableAllFeatures(input *EnableAllFeaturesInput) (*EnableAllFeaturesOutput, error) { - req, out := c.EnableAllFeaturesRequest(input) - return out, req.Send() -} - -// EnableAllFeaturesWithContext is the same as EnableAllFeatures with the addition of -// the ability to pass a context and additional request options. -// -// See EnableAllFeatures for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) EnableAllFeaturesWithContext(ctx aws.Context, input *EnableAllFeaturesInput, opts ...request.Option) (*EnableAllFeaturesOutput, error) { - req, out := c.EnableAllFeaturesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opEnablePolicyType = "EnablePolicyType" - -// EnablePolicyTypeRequest generates a "aws/request.Request" representing the -// client's request for the EnablePolicyType operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See EnablePolicyType for more information on using the EnablePolicyType -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the EnablePolicyTypeRequest method. -// req, resp := client.EnablePolicyTypeRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/EnablePolicyType -func (c *Organizations) EnablePolicyTypeRequest(input *EnablePolicyTypeInput) (req *request.Request, output *EnablePolicyTypeOutput) { - op := &request.Operation{ - Name: opEnablePolicyType, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &EnablePolicyTypeInput{} - } - - output = &EnablePolicyTypeOutput{} - req = c.newRequest(op, input, output) - return -} - -// EnablePolicyType API operation for AWS Organizations. -// -// Enables a policy type in a root. After you enable a policy type in a root, -// you can attach policies of that type to the root, any organizational unit -// (OU), or account in that root. You can undo this by using the DisablePolicyType -// operation. -// -// This is an asynchronous request that Amazon Web Services performs in the -// background. Amazon Web Services recommends that you first use ListRoots to -// see the status of policy types for a specified root, and then use this operation. -// -// This operation can be called only from the organization's management account. -// -// You can enable a policy type in a root only if that policy type is available -// in the organization. To view the status of available policy types in the -// organization, use DescribeOrganization. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation EnablePolicyType for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - PolicyTypeAlreadyEnabledException -// The specified policy type is already enabled in the specified root. -// -// - RootNotFoundException -// We can't find a root with the RootId that you specified. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - PolicyTypeNotAvailableForOrganizationException -// You can't use the specified policy type with the feature set currently enabled -// for this organization. For example, you can enable SCPs only after you enable -// all features in the organization. For more information, see Managing Organizations -// Policies (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html#enable_policies_on_root)in -// the Organizations User Guide. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// - PolicyChangesInProgressException -// Changes to the effective policy are in progress, and its contents can't be -// returned. Try the operation again later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/EnablePolicyType -func (c *Organizations) EnablePolicyType(input *EnablePolicyTypeInput) (*EnablePolicyTypeOutput, error) { - req, out := c.EnablePolicyTypeRequest(input) - return out, req.Send() -} - -// EnablePolicyTypeWithContext is the same as EnablePolicyType with the addition of -// the ability to pass a context and additional request options. -// -// See EnablePolicyType for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) EnablePolicyTypeWithContext(ctx aws.Context, input *EnablePolicyTypeInput, opts ...request.Option) (*EnablePolicyTypeOutput, error) { - req, out := c.EnablePolicyTypeRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opInviteAccountToOrganization = "InviteAccountToOrganization" - -// InviteAccountToOrganizationRequest generates a "aws/request.Request" representing the -// client's request for the InviteAccountToOrganization operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See InviteAccountToOrganization for more information on using the InviteAccountToOrganization -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the InviteAccountToOrganizationRequest method. -// req, resp := client.InviteAccountToOrganizationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/InviteAccountToOrganization -func (c *Organizations) InviteAccountToOrganizationRequest(input *InviteAccountToOrganizationInput) (req *request.Request, output *InviteAccountToOrganizationOutput) { - op := &request.Operation{ - Name: opInviteAccountToOrganization, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &InviteAccountToOrganizationInput{} - } - - output = &InviteAccountToOrganizationOutput{} - req = c.newRequest(op, input, output) - return -} - -// InviteAccountToOrganization API operation for AWS Organizations. -// -// Sends an invitation to another account to join your organization as a member -// account. Organizations sends email on your behalf to the email address that -// is associated with the other account's owner. The invitation is implemented -// as a Handshake whose details are in the response. -// -// - You can invite Amazon Web Services accounts only from the same seller -// as the management account. For example, if your organization's management -// account was created by Amazon Internet Services Pvt. Ltd (AISPL), an Amazon -// Web Services seller in India, you can invite only other AISPL accounts -// to your organization. You can't combine accounts from AISPL and Amazon -// Web Services or from any other Amazon Web Services seller. For more information, -// see Consolidated Billing in India (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/useconsolidatedbilliing-India.html). -// -// - If you receive an exception that indicates that you exceeded your account -// limits for the organization or that the operation failed because your -// organization is still initializing, wait one hour and then try again. -// If the error persists after an hour, contact Amazon Web Services Support -// (https://console.aws.amazon.com/support/home#/). -// -// If the request includes tags, then the requester must have the organizations:TagResource -// permission. -// -// This operation can be called only from the organization's management account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation InviteAccountToOrganization for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - AccountOwnerNotVerifiedException -// You can't invite an existing account to your organization until you verify -// that you own the email address associated with the management account. For -// more information, see Email Address Verification (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_create.html#about-email-verification) -// in the Organizations User Guide. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - HandshakeConstraintViolationException -// The requested operation would violate the constraint identified in the reason -// code. -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation: -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. Note that deleted and closed -// accounts still count toward your limit. If you get this exception immediately -// after creating the organization, wait one hour and try again. If after -// an hour it continues to fail with this error, contact Amazon Web Services -// Support (https://docs.aws.amazon.com/support/home#/). -// -// - ALREADY_IN_AN_ORGANIZATION: The handshake request is invalid because -// the invited account is already a member of an organization. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVITE_DISABLED_DURING_ENABLE_ALL_FEATURES: You can't issue new invitations -// to join an organization while it's in the process of enabling all features. -// You can resume inviting accounts after you finalize the process when all -// accounts have agreed to the change. -// -// - ORGANIZATION_ALREADY_HAS_ALL_FEATURES: The handshake request is invalid -// because the organization has already enabled all features. -// -// - ORGANIZATION_IS_ALREADY_PENDING_ALL_FEATURES_MIGRATION: The handshake -// request is invalid because the organization has already started the process -// to enable all features. -// -// - ORGANIZATION_FROM_DIFFERENT_SELLER_OF_RECORD: The request failed because -// the account is from a different marketplace than the accounts in the organization. -// For example, accounts with India addresses must be associated with the -// AISPL marketplace. All accounts in an organization must be from the same -// marketplace. -// -// - ORGANIZATION_MEMBERSHIP_CHANGE_RATE_LIMIT_EXCEEDED: You attempted to -// change the membership of an account too quickly after its previous change. -// -// - PAYMENT_INSTRUMENT_REQUIRED: You can't complete the operation with an -// account that doesn't have a payment instrument, such as a credit card, -// associated with it. -// -// - DuplicateHandshakeException -// A handshake with the same action and target already exists. For example, -// if you invited an account to join your organization, the invited account -// might already have a pending invitation from this organization. If you intend -// to resend an invitation to an account, ensure that existing handshakes that -// might be considered duplicates are canceled or declined. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - FinalizingOrganizationException -// Organizations couldn't perform the operation because your organization hasn't -// finished initializing. This can take up to an hour. Try again later. If after -// one hour you continue to receive this error, contact Amazon Web Services -// Support (https://console.aws.amazon.com/support/home#/). -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/InviteAccountToOrganization -func (c *Organizations) InviteAccountToOrganization(input *InviteAccountToOrganizationInput) (*InviteAccountToOrganizationOutput, error) { - req, out := c.InviteAccountToOrganizationRequest(input) - return out, req.Send() -} - -// InviteAccountToOrganizationWithContext is the same as InviteAccountToOrganization with the addition of -// the ability to pass a context and additional request options. -// -// See InviteAccountToOrganization for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) InviteAccountToOrganizationWithContext(ctx aws.Context, input *InviteAccountToOrganizationInput, opts ...request.Option) (*InviteAccountToOrganizationOutput, error) { - req, out := c.InviteAccountToOrganizationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opLeaveOrganization = "LeaveOrganization" - -// LeaveOrganizationRequest generates a "aws/request.Request" representing the -// client's request for the LeaveOrganization operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See LeaveOrganization for more information on using the LeaveOrganization -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the LeaveOrganizationRequest method. -// req, resp := client.LeaveOrganizationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/LeaveOrganization -func (c *Organizations) LeaveOrganizationRequest(input *LeaveOrganizationInput) (req *request.Request, output *LeaveOrganizationOutput) { - op := &request.Operation{ - Name: opLeaveOrganization, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &LeaveOrganizationInput{} - } - - output = &LeaveOrganizationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// LeaveOrganization API operation for AWS Organizations. -// -// Removes a member account from its parent organization. This version of the -// operation is performed by the account that wants to leave. To remove a member -// account as a user in the management account, use RemoveAccountFromOrganization -// instead. -// -// This operation can be called only from a member account in the organization. -// -// - The management account in an organization with all features enabled -// can set service control policies (SCPs) that can restrict what administrators -// of member accounts can do. This includes preventing them from successfully -// calling LeaveOrganization and leaving the organization. -// -// - You can leave an organization as a member account only if the account -// is configured with the information required to operate as a standalone -// account. When you create an account in an organization using the Organizations -// console, API, or CLI commands, the information required of standalone -// accounts is not automatically collected. For each account that you want -// to make standalone, you must perform the following steps. If any of the -// steps are already completed for this account, that step doesn't appear. -// Choose a support plan Provide and verify the required contact information -// Provide a current payment method Amazon Web Services uses the payment -// method to charge for any billable (not free tier) Amazon Web Services -// activity that occurs while the account isn't attached to an organization. -// Follow the steps at To leave an organization when all required account -// information has not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - The account that you want to leave must not be a delegated administrator -// account for any Amazon Web Services service enabled for your organization. -// If the account is a delegated administrator, you must first change the -// delegated administrator account to another account that is remaining in -// the organization. -// -// - You can leave an organization only after you enable IAM user access -// to billing in your account. For more information, see Activating Access -// to the Billing and Cost Management Console (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate) -// in the Amazon Web Services Billing and Cost Management User Guide. -// -// - After the account leaves the organization, all tags that were attached -// to the account object in the organization are deleted. Amazon Web Services -// accounts outside of an organization do not support tags. -// -// - A newly created account has a waiting period before it can be removed -// from its organization. If you get an error that indicates that a wait -// period is required, then try again in a few days. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation LeaveOrganization for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AccountNotFoundException -// We can't find an Amazon Web Services account with the AccountId that you -// specified, or the account whose credentials you used to make this request -// isn't a member of an organization. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - MasterCannotLeaveOrganizationException -// You can't remove a management account from an organization. If you want the -// management account to become a member account in another organization, you -// must first delete the current organization of the management account. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/LeaveOrganization -func (c *Organizations) LeaveOrganization(input *LeaveOrganizationInput) (*LeaveOrganizationOutput, error) { - req, out := c.LeaveOrganizationRequest(input) - return out, req.Send() -} - -// LeaveOrganizationWithContext is the same as LeaveOrganization with the addition of -// the ability to pass a context and additional request options. -// -// See LeaveOrganization for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) LeaveOrganizationWithContext(ctx aws.Context, input *LeaveOrganizationInput, opts ...request.Option) (*LeaveOrganizationOutput, error) { - req, out := c.LeaveOrganizationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListAWSServiceAccessForOrganization = "ListAWSServiceAccessForOrganization" - -// ListAWSServiceAccessForOrganizationRequest generates a "aws/request.Request" representing the -// client's request for the ListAWSServiceAccessForOrganization operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListAWSServiceAccessForOrganization for more information on using the ListAWSServiceAccessForOrganization -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListAWSServiceAccessForOrganizationRequest method. -// req, resp := client.ListAWSServiceAccessForOrganizationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListAWSServiceAccessForOrganization -func (c *Organizations) ListAWSServiceAccessForOrganizationRequest(input *ListAWSServiceAccessForOrganizationInput) (req *request.Request, output *ListAWSServiceAccessForOrganizationOutput) { - op := &request.Operation{ - Name: opListAWSServiceAccessForOrganization, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAWSServiceAccessForOrganizationInput{} - } - - output = &ListAWSServiceAccessForOrganizationOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAWSServiceAccessForOrganization API operation for AWS Organizations. -// -// Returns a list of the Amazon Web Services services that you enabled to integrate -// with your organization. After a service on this list creates the resources -// that it requires for the integration, it can perform operations on your organization -// and its accounts. -// -// For more information about integrating other services with Organizations, -// including the list of services that currently work with Organizations, see -// Integrating Organizations with Other Amazon Web Services Services (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services.html) -// in the Organizations User Guide. -// -// This operation can be called only from the organization's management account -// or by a member account that is a delegated administrator for an Amazon Web -// Services service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation ListAWSServiceAccessForOrganization for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListAWSServiceAccessForOrganization -func (c *Organizations) ListAWSServiceAccessForOrganization(input *ListAWSServiceAccessForOrganizationInput) (*ListAWSServiceAccessForOrganizationOutput, error) { - req, out := c.ListAWSServiceAccessForOrganizationRequest(input) - return out, req.Send() -} - -// ListAWSServiceAccessForOrganizationWithContext is the same as ListAWSServiceAccessForOrganization with the addition of -// the ability to pass a context and additional request options. -// -// See ListAWSServiceAccessForOrganization for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListAWSServiceAccessForOrganizationWithContext(ctx aws.Context, input *ListAWSServiceAccessForOrganizationInput, opts ...request.Option) (*ListAWSServiceAccessForOrganizationOutput, error) { - req, out := c.ListAWSServiceAccessForOrganizationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAWSServiceAccessForOrganizationPages iterates over the pages of a ListAWSServiceAccessForOrganization operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAWSServiceAccessForOrganization method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAWSServiceAccessForOrganization operation. -// pageNum := 0 -// err := client.ListAWSServiceAccessForOrganizationPages(params, -// func(page *organizations.ListAWSServiceAccessForOrganizationOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Organizations) ListAWSServiceAccessForOrganizationPages(input *ListAWSServiceAccessForOrganizationInput, fn func(*ListAWSServiceAccessForOrganizationOutput, bool) bool) error { - return c.ListAWSServiceAccessForOrganizationPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAWSServiceAccessForOrganizationPagesWithContext same as ListAWSServiceAccessForOrganizationPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListAWSServiceAccessForOrganizationPagesWithContext(ctx aws.Context, input *ListAWSServiceAccessForOrganizationInput, fn func(*ListAWSServiceAccessForOrganizationOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAWSServiceAccessForOrganizationInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAWSServiceAccessForOrganizationRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAWSServiceAccessForOrganizationOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListAccounts = "ListAccounts" - -// ListAccountsRequest generates a "aws/request.Request" representing the -// client's request for the ListAccounts operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListAccounts for more information on using the ListAccounts -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListAccountsRequest method. -// req, resp := client.ListAccountsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListAccounts -func (c *Organizations) ListAccountsRequest(input *ListAccountsInput) (req *request.Request, output *ListAccountsOutput) { - op := &request.Operation{ - Name: opListAccounts, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAccountsInput{} - } - - output = &ListAccountsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAccounts API operation for AWS Organizations. -// -// Lists all the accounts in the organization. To request only the accounts -// in a specified root or organizational unit (OU), use the ListAccountsForParent -// operation instead. -// -// Always check the NextToken response parameter for a null value when calling -// a List* operation. These operations can occasionally return an empty set -// of results even when there are more results available. The NextToken response -// parameter value is null only when there are no more results to display. -// -// This operation can be called only from the organization's management account -// or by a member account that is a delegated administrator for an Amazon Web -// Services service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation ListAccounts for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListAccounts -func (c *Organizations) ListAccounts(input *ListAccountsInput) (*ListAccountsOutput, error) { - req, out := c.ListAccountsRequest(input) - return out, req.Send() -} - -// ListAccountsWithContext is the same as ListAccounts with the addition of -// the ability to pass a context and additional request options. -// -// See ListAccounts for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListAccountsWithContext(ctx aws.Context, input *ListAccountsInput, opts ...request.Option) (*ListAccountsOutput, error) { - req, out := c.ListAccountsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAccountsPages iterates over the pages of a ListAccounts operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAccounts method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAccounts operation. -// pageNum := 0 -// err := client.ListAccountsPages(params, -// func(page *organizations.ListAccountsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Organizations) ListAccountsPages(input *ListAccountsInput, fn func(*ListAccountsOutput, bool) bool) error { - return c.ListAccountsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAccountsPagesWithContext same as ListAccountsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListAccountsPagesWithContext(ctx aws.Context, input *ListAccountsInput, fn func(*ListAccountsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAccountsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAccountsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAccountsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListAccountsForParent = "ListAccountsForParent" - -// ListAccountsForParentRequest generates a "aws/request.Request" representing the -// client's request for the ListAccountsForParent operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListAccountsForParent for more information on using the ListAccountsForParent -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListAccountsForParentRequest method. -// req, resp := client.ListAccountsForParentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListAccountsForParent -func (c *Organizations) ListAccountsForParentRequest(input *ListAccountsForParentInput) (req *request.Request, output *ListAccountsForParentOutput) { - op := &request.Operation{ - Name: opListAccountsForParent, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListAccountsForParentInput{} - } - - output = &ListAccountsForParentOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAccountsForParent API operation for AWS Organizations. -// -// Lists the accounts in an organization that are contained by the specified -// target root or organizational unit (OU). If you specify the root, you get -// a list of all the accounts that aren't in any OU. If you specify an OU, you -// get a list of all the accounts in only that OU and not in any child OUs. -// To get a list of all accounts in the organization, use the ListAccounts operation. -// -// Always check the NextToken response parameter for a null value when calling -// a List* operation. These operations can occasionally return an empty set -// of results even when there are more results available. The NextToken response -// parameter value is null only when there are no more results to display. -// -// This operation can be called only from the organization's management account -// or by a member account that is a delegated administrator for an Amazon Web -// Services service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation ListAccountsForParent for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ParentNotFoundException -// We can't find a root or OU with the ParentId that you specified. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListAccountsForParent -func (c *Organizations) ListAccountsForParent(input *ListAccountsForParentInput) (*ListAccountsForParentOutput, error) { - req, out := c.ListAccountsForParentRequest(input) - return out, req.Send() -} - -// ListAccountsForParentWithContext is the same as ListAccountsForParent with the addition of -// the ability to pass a context and additional request options. -// -// See ListAccountsForParent for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListAccountsForParentWithContext(ctx aws.Context, input *ListAccountsForParentInput, opts ...request.Option) (*ListAccountsForParentOutput, error) { - req, out := c.ListAccountsForParentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListAccountsForParentPages iterates over the pages of a ListAccountsForParent operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListAccountsForParent method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListAccountsForParent operation. -// pageNum := 0 -// err := client.ListAccountsForParentPages(params, -// func(page *organizations.ListAccountsForParentOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Organizations) ListAccountsForParentPages(input *ListAccountsForParentInput, fn func(*ListAccountsForParentOutput, bool) bool) error { - return c.ListAccountsForParentPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListAccountsForParentPagesWithContext same as ListAccountsForParentPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListAccountsForParentPagesWithContext(ctx aws.Context, input *ListAccountsForParentInput, fn func(*ListAccountsForParentOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListAccountsForParentInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListAccountsForParentRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListAccountsForParentOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListChildren = "ListChildren" - -// ListChildrenRequest generates a "aws/request.Request" representing the -// client's request for the ListChildren operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListChildren for more information on using the ListChildren -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListChildrenRequest method. -// req, resp := client.ListChildrenRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListChildren -func (c *Organizations) ListChildrenRequest(input *ListChildrenInput) (req *request.Request, output *ListChildrenOutput) { - op := &request.Operation{ - Name: opListChildren, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListChildrenInput{} - } - - output = &ListChildrenOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListChildren API operation for AWS Organizations. -// -// Lists all of the organizational units (OUs) or accounts that are contained -// in the specified parent OU or root. This operation, along with ListParents -// enables you to traverse the tree structure that makes up this root. -// -// Always check the NextToken response parameter for a null value when calling -// a List* operation. These operations can occasionally return an empty set -// of results even when there are more results available. The NextToken response -// parameter value is null only when there are no more results to display. -// -// This operation can be called only from the organization's management account -// or by a member account that is a delegated administrator for an Amazon Web -// Services service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation ListChildren for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ParentNotFoundException -// We can't find a root or OU with the ParentId that you specified. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListChildren -func (c *Organizations) ListChildren(input *ListChildrenInput) (*ListChildrenOutput, error) { - req, out := c.ListChildrenRequest(input) - return out, req.Send() -} - -// ListChildrenWithContext is the same as ListChildren with the addition of -// the ability to pass a context and additional request options. -// -// See ListChildren for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListChildrenWithContext(ctx aws.Context, input *ListChildrenInput, opts ...request.Option) (*ListChildrenOutput, error) { - req, out := c.ListChildrenRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListChildrenPages iterates over the pages of a ListChildren operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListChildren method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListChildren operation. -// pageNum := 0 -// err := client.ListChildrenPages(params, -// func(page *organizations.ListChildrenOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Organizations) ListChildrenPages(input *ListChildrenInput, fn func(*ListChildrenOutput, bool) bool) error { - return c.ListChildrenPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListChildrenPagesWithContext same as ListChildrenPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListChildrenPagesWithContext(ctx aws.Context, input *ListChildrenInput, fn func(*ListChildrenOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListChildrenInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListChildrenRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListChildrenOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListCreateAccountStatus = "ListCreateAccountStatus" - -// ListCreateAccountStatusRequest generates a "aws/request.Request" representing the -// client's request for the ListCreateAccountStatus operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListCreateAccountStatus for more information on using the ListCreateAccountStatus -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListCreateAccountStatusRequest method. -// req, resp := client.ListCreateAccountStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListCreateAccountStatus -func (c *Organizations) ListCreateAccountStatusRequest(input *ListCreateAccountStatusInput) (req *request.Request, output *ListCreateAccountStatusOutput) { - op := &request.Operation{ - Name: opListCreateAccountStatus, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListCreateAccountStatusInput{} - } - - output = &ListCreateAccountStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListCreateAccountStatus API operation for AWS Organizations. -// -// Lists the account creation requests that match the specified status that -// is currently being tracked for the organization. -// -// Always check the NextToken response parameter for a null value when calling -// a List* operation. These operations can occasionally return an empty set -// of results even when there are more results available. The NextToken response -// parameter value is null only when there are no more results to display. -// -// This operation can be called only from the organization's management account -// or by a member account that is a delegated administrator for an Amazon Web -// Services service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation ListCreateAccountStatus for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListCreateAccountStatus -func (c *Organizations) ListCreateAccountStatus(input *ListCreateAccountStatusInput) (*ListCreateAccountStatusOutput, error) { - req, out := c.ListCreateAccountStatusRequest(input) - return out, req.Send() -} - -// ListCreateAccountStatusWithContext is the same as ListCreateAccountStatus with the addition of -// the ability to pass a context and additional request options. -// -// See ListCreateAccountStatus for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListCreateAccountStatusWithContext(ctx aws.Context, input *ListCreateAccountStatusInput, opts ...request.Option) (*ListCreateAccountStatusOutput, error) { - req, out := c.ListCreateAccountStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListCreateAccountStatusPages iterates over the pages of a ListCreateAccountStatus operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListCreateAccountStatus method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListCreateAccountStatus operation. -// pageNum := 0 -// err := client.ListCreateAccountStatusPages(params, -// func(page *organizations.ListCreateAccountStatusOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Organizations) ListCreateAccountStatusPages(input *ListCreateAccountStatusInput, fn func(*ListCreateAccountStatusOutput, bool) bool) error { - return c.ListCreateAccountStatusPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListCreateAccountStatusPagesWithContext same as ListCreateAccountStatusPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListCreateAccountStatusPagesWithContext(ctx aws.Context, input *ListCreateAccountStatusInput, fn func(*ListCreateAccountStatusOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListCreateAccountStatusInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListCreateAccountStatusRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListCreateAccountStatusOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDelegatedAdministrators = "ListDelegatedAdministrators" - -// ListDelegatedAdministratorsRequest generates a "aws/request.Request" representing the -// client's request for the ListDelegatedAdministrators operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListDelegatedAdministrators for more information on using the ListDelegatedAdministrators -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListDelegatedAdministratorsRequest method. -// req, resp := client.ListDelegatedAdministratorsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListDelegatedAdministrators -func (c *Organizations) ListDelegatedAdministratorsRequest(input *ListDelegatedAdministratorsInput) (req *request.Request, output *ListDelegatedAdministratorsOutput) { - op := &request.Operation{ - Name: opListDelegatedAdministrators, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDelegatedAdministratorsInput{} - } - - output = &ListDelegatedAdministratorsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDelegatedAdministrators API operation for AWS Organizations. -// -// Lists the Amazon Web Services accounts that are designated as delegated administrators -// in this organization. -// -// This operation can be called only from the organization's management account -// or by a member account that is a delegated administrator for an Amazon Web -// Services service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation ListDelegatedAdministrators for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListDelegatedAdministrators -func (c *Organizations) ListDelegatedAdministrators(input *ListDelegatedAdministratorsInput) (*ListDelegatedAdministratorsOutput, error) { - req, out := c.ListDelegatedAdministratorsRequest(input) - return out, req.Send() -} - -// ListDelegatedAdministratorsWithContext is the same as ListDelegatedAdministrators with the addition of -// the ability to pass a context and additional request options. -// -// See ListDelegatedAdministrators for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListDelegatedAdministratorsWithContext(ctx aws.Context, input *ListDelegatedAdministratorsInput, opts ...request.Option) (*ListDelegatedAdministratorsOutput, error) { - req, out := c.ListDelegatedAdministratorsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDelegatedAdministratorsPages iterates over the pages of a ListDelegatedAdministrators operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDelegatedAdministrators method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDelegatedAdministrators operation. -// pageNum := 0 -// err := client.ListDelegatedAdministratorsPages(params, -// func(page *organizations.ListDelegatedAdministratorsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Organizations) ListDelegatedAdministratorsPages(input *ListDelegatedAdministratorsInput, fn func(*ListDelegatedAdministratorsOutput, bool) bool) error { - return c.ListDelegatedAdministratorsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDelegatedAdministratorsPagesWithContext same as ListDelegatedAdministratorsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListDelegatedAdministratorsPagesWithContext(ctx aws.Context, input *ListDelegatedAdministratorsInput, fn func(*ListDelegatedAdministratorsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDelegatedAdministratorsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDelegatedAdministratorsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDelegatedAdministratorsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListDelegatedServicesForAccount = "ListDelegatedServicesForAccount" - -// ListDelegatedServicesForAccountRequest generates a "aws/request.Request" representing the -// client's request for the ListDelegatedServicesForAccount operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListDelegatedServicesForAccount for more information on using the ListDelegatedServicesForAccount -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListDelegatedServicesForAccountRequest method. -// req, resp := client.ListDelegatedServicesForAccountRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListDelegatedServicesForAccount -func (c *Organizations) ListDelegatedServicesForAccountRequest(input *ListDelegatedServicesForAccountInput) (req *request.Request, output *ListDelegatedServicesForAccountOutput) { - op := &request.Operation{ - Name: opListDelegatedServicesForAccount, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListDelegatedServicesForAccountInput{} - } - - output = &ListDelegatedServicesForAccountOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListDelegatedServicesForAccount API operation for AWS Organizations. -// -// List the Amazon Web Services services for which the specified account is -// a delegated administrator. -// -// This operation can be called only from the organization's management account -// or by a member account that is a delegated administrator for an Amazon Web -// Services service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation ListDelegatedServicesForAccount for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AccountNotFoundException -// We can't find an Amazon Web Services account with the AccountId that you -// specified, or the account whose credentials you used to make this request -// isn't a member of an organization. -// -// - AccountNotRegisteredException -// The specified account is not a delegated administrator for this Amazon Web -// Services service. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListDelegatedServicesForAccount -func (c *Organizations) ListDelegatedServicesForAccount(input *ListDelegatedServicesForAccountInput) (*ListDelegatedServicesForAccountOutput, error) { - req, out := c.ListDelegatedServicesForAccountRequest(input) - return out, req.Send() -} - -// ListDelegatedServicesForAccountWithContext is the same as ListDelegatedServicesForAccount with the addition of -// the ability to pass a context and additional request options. -// -// See ListDelegatedServicesForAccount for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListDelegatedServicesForAccountWithContext(ctx aws.Context, input *ListDelegatedServicesForAccountInput, opts ...request.Option) (*ListDelegatedServicesForAccountOutput, error) { - req, out := c.ListDelegatedServicesForAccountRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListDelegatedServicesForAccountPages iterates over the pages of a ListDelegatedServicesForAccount operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListDelegatedServicesForAccount method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListDelegatedServicesForAccount operation. -// pageNum := 0 -// err := client.ListDelegatedServicesForAccountPages(params, -// func(page *organizations.ListDelegatedServicesForAccountOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Organizations) ListDelegatedServicesForAccountPages(input *ListDelegatedServicesForAccountInput, fn func(*ListDelegatedServicesForAccountOutput, bool) bool) error { - return c.ListDelegatedServicesForAccountPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListDelegatedServicesForAccountPagesWithContext same as ListDelegatedServicesForAccountPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListDelegatedServicesForAccountPagesWithContext(ctx aws.Context, input *ListDelegatedServicesForAccountInput, fn func(*ListDelegatedServicesForAccountOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListDelegatedServicesForAccountInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListDelegatedServicesForAccountRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListDelegatedServicesForAccountOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListHandshakesForAccount = "ListHandshakesForAccount" - -// ListHandshakesForAccountRequest generates a "aws/request.Request" representing the -// client's request for the ListHandshakesForAccount operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListHandshakesForAccount for more information on using the ListHandshakesForAccount -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListHandshakesForAccountRequest method. -// req, resp := client.ListHandshakesForAccountRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListHandshakesForAccount -func (c *Organizations) ListHandshakesForAccountRequest(input *ListHandshakesForAccountInput) (req *request.Request, output *ListHandshakesForAccountOutput) { - op := &request.Operation{ - Name: opListHandshakesForAccount, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListHandshakesForAccountInput{} - } - - output = &ListHandshakesForAccountOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListHandshakesForAccount API operation for AWS Organizations. -// -// Lists the current handshakes that are associated with the account of the -// requesting user. -// -// Handshakes that are ACCEPTED, DECLINED, CANCELED, or EXPIRED appear in the -// results of this API for only 30 days after changing to that state. After -// that, they're deleted and no longer accessible. -// -// Always check the NextToken response parameter for a null value when calling -// a List* operation. These operations can occasionally return an empty set -// of results even when there are more results available. The NextToken response -// parameter value is null only when there are no more results to display. -// -// This operation can be called from any account in the organization. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation ListHandshakesForAccount for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListHandshakesForAccount -func (c *Organizations) ListHandshakesForAccount(input *ListHandshakesForAccountInput) (*ListHandshakesForAccountOutput, error) { - req, out := c.ListHandshakesForAccountRequest(input) - return out, req.Send() -} - -// ListHandshakesForAccountWithContext is the same as ListHandshakesForAccount with the addition of -// the ability to pass a context and additional request options. -// -// See ListHandshakesForAccount for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListHandshakesForAccountWithContext(ctx aws.Context, input *ListHandshakesForAccountInput, opts ...request.Option) (*ListHandshakesForAccountOutput, error) { - req, out := c.ListHandshakesForAccountRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListHandshakesForAccountPages iterates over the pages of a ListHandshakesForAccount operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListHandshakesForAccount method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListHandshakesForAccount operation. -// pageNum := 0 -// err := client.ListHandshakesForAccountPages(params, -// func(page *organizations.ListHandshakesForAccountOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Organizations) ListHandshakesForAccountPages(input *ListHandshakesForAccountInput, fn func(*ListHandshakesForAccountOutput, bool) bool) error { - return c.ListHandshakesForAccountPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListHandshakesForAccountPagesWithContext same as ListHandshakesForAccountPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListHandshakesForAccountPagesWithContext(ctx aws.Context, input *ListHandshakesForAccountInput, fn func(*ListHandshakesForAccountOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListHandshakesForAccountInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListHandshakesForAccountRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListHandshakesForAccountOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListHandshakesForOrganization = "ListHandshakesForOrganization" - -// ListHandshakesForOrganizationRequest generates a "aws/request.Request" representing the -// client's request for the ListHandshakesForOrganization operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListHandshakesForOrganization for more information on using the ListHandshakesForOrganization -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListHandshakesForOrganizationRequest method. -// req, resp := client.ListHandshakesForOrganizationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListHandshakesForOrganization -func (c *Organizations) ListHandshakesForOrganizationRequest(input *ListHandshakesForOrganizationInput) (req *request.Request, output *ListHandshakesForOrganizationOutput) { - op := &request.Operation{ - Name: opListHandshakesForOrganization, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListHandshakesForOrganizationInput{} - } - - output = &ListHandshakesForOrganizationOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListHandshakesForOrganization API operation for AWS Organizations. -// -// Lists the handshakes that are associated with the organization that the requesting -// user is part of. The ListHandshakesForOrganization operation returns a list -// of handshake structures. Each structure contains details and status about -// a handshake. -// -// Handshakes that are ACCEPTED, DECLINED, CANCELED, or EXPIRED appear in the -// results of this API for only 30 days after changing to that state. After -// that, they're deleted and no longer accessible. -// -// Always check the NextToken response parameter for a null value when calling -// a List* operation. These operations can occasionally return an empty set -// of results even when there are more results available. The NextToken response -// parameter value is null only when there are no more results to display. -// -// This operation can be called only from the organization's management account -// or by a member account that is a delegated administrator for an Amazon Web -// Services service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation ListHandshakesForOrganization for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListHandshakesForOrganization -func (c *Organizations) ListHandshakesForOrganization(input *ListHandshakesForOrganizationInput) (*ListHandshakesForOrganizationOutput, error) { - req, out := c.ListHandshakesForOrganizationRequest(input) - return out, req.Send() -} - -// ListHandshakesForOrganizationWithContext is the same as ListHandshakesForOrganization with the addition of -// the ability to pass a context and additional request options. -// -// See ListHandshakesForOrganization for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListHandshakesForOrganizationWithContext(ctx aws.Context, input *ListHandshakesForOrganizationInput, opts ...request.Option) (*ListHandshakesForOrganizationOutput, error) { - req, out := c.ListHandshakesForOrganizationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListHandshakesForOrganizationPages iterates over the pages of a ListHandshakesForOrganization operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListHandshakesForOrganization method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListHandshakesForOrganization operation. -// pageNum := 0 -// err := client.ListHandshakesForOrganizationPages(params, -// func(page *organizations.ListHandshakesForOrganizationOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Organizations) ListHandshakesForOrganizationPages(input *ListHandshakesForOrganizationInput, fn func(*ListHandshakesForOrganizationOutput, bool) bool) error { - return c.ListHandshakesForOrganizationPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListHandshakesForOrganizationPagesWithContext same as ListHandshakesForOrganizationPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListHandshakesForOrganizationPagesWithContext(ctx aws.Context, input *ListHandshakesForOrganizationInput, fn func(*ListHandshakesForOrganizationOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListHandshakesForOrganizationInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListHandshakesForOrganizationRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListHandshakesForOrganizationOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListOrganizationalUnitsForParent = "ListOrganizationalUnitsForParent" - -// ListOrganizationalUnitsForParentRequest generates a "aws/request.Request" representing the -// client's request for the ListOrganizationalUnitsForParent operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListOrganizationalUnitsForParent for more information on using the ListOrganizationalUnitsForParent -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListOrganizationalUnitsForParentRequest method. -// req, resp := client.ListOrganizationalUnitsForParentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListOrganizationalUnitsForParent -func (c *Organizations) ListOrganizationalUnitsForParentRequest(input *ListOrganizationalUnitsForParentInput) (req *request.Request, output *ListOrganizationalUnitsForParentOutput) { - op := &request.Operation{ - Name: opListOrganizationalUnitsForParent, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListOrganizationalUnitsForParentInput{} - } - - output = &ListOrganizationalUnitsForParentOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListOrganizationalUnitsForParent API operation for AWS Organizations. -// -// Lists the organizational units (OUs) in a parent organizational unit or root. -// -// Always check the NextToken response parameter for a null value when calling -// a List* operation. These operations can occasionally return an empty set -// of results even when there are more results available. The NextToken response -// parameter value is null only when there are no more results to display. -// -// This operation can be called only from the organization's management account -// or by a member account that is a delegated administrator for an Amazon Web -// Services service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation ListOrganizationalUnitsForParent for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ParentNotFoundException -// We can't find a root or OU with the ParentId that you specified. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListOrganizationalUnitsForParent -func (c *Organizations) ListOrganizationalUnitsForParent(input *ListOrganizationalUnitsForParentInput) (*ListOrganizationalUnitsForParentOutput, error) { - req, out := c.ListOrganizationalUnitsForParentRequest(input) - return out, req.Send() -} - -// ListOrganizationalUnitsForParentWithContext is the same as ListOrganizationalUnitsForParent with the addition of -// the ability to pass a context and additional request options. -// -// See ListOrganizationalUnitsForParent for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListOrganizationalUnitsForParentWithContext(ctx aws.Context, input *ListOrganizationalUnitsForParentInput, opts ...request.Option) (*ListOrganizationalUnitsForParentOutput, error) { - req, out := c.ListOrganizationalUnitsForParentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListOrganizationalUnitsForParentPages iterates over the pages of a ListOrganizationalUnitsForParent operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListOrganizationalUnitsForParent method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListOrganizationalUnitsForParent operation. -// pageNum := 0 -// err := client.ListOrganizationalUnitsForParentPages(params, -// func(page *organizations.ListOrganizationalUnitsForParentOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Organizations) ListOrganizationalUnitsForParentPages(input *ListOrganizationalUnitsForParentInput, fn func(*ListOrganizationalUnitsForParentOutput, bool) bool) error { - return c.ListOrganizationalUnitsForParentPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListOrganizationalUnitsForParentPagesWithContext same as ListOrganizationalUnitsForParentPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListOrganizationalUnitsForParentPagesWithContext(ctx aws.Context, input *ListOrganizationalUnitsForParentInput, fn func(*ListOrganizationalUnitsForParentOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListOrganizationalUnitsForParentInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListOrganizationalUnitsForParentRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListOrganizationalUnitsForParentOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListParents = "ListParents" - -// ListParentsRequest generates a "aws/request.Request" representing the -// client's request for the ListParents operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListParents for more information on using the ListParents -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListParentsRequest method. -// req, resp := client.ListParentsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListParents -func (c *Organizations) ListParentsRequest(input *ListParentsInput) (req *request.Request, output *ListParentsOutput) { - op := &request.Operation{ - Name: opListParents, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListParentsInput{} - } - - output = &ListParentsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListParents API operation for AWS Organizations. -// -// Lists the root or organizational units (OUs) that serve as the immediate -// parent of the specified child OU or account. This operation, along with ListChildren -// enables you to traverse the tree structure that makes up this root. -// -// Always check the NextToken response parameter for a null value when calling -// a List* operation. These operations can occasionally return an empty set -// of results even when there are more results available. The NextToken response -// parameter value is null only when there are no more results to display. -// -// This operation can be called only from the organization's management account -// or by a member account that is a delegated administrator for an Amazon Web -// Services service. -// -// In the current release, a child can have only a single parent. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation ListParents for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ChildNotFoundException -// We can't find an organizational unit (OU) or Amazon Web Services account -// with the ChildId that you specified. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListParents -func (c *Organizations) ListParents(input *ListParentsInput) (*ListParentsOutput, error) { - req, out := c.ListParentsRequest(input) - return out, req.Send() -} - -// ListParentsWithContext is the same as ListParents with the addition of -// the ability to pass a context and additional request options. -// -// See ListParents for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListParentsWithContext(ctx aws.Context, input *ListParentsInput, opts ...request.Option) (*ListParentsOutput, error) { - req, out := c.ListParentsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListParentsPages iterates over the pages of a ListParents operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListParents method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListParents operation. -// pageNum := 0 -// err := client.ListParentsPages(params, -// func(page *organizations.ListParentsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Organizations) ListParentsPages(input *ListParentsInput, fn func(*ListParentsOutput, bool) bool) error { - return c.ListParentsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListParentsPagesWithContext same as ListParentsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListParentsPagesWithContext(ctx aws.Context, input *ListParentsInput, fn func(*ListParentsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListParentsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListParentsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListParentsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListPolicies = "ListPolicies" - -// ListPoliciesRequest generates a "aws/request.Request" representing the -// client's request for the ListPolicies operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListPolicies for more information on using the ListPolicies -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListPoliciesRequest method. -// req, resp := client.ListPoliciesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListPolicies -func (c *Organizations) ListPoliciesRequest(input *ListPoliciesInput) (req *request.Request, output *ListPoliciesOutput) { - op := &request.Operation{ - Name: opListPolicies, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListPoliciesInput{} - } - - output = &ListPoliciesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPolicies API operation for AWS Organizations. -// -// Retrieves the list of all policies in an organization of a specified type. -// -// Always check the NextToken response parameter for a null value when calling -// a List* operation. These operations can occasionally return an empty set -// of results even when there are more results available. The NextToken response -// parameter value is null only when there are no more results to display. -// -// This operation can be called only from the organization's management account -// or by a member account that is a delegated administrator for an Amazon Web -// Services service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation ListPolicies for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListPolicies -func (c *Organizations) ListPolicies(input *ListPoliciesInput) (*ListPoliciesOutput, error) { - req, out := c.ListPoliciesRequest(input) - return out, req.Send() -} - -// ListPoliciesWithContext is the same as ListPolicies with the addition of -// the ability to pass a context and additional request options. -// -// See ListPolicies for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListPoliciesWithContext(ctx aws.Context, input *ListPoliciesInput, opts ...request.Option) (*ListPoliciesOutput, error) { - req, out := c.ListPoliciesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListPoliciesPages iterates over the pages of a ListPolicies operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPolicies method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListPolicies operation. -// pageNum := 0 -// err := client.ListPoliciesPages(params, -// func(page *organizations.ListPoliciesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Organizations) ListPoliciesPages(input *ListPoliciesInput, fn func(*ListPoliciesOutput, bool) bool) error { - return c.ListPoliciesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPoliciesPagesWithContext same as ListPoliciesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListPoliciesPagesWithContext(ctx aws.Context, input *ListPoliciesInput, fn func(*ListPoliciesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListPoliciesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListPoliciesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListPoliciesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListPoliciesForTarget = "ListPoliciesForTarget" - -// ListPoliciesForTargetRequest generates a "aws/request.Request" representing the -// client's request for the ListPoliciesForTarget operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListPoliciesForTarget for more information on using the ListPoliciesForTarget -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListPoliciesForTargetRequest method. -// req, resp := client.ListPoliciesForTargetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListPoliciesForTarget -func (c *Organizations) ListPoliciesForTargetRequest(input *ListPoliciesForTargetInput) (req *request.Request, output *ListPoliciesForTargetOutput) { - op := &request.Operation{ - Name: opListPoliciesForTarget, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListPoliciesForTargetInput{} - } - - output = &ListPoliciesForTargetOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListPoliciesForTarget API operation for AWS Organizations. -// -// Lists the policies that are directly attached to the specified target root, -// organizational unit (OU), or account. You must specify the policy type that -// you want included in the returned list. -// -// Always check the NextToken response parameter for a null value when calling -// a List* operation. These operations can occasionally return an empty set -// of results even when there are more results available. The NextToken response -// parameter value is null only when there are no more results to display. -// -// This operation can be called only from the organization's management account -// or by a member account that is a delegated administrator for an Amazon Web -// Services service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation ListPoliciesForTarget for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TargetNotFoundException -// We can't find a root, OU, account, or policy with the TargetId that you specified. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListPoliciesForTarget -func (c *Organizations) ListPoliciesForTarget(input *ListPoliciesForTargetInput) (*ListPoliciesForTargetOutput, error) { - req, out := c.ListPoliciesForTargetRequest(input) - return out, req.Send() -} - -// ListPoliciesForTargetWithContext is the same as ListPoliciesForTarget with the addition of -// the ability to pass a context and additional request options. -// -// See ListPoliciesForTarget for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListPoliciesForTargetWithContext(ctx aws.Context, input *ListPoliciesForTargetInput, opts ...request.Option) (*ListPoliciesForTargetOutput, error) { - req, out := c.ListPoliciesForTargetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListPoliciesForTargetPages iterates over the pages of a ListPoliciesForTarget operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListPoliciesForTarget method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListPoliciesForTarget operation. -// pageNum := 0 -// err := client.ListPoliciesForTargetPages(params, -// func(page *organizations.ListPoliciesForTargetOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Organizations) ListPoliciesForTargetPages(input *ListPoliciesForTargetInput, fn func(*ListPoliciesForTargetOutput, bool) bool) error { - return c.ListPoliciesForTargetPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPoliciesForTargetPagesWithContext same as ListPoliciesForTargetPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListPoliciesForTargetPagesWithContext(ctx aws.Context, input *ListPoliciesForTargetInput, fn func(*ListPoliciesForTargetOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListPoliciesForTargetInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListPoliciesForTargetRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListPoliciesForTargetOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListRoots = "ListRoots" - -// ListRootsRequest generates a "aws/request.Request" representing the -// client's request for the ListRoots operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListRoots for more information on using the ListRoots -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListRootsRequest method. -// req, resp := client.ListRootsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListRoots -func (c *Organizations) ListRootsRequest(input *ListRootsInput) (req *request.Request, output *ListRootsOutput) { - op := &request.Operation{ - Name: opListRoots, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListRootsInput{} - } - - output = &ListRootsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListRoots API operation for AWS Organizations. -// -// Lists the roots that are defined in the current organization. -// -// Always check the NextToken response parameter for a null value when calling -// a List* operation. These operations can occasionally return an empty set -// of results even when there are more results available. The NextToken response -// parameter value is null only when there are no more results to display. -// -// This operation can be called only from the organization's management account -// or by a member account that is a delegated administrator for an Amazon Web -// Services service. -// -// Policy types can be enabled and disabled in roots. This is distinct from -// whether they're available in the organization. When you enable all features, -// you make policy types available for use in that organization. Individual -// policy types can then be enabled and disabled in a root. To see the availability -// of a policy type in an organization, use DescribeOrganization. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation ListRoots for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListRoots -func (c *Organizations) ListRoots(input *ListRootsInput) (*ListRootsOutput, error) { - req, out := c.ListRootsRequest(input) - return out, req.Send() -} - -// ListRootsWithContext is the same as ListRoots with the addition of -// the ability to pass a context and additional request options. -// -// See ListRoots for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListRootsWithContext(ctx aws.Context, input *ListRootsInput, opts ...request.Option) (*ListRootsOutput, error) { - req, out := c.ListRootsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListRootsPages iterates over the pages of a ListRoots operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListRoots method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListRoots operation. -// pageNum := 0 -// err := client.ListRootsPages(params, -// func(page *organizations.ListRootsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Organizations) ListRootsPages(input *ListRootsInput, fn func(*ListRootsOutput, bool) bool) error { - return c.ListRootsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListRootsPagesWithContext same as ListRootsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListRootsPagesWithContext(ctx aws.Context, input *ListRootsInput, fn func(*ListRootsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListRootsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListRootsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListRootsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListTagsForResource for more information on using the ListTagsForResource -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListTagsForResource -func (c *Organizations) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AWS Organizations. -// -// Lists tags that are attached to the specified resource. -// -// You can attach tags to the following resources in Organizations. -// -// - Amazon Web Services account -// -// - Organization root -// -// - Organizational unit (OU) -// -// - Policy (any type) -// -// This operation can be called only from the organization's management account -// or by a member account that is a delegated administrator for an Amazon Web -// Services service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - TargetNotFoundException -// We can't find a root, OU, account, or policy with the TargetId that you specified. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListTagsForResource -func (c *Organizations) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTagsForResourcePages iterates over the pages of a ListTagsForResource operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTagsForResource method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTagsForResource operation. -// pageNum := 0 -// err := client.ListTagsForResourcePages(params, -// func(page *organizations.ListTagsForResourceOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Organizations) ListTagsForResourcePages(input *ListTagsForResourceInput, fn func(*ListTagsForResourceOutput, bool) bool) error { - return c.ListTagsForResourcePagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTagsForResourcePagesWithContext same as ListTagsForResourcePages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListTagsForResourcePagesWithContext(ctx aws.Context, input *ListTagsForResourceInput, fn func(*ListTagsForResourceOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTagsForResourceInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTagsForResourceRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListTagsForResourceOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListTargetsForPolicy = "ListTargetsForPolicy" - -// ListTargetsForPolicyRequest generates a "aws/request.Request" representing the -// client's request for the ListTargetsForPolicy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListTargetsForPolicy for more information on using the ListTargetsForPolicy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListTargetsForPolicyRequest method. -// req, resp := client.ListTargetsForPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListTargetsForPolicy -func (c *Organizations) ListTargetsForPolicyRequest(input *ListTargetsForPolicyInput) (req *request.Request, output *ListTargetsForPolicyOutput) { - op := &request.Operation{ - Name: opListTargetsForPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"NextToken"}, - OutputTokens: []string{"NextToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListTargetsForPolicyInput{} - } - - output = &ListTargetsForPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTargetsForPolicy API operation for AWS Organizations. -// -// Lists all the roots, organizational units (OUs), and accounts that the specified -// policy is attached to. -// -// Always check the NextToken response parameter for a null value when calling -// a List* operation. These operations can occasionally return an empty set -// of results even when there are more results available. The NextToken response -// parameter value is null only when there are no more results to display. -// -// This operation can be called only from the organization's management account -// or by a member account that is a delegated administrator for an Amazon Web -// Services service. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation ListTargetsForPolicy for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - PolicyNotFoundException -// We can't find a policy with the PolicyId that you specified. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/ListTargetsForPolicy -func (c *Organizations) ListTargetsForPolicy(input *ListTargetsForPolicyInput) (*ListTargetsForPolicyOutput, error) { - req, out := c.ListTargetsForPolicyRequest(input) - return out, req.Send() -} - -// ListTargetsForPolicyWithContext is the same as ListTargetsForPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See ListTargetsForPolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListTargetsForPolicyWithContext(ctx aws.Context, input *ListTargetsForPolicyInput, opts ...request.Option) (*ListTargetsForPolicyOutput, error) { - req, out := c.ListTargetsForPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListTargetsForPolicyPages iterates over the pages of a ListTargetsForPolicy operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListTargetsForPolicy method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListTargetsForPolicy operation. -// pageNum := 0 -// err := client.ListTargetsForPolicyPages(params, -// func(page *organizations.ListTargetsForPolicyOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *Organizations) ListTargetsForPolicyPages(input *ListTargetsForPolicyInput, fn func(*ListTargetsForPolicyOutput, bool) bool) error { - return c.ListTargetsForPolicyPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListTargetsForPolicyPagesWithContext same as ListTargetsForPolicyPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) ListTargetsForPolicyPagesWithContext(ctx aws.Context, input *ListTargetsForPolicyInput, fn func(*ListTargetsForPolicyOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListTargetsForPolicyInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListTargetsForPolicyRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListTargetsForPolicyOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opMoveAccount = "MoveAccount" - -// MoveAccountRequest generates a "aws/request.Request" representing the -// client's request for the MoveAccount operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See MoveAccount for more information on using the MoveAccount -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the MoveAccountRequest method. -// req, resp := client.MoveAccountRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/MoveAccount -func (c *Organizations) MoveAccountRequest(input *MoveAccountInput) (req *request.Request, output *MoveAccountOutput) { - op := &request.Operation{ - Name: opMoveAccount, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &MoveAccountInput{} - } - - output = &MoveAccountOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// MoveAccount API operation for AWS Organizations. -// -// Moves an account from its current source parent root or organizational unit -// (OU) to the specified destination parent root or OU. -// -// This operation can be called only from the organization's management account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation MoveAccount for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - SourceParentNotFoundException -// We can't find a source root or OU with the ParentId that you specified. -// -// - DestinationParentNotFoundException -// We can't find the destination container (a root or OU) with the ParentId -// that you specified. -// -// - DuplicateAccountException -// That account is already present in the specified destination. -// -// - AccountNotFoundException -// We can't find an Amazon Web Services account with the AccountId that you -// specified, or the account whose credentials you used to make this request -// isn't a member of an organization. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/MoveAccount -func (c *Organizations) MoveAccount(input *MoveAccountInput) (*MoveAccountOutput, error) { - req, out := c.MoveAccountRequest(input) - return out, req.Send() -} - -// MoveAccountWithContext is the same as MoveAccount with the addition of -// the ability to pass a context and additional request options. -// -// See MoveAccount for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) MoveAccountWithContext(ctx aws.Context, input *MoveAccountInput, opts ...request.Option) (*MoveAccountOutput, error) { - req, out := c.MoveAccountRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutResourcePolicy = "PutResourcePolicy" - -// PutResourcePolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutResourcePolicy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutResourcePolicy for more information on using the PutResourcePolicy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutResourcePolicyRequest method. -// req, resp := client.PutResourcePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/PutResourcePolicy -func (c *Organizations) PutResourcePolicyRequest(input *PutResourcePolicyInput) (req *request.Request, output *PutResourcePolicyOutput) { - op := &request.Operation{ - Name: opPutResourcePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutResourcePolicyInput{} - } - - output = &PutResourcePolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutResourcePolicy API operation for AWS Organizations. -// -// Creates or updates a resource policy. -// -// You can only call this operation from the organization's management account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation PutResourcePolicy for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/PutResourcePolicy -func (c *Organizations) PutResourcePolicy(input *PutResourcePolicyInput) (*PutResourcePolicyOutput, error) { - req, out := c.PutResourcePolicyRequest(input) - return out, req.Send() -} - -// PutResourcePolicyWithContext is the same as PutResourcePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See PutResourcePolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) PutResourcePolicyWithContext(ctx aws.Context, input *PutResourcePolicyInput, opts ...request.Option) (*PutResourcePolicyOutput, error) { - req, out := c.PutResourcePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRegisterDelegatedAdministrator = "RegisterDelegatedAdministrator" - -// RegisterDelegatedAdministratorRequest generates a "aws/request.Request" representing the -// client's request for the RegisterDelegatedAdministrator operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RegisterDelegatedAdministrator for more information on using the RegisterDelegatedAdministrator -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the RegisterDelegatedAdministratorRequest method. -// req, resp := client.RegisterDelegatedAdministratorRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/RegisterDelegatedAdministrator -func (c *Organizations) RegisterDelegatedAdministratorRequest(input *RegisterDelegatedAdministratorInput) (req *request.Request, output *RegisterDelegatedAdministratorOutput) { - op := &request.Operation{ - Name: opRegisterDelegatedAdministrator, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RegisterDelegatedAdministratorInput{} - } - - output = &RegisterDelegatedAdministratorOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// RegisterDelegatedAdministrator API operation for AWS Organizations. -// -// Enables the specified member account to administer the Organizations features -// of the specified Amazon Web Services service. It grants read-only access -// to Organizations service data. The account still requires IAM permissions -// to access and administer the Amazon Web Services service. -// -// You can run this action only for Amazon Web Services services that support -// this feature. For a current list of services that support it, see the column -// Supports Delegated Administrator in the table at Amazon Web Services Services -// that you can use with Organizations (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_integrate_services_list.html) -// in the Organizations User Guide. -// -// This operation can be called only from the organization's management account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation RegisterDelegatedAdministrator for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AccountAlreadyRegisteredException -// The specified account is already a delegated administrator for this Amazon -// Web Services service. -// -// - AccountNotFoundException -// We can't find an Amazon Web Services account with the AccountId that you -// specified, or the account whose credentials you used to make this request -// isn't a member of an organization. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/RegisterDelegatedAdministrator -func (c *Organizations) RegisterDelegatedAdministrator(input *RegisterDelegatedAdministratorInput) (*RegisterDelegatedAdministratorOutput, error) { - req, out := c.RegisterDelegatedAdministratorRequest(input) - return out, req.Send() -} - -// RegisterDelegatedAdministratorWithContext is the same as RegisterDelegatedAdministrator with the addition of -// the ability to pass a context and additional request options. -// -// See RegisterDelegatedAdministrator for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) RegisterDelegatedAdministratorWithContext(ctx aws.Context, input *RegisterDelegatedAdministratorInput, opts ...request.Option) (*RegisterDelegatedAdministratorOutput, error) { - req, out := c.RegisterDelegatedAdministratorRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRemoveAccountFromOrganization = "RemoveAccountFromOrganization" - -// RemoveAccountFromOrganizationRequest generates a "aws/request.Request" representing the -// client's request for the RemoveAccountFromOrganization operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RemoveAccountFromOrganization for more information on using the RemoveAccountFromOrganization -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the RemoveAccountFromOrganizationRequest method. -// req, resp := client.RemoveAccountFromOrganizationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/RemoveAccountFromOrganization -func (c *Organizations) RemoveAccountFromOrganizationRequest(input *RemoveAccountFromOrganizationInput) (req *request.Request, output *RemoveAccountFromOrganizationOutput) { - op := &request.Operation{ - Name: opRemoveAccountFromOrganization, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &RemoveAccountFromOrganizationInput{} - } - - output = &RemoveAccountFromOrganizationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// RemoveAccountFromOrganization API operation for AWS Organizations. -// -// Removes the specified account from the organization. -// -// The removed account becomes a standalone account that isn't a member of any -// organization. It's no longer subject to any policies and is responsible for -// its own bill payments. The organization's management account is no longer -// charged for any expenses accrued by the member account after it's removed -// from the organization. -// -// This operation can be called only from the organization's management account. -// Member accounts can remove themselves with LeaveOrganization instead. -// -// - You can remove an account from your organization only if the account -// is configured with the information required to operate as a standalone -// account. When you create an account in an organization using the Organizations -// console, API, or CLI commands, the information required of standalone -// accounts is not automatically collected. For an account that you want -// to make standalone, you must choose a support plan, provide and verify -// the required contact information, and provide a current payment method. -// Amazon Web Services uses the payment method to charge for any billable -// (not free tier) Amazon Web Services activity that occurs while the account -// isn't attached to an organization. To remove an account that doesn't yet -// have this information, you must sign in as the member account and follow -// the steps at To leave an organization when all required account information -// has not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - The account that you want to leave must not be a delegated administrator -// account for any Amazon Web Services service enabled for your organization. -// If the account is a delegated administrator, you must first change the -// delegated administrator account to another account that is remaining in -// the organization. -// -// - After the account leaves the organization, all tags that were attached -// to the account object in the organization are deleted. Amazon Web Services -// accounts outside of an organization do not support tags. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation RemoveAccountFromOrganization for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AccountNotFoundException -// We can't find an Amazon Web Services account with the AccountId that you -// specified, or the account whose credentials you used to make this request -// isn't a member of an organization. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - MasterCannotLeaveOrganizationException -// You can't remove a management account from an organization. If you want the -// management account to become a member account in another organization, you -// must first delete the current organization of the management account. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/RemoveAccountFromOrganization -func (c *Organizations) RemoveAccountFromOrganization(input *RemoveAccountFromOrganizationInput) (*RemoveAccountFromOrganizationOutput, error) { - req, out := c.RemoveAccountFromOrganizationRequest(input) - return out, req.Send() -} - -// RemoveAccountFromOrganizationWithContext is the same as RemoveAccountFromOrganization with the addition of -// the ability to pass a context and additional request options. -// -// See RemoveAccountFromOrganization for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) RemoveAccountFromOrganizationWithContext(ctx aws.Context, input *RemoveAccountFromOrganizationInput, opts ...request.Option) (*RemoveAccountFromOrganizationOutput, error) { - req, out := c.RemoveAccountFromOrganizationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See TagResource for more information on using the TagResource -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/TagResource -func (c *Organizations) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for AWS Organizations. -// -// Adds one or more tags to the specified resource. -// -// Currently, you can attach tags to the following resources in Organizations. -// -// - Amazon Web Services account -// -// - Organization root -// -// - Organizational unit (OU) -// -// - Policy (any type) -// -// This operation can be called only from the organization's management account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - TargetNotFoundException -// We can't find a root, OU, account, or policy with the TargetId that you specified. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/TagResource -func (c *Organizations) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UntagResource for more information on using the UntagResource -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/UntagResource -func (c *Organizations) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for AWS Organizations. -// -// Removes any tags with the specified keys from the specified resource. -// -// You can attach tags to the following resources in Organizations. -// -// - Amazon Web Services account -// -// - Organization root -// -// - Organizational unit (OU) -// -// - Policy (any type) -// -// This operation can be called only from the organization's management account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - TargetNotFoundException -// We can't find a root, OU, account, or policy with the TargetId that you specified. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/UntagResource -func (c *Organizations) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateOrganizationalUnit = "UpdateOrganizationalUnit" - -// UpdateOrganizationalUnitRequest generates a "aws/request.Request" representing the -// client's request for the UpdateOrganizationalUnit operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateOrganizationalUnit for more information on using the UpdateOrganizationalUnit -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the UpdateOrganizationalUnitRequest method. -// req, resp := client.UpdateOrganizationalUnitRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/UpdateOrganizationalUnit -func (c *Organizations) UpdateOrganizationalUnitRequest(input *UpdateOrganizationalUnitInput) (req *request.Request, output *UpdateOrganizationalUnitOutput) { - op := &request.Operation{ - Name: opUpdateOrganizationalUnit, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateOrganizationalUnitInput{} - } - - output = &UpdateOrganizationalUnitOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateOrganizationalUnit API operation for AWS Organizations. -// -// Renames the specified organizational unit (OU). The ID and ARN don't change. -// The child OUs and accounts remain in place, and any attached policies of -// the OU remain attached. -// -// This operation can be called only from the organization's management account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation UpdateOrganizationalUnit for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - DuplicateOrganizationalUnitException -// An OU with the same name already exists. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - OrganizationalUnitNotFoundException -// We can't find an OU with the OrganizationalUnitId that you specified. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/UpdateOrganizationalUnit -func (c *Organizations) UpdateOrganizationalUnit(input *UpdateOrganizationalUnitInput) (*UpdateOrganizationalUnitOutput, error) { - req, out := c.UpdateOrganizationalUnitRequest(input) - return out, req.Send() -} - -// UpdateOrganizationalUnitWithContext is the same as UpdateOrganizationalUnit with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateOrganizationalUnit for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) UpdateOrganizationalUnitWithContext(ctx aws.Context, input *UpdateOrganizationalUnitInput, opts ...request.Option) (*UpdateOrganizationalUnitOutput, error) { - req, out := c.UpdateOrganizationalUnitRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdatePolicy = "UpdatePolicy" - -// UpdatePolicyRequest generates a "aws/request.Request" representing the -// client's request for the UpdatePolicy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdatePolicy for more information on using the UpdatePolicy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the UpdatePolicyRequest method. -// req, resp := client.UpdatePolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/UpdatePolicy -func (c *Organizations) UpdatePolicyRequest(input *UpdatePolicyInput) (req *request.Request, output *UpdatePolicyOutput) { - op := &request.Operation{ - Name: opUpdatePolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdatePolicyInput{} - } - - output = &UpdatePolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdatePolicy API operation for AWS Organizations. -// -// Updates an existing policy with a new name, description, or content. If you -// don't supply any parameter, that value remains unchanged. You can't change -// a policy's type. -// -// This operation can be called only from the organization's management account. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Organizations's -// API operation UpdatePolicy for usage and error information. -// -// Returned Error Types: -// -// - AccessDeniedException -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -// -// - AWSOrganizationsNotInUseException -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ConstraintViolationException -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -// -// - DuplicatePolicyException -// A policy with the same name already exists. -// -// - InvalidInputException -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -// -// - MalformedPolicyDocumentException -// The provided policy document doesn't meet the requirements of the specified -// policy type. For example, the syntax might be incorrect. For details about -// service control policy syntax, see Service Control Policy Syntax (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_scp-syntax.html) -// in the Organizations User Guide. -// -// - PolicyNotFoundException -// We can't find a policy with the PolicyId that you specified. -// -// - ServiceException -// Organizations can't complete your request because of an internal service -// error. Try again later. -// -// - TooManyRequestsException -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -// -// - UnsupportedAPIEndpointException -// This action isn't available in the current Amazon Web Services Region. -// -// - PolicyChangesInProgressException -// Changes to the effective policy are in progress, and its contents can't be -// returned. Try the operation again later. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28/UpdatePolicy -func (c *Organizations) UpdatePolicy(input *UpdatePolicyInput) (*UpdatePolicyOutput, error) { - req, out := c.UpdatePolicyRequest(input) - return out, req.Send() -} - -// UpdatePolicyWithContext is the same as UpdatePolicy with the addition of -// the ability to pass a context and additional request options. -// -// See UpdatePolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *Organizations) UpdatePolicyWithContext(ctx aws.Context, input *UpdatePolicyInput, opts ...request.Option) (*UpdatePolicyOutput, error) { - req, out := c.UpdatePolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Your account isn't a member of an organization. To make this request, you -// must use the credentials of an account that belongs to an organization. -type AWSOrganizationsNotInUseException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AWSOrganizationsNotInUseException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AWSOrganizationsNotInUseException) GoString() string { - return s.String() -} - -func newErrorAWSOrganizationsNotInUseException(v protocol.ResponseMetadata) error { - return &AWSOrganizationsNotInUseException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AWSOrganizationsNotInUseException) Code() string { - return "AWSOrganizationsNotInUseException" -} - -// Message returns the exception's message. -func (s *AWSOrganizationsNotInUseException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AWSOrganizationsNotInUseException) OrigErr() error { - return nil -} - -func (s *AWSOrganizationsNotInUseException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AWSOrganizationsNotInUseException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AWSOrganizationsNotInUseException) RequestID() string { - return s.RespMetadata.RequestID -} - -type AcceptHandshakeInput struct { - _ struct{} `type:"structure"` - - // The unique identifier (ID) of the handshake that you want to accept. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for handshake ID string - // requires "h-" followed by from 8 to 32 lowercase letters or digits. - // - // HandshakeId is a required field - HandshakeId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AcceptHandshakeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AcceptHandshakeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AcceptHandshakeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AcceptHandshakeInput"} - if s.HandshakeId == nil { - invalidParams.Add(request.NewErrParamRequired("HandshakeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHandshakeId sets the HandshakeId field's value. -func (s *AcceptHandshakeInput) SetHandshakeId(v string) *AcceptHandshakeInput { - s.HandshakeId = &v - return s -} - -type AcceptHandshakeOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains details about the accepted handshake. - Handshake *Handshake `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AcceptHandshakeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AcceptHandshakeOutput) GoString() string { - return s.String() -} - -// SetHandshake sets the Handshake field's value. -func (s *AcceptHandshakeOutput) SetHandshake(v *Handshake) *AcceptHandshakeOutput { - s.Handshake = v - return s -} - -// You don't have permissions to perform the requested operation. The user or -// role that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see -// Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) -// in the IAM User Guide. -type AccessDeniedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccessDeniedException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccessDeniedException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedException(v protocol.ResponseMetadata) error { - return &AccessDeniedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedException) Code() string { - return "AccessDeniedException" -} - -// Message returns the exception's message. -func (s *AccessDeniedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedException) OrigErr() error { - return nil -} - -func (s *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The operation that you attempted requires you to have the iam:CreateServiceLinkedRole -// for organizations.amazonaws.com permission so that Organizations can create -// the required service-linked role. You don't have that permission. -type AccessDeniedForDependencyException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - Reason *string `type:"string" enum:"AccessDeniedForDependencyExceptionReason"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccessDeniedForDependencyException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccessDeniedForDependencyException) GoString() string { - return s.String() -} - -func newErrorAccessDeniedForDependencyException(v protocol.ResponseMetadata) error { - return &AccessDeniedForDependencyException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccessDeniedForDependencyException) Code() string { - return "AccessDeniedForDependencyException" -} - -// Message returns the exception's message. -func (s *AccessDeniedForDependencyException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccessDeniedForDependencyException) OrigErr() error { - return nil -} - -func (s *AccessDeniedForDependencyException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccessDeniedForDependencyException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccessDeniedForDependencyException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains information about an Amazon Web Services account that is a member -// of an organization. -type Account struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the account. - // - // For more information about ARNs in Organizations, see ARN Formats Supported - // by Organizations (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies) - // in the Amazon Web Services Service Authorization Reference. - Arn *string `type:"string"` - - // The email address associated with the Amazon Web Services account. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for this parameter is - // a string of characters that represents a standard internet email address. - // - // Email is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Account's - // String and GoString methods. - Email *string `min:"6" type:"string" sensitive:"true"` - - // The unique identifier (ID) of the account. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for an account ID string - // requires exactly 12 digits. - Id *string `type:"string"` - - // The method by which the account joined the organization. - JoinedMethod *string `type:"string" enum:"AccountJoinedMethod"` - - // The date the account became a part of the organization. - JoinedTimestamp *time.Time `type:"timestamp"` - - // The friendly name of the account. - // - // The regex pattern (http://wikipedia.org/wiki/regex) that is used to validate - // this parameter is a string of any of the characters in the ASCII character - // range. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Account's - // String and GoString methods. - Name *string `min:"1" type:"string" sensitive:"true"` - - // The status of the account in the organization. - Status *string `type:"string" enum:"AccountStatus"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Account) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Account) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Account) SetArn(v string) *Account { - s.Arn = &v - return s -} - -// SetEmail sets the Email field's value. -func (s *Account) SetEmail(v string) *Account { - s.Email = &v - return s -} - -// SetId sets the Id field's value. -func (s *Account) SetId(v string) *Account { - s.Id = &v - return s -} - -// SetJoinedMethod sets the JoinedMethod field's value. -func (s *Account) SetJoinedMethod(v string) *Account { - s.JoinedMethod = &v - return s -} - -// SetJoinedTimestamp sets the JoinedTimestamp field's value. -func (s *Account) SetJoinedTimestamp(v time.Time) *Account { - s.JoinedTimestamp = &v - return s -} - -// SetName sets the Name field's value. -func (s *Account) SetName(v string) *Account { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Account) SetStatus(v string) *Account { - s.Status = &v - return s -} - -// You attempted to close an account that is already closed. -type AccountAlreadyClosedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccountAlreadyClosedException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccountAlreadyClosedException) GoString() string { - return s.String() -} - -func newErrorAccountAlreadyClosedException(v protocol.ResponseMetadata) error { - return &AccountAlreadyClosedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccountAlreadyClosedException) Code() string { - return "AccountAlreadyClosedException" -} - -// Message returns the exception's message. -func (s *AccountAlreadyClosedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccountAlreadyClosedException) OrigErr() error { - return nil -} - -func (s *AccountAlreadyClosedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccountAlreadyClosedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccountAlreadyClosedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The specified account is already a delegated administrator for this Amazon -// Web Services service. -type AccountAlreadyRegisteredException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccountAlreadyRegisteredException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccountAlreadyRegisteredException) GoString() string { - return s.String() -} - -func newErrorAccountAlreadyRegisteredException(v protocol.ResponseMetadata) error { - return &AccountAlreadyRegisteredException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccountAlreadyRegisteredException) Code() string { - return "AccountAlreadyRegisteredException" -} - -// Message returns the exception's message. -func (s *AccountAlreadyRegisteredException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccountAlreadyRegisteredException) OrigErr() error { - return nil -} - -func (s *AccountAlreadyRegisteredException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccountAlreadyRegisteredException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccountAlreadyRegisteredException) RequestID() string { - return s.RespMetadata.RequestID -} - -// We can't find an Amazon Web Services account with the AccountId that you -// specified, or the account whose credentials you used to make this request -// isn't a member of an organization. -type AccountNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccountNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccountNotFoundException) GoString() string { - return s.String() -} - -func newErrorAccountNotFoundException(v protocol.ResponseMetadata) error { - return &AccountNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccountNotFoundException) Code() string { - return "AccountNotFoundException" -} - -// Message returns the exception's message. -func (s *AccountNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccountNotFoundException) OrigErr() error { - return nil -} - -func (s *AccountNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccountNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccountNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The specified account is not a delegated administrator for this Amazon Web -// Services service. -type AccountNotRegisteredException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccountNotRegisteredException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccountNotRegisteredException) GoString() string { - return s.String() -} - -func newErrorAccountNotRegisteredException(v protocol.ResponseMetadata) error { - return &AccountNotRegisteredException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccountNotRegisteredException) Code() string { - return "AccountNotRegisteredException" -} - -// Message returns the exception's message. -func (s *AccountNotRegisteredException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccountNotRegisteredException) OrigErr() error { - return nil -} - -func (s *AccountNotRegisteredException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccountNotRegisteredException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccountNotRegisteredException) RequestID() string { - return s.RespMetadata.RequestID -} - -// You can't invite an existing account to your organization until you verify -// that you own the email address associated with the management account. For -// more information, see Email Address Verification (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_create.html#about-email-verification) -// in the Organizations User Guide. -type AccountOwnerNotVerifiedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccountOwnerNotVerifiedException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccountOwnerNotVerifiedException) GoString() string { - return s.String() -} - -func newErrorAccountOwnerNotVerifiedException(v protocol.ResponseMetadata) error { - return &AccountOwnerNotVerifiedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AccountOwnerNotVerifiedException) Code() string { - return "AccountOwnerNotVerifiedException" -} - -// Message returns the exception's message. -func (s *AccountOwnerNotVerifiedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AccountOwnerNotVerifiedException) OrigErr() error { - return nil -} - -func (s *AccountOwnerNotVerifiedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AccountOwnerNotVerifiedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AccountOwnerNotVerifiedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This account is already a member of an organization. An account can belong -// to only one organization at a time. -type AlreadyInOrganizationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AlreadyInOrganizationException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AlreadyInOrganizationException) GoString() string { - return s.String() -} - -func newErrorAlreadyInOrganizationException(v protocol.ResponseMetadata) error { - return &AlreadyInOrganizationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *AlreadyInOrganizationException) Code() string { - return "AlreadyInOrganizationException" -} - -// Message returns the exception's message. -func (s *AlreadyInOrganizationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *AlreadyInOrganizationException) OrigErr() error { - return nil -} - -func (s *AlreadyInOrganizationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *AlreadyInOrganizationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *AlreadyInOrganizationException) RequestID() string { - return s.RespMetadata.RequestID -} - -type AttachPolicyInput struct { - _ struct{} `type:"structure"` - - // The unique identifier (ID) of the policy that you want to attach to the target. - // You can get the ID for the policy by calling the ListPolicies operation. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a policy ID string - // requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, - // or the underscore character (_). - // - // PolicyId is a required field - PolicyId *string `type:"string" required:"true"` - - // The unique identifier (ID) of the root, OU, or account that you want to attach - // the policy to. You can get the ID by calling the ListRoots, ListOrganizationalUnitsForParent, - // or ListAccounts operations. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a target ID string - // requires one of the following: - // - // * Root - A string that begins with "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // * Account - A string that consists of exactly 12 digits. - // - // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lowercase letters or digits (the ID of the root that the - // OU is in). This string is followed by a second "-" dash and from 8 to - // 32 additional lowercase letters or digits. - // - // TargetId is a required field - TargetId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AttachPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AttachPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AttachPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AttachPolicyInput"} - if s.PolicyId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyId")) - } - if s.TargetId == nil { - invalidParams.Add(request.NewErrParamRequired("TargetId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyId sets the PolicyId field's value. -func (s *AttachPolicyInput) SetPolicyId(v string) *AttachPolicyInput { - s.PolicyId = &v - return s -} - -// SetTargetId sets the TargetId field's value. -func (s *AttachPolicyInput) SetTargetId(v string) *AttachPolicyInput { - s.TargetId = &v - return s -} - -type AttachPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AttachPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AttachPolicyOutput) GoString() string { - return s.String() -} - -type CancelHandshakeInput struct { - _ struct{} `type:"structure"` - - // The unique identifier (ID) of the handshake that you want to cancel. You - // can get the ID from the ListHandshakesForOrganization operation. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for handshake ID string - // requires "h-" followed by from 8 to 32 lowercase letters or digits. - // - // HandshakeId is a required field - HandshakeId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CancelHandshakeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CancelHandshakeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CancelHandshakeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CancelHandshakeInput"} - if s.HandshakeId == nil { - invalidParams.Add(request.NewErrParamRequired("HandshakeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHandshakeId sets the HandshakeId field's value. -func (s *CancelHandshakeInput) SetHandshakeId(v string) *CancelHandshakeInput { - s.HandshakeId = &v - return s -} - -type CancelHandshakeOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains details about the handshake that you canceled. - Handshake *Handshake `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CancelHandshakeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CancelHandshakeOutput) GoString() string { - return s.String() -} - -// SetHandshake sets the Handshake field's value. -func (s *CancelHandshakeOutput) SetHandshake(v *Handshake) *CancelHandshakeOutput { - s.Handshake = v - return s -} - -// Contains a list of child entities, either OUs or accounts. -type Child struct { - _ struct{} `type:"structure"` - - // The unique identifier (ID) of this child entity. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a child ID string - // requires one of the following: - // - // * Account - A string that consists of exactly 12 digits. - // - // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lowercase letters or digits (the ID of the root that contains - // the OU). This string is followed by a second "-" dash and from 8 to 32 - // additional lowercase letters or digits. - Id *string `type:"string"` - - // The type of this child entity. - Type *string `type:"string" enum:"ChildType"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Child) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Child) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *Child) SetId(v string) *Child { - s.Id = &v - return s -} - -// SetType sets the Type field's value. -func (s *Child) SetType(v string) *Child { - s.Type = &v - return s -} - -// We can't find an organizational unit (OU) or Amazon Web Services account -// with the ChildId that you specified. -type ChildNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ChildNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ChildNotFoundException) GoString() string { - return s.String() -} - -func newErrorChildNotFoundException(v protocol.ResponseMetadata) error { - return &ChildNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ChildNotFoundException) Code() string { - return "ChildNotFoundException" -} - -// Message returns the exception's message. -func (s *ChildNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ChildNotFoundException) OrigErr() error { - return nil -} - -func (s *ChildNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ChildNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ChildNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CloseAccountInput struct { - _ struct{} `type:"structure"` - - // Retrieves the Amazon Web Services account Id for the current CloseAccount - // API request. - // - // AccountId is a required field - AccountId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CloseAccountInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CloseAccountInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CloseAccountInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CloseAccountInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *CloseAccountInput) SetAccountId(v string) *CloseAccountInput { - s.AccountId = &v - return s -} - -type CloseAccountOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CloseAccountOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CloseAccountOutput) GoString() string { - return s.String() -} - -// The target of the operation is currently being modified by a different request. -// Try again later. -type ConcurrentModificationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ConcurrentModificationException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ConcurrentModificationException) GoString() string { - return s.String() -} - -func newErrorConcurrentModificationException(v protocol.ResponseMetadata) error { - return &ConcurrentModificationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConcurrentModificationException) Code() string { - return "ConcurrentModificationException" -} - -// Message returns the exception's message. -func (s *ConcurrentModificationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConcurrentModificationException) OrigErr() error { - return nil -} - -func (s *ConcurrentModificationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConcurrentModificationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConcurrentModificationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The request failed because it conflicts with the current state of the specified -// resource. -type ConflictException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ConflictException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ConflictException) GoString() string { - return s.String() -} - -func newErrorConflictException(v protocol.ResponseMetadata) error { - return &ConflictException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConflictException) Code() string { - return "ConflictException" -} - -// Message returns the exception's message. -func (s *ConflictException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConflictException) OrigErr() error { - return nil -} - -func (s *ConflictException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConflictException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConflictException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Performing this operation violates a minimum or maximum value limit. For -// example, attempting to remove the last service control policy (SCP) from -// an OU or root, inviting or creating too many accounts to the organization, -// or attaching too many policies to an account, OU, or root. This exception -// includes a reason that contains additional information about the violated -// limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management -// account from the organization. You can't remove the management account. -// Instead, after you remove all member accounts, delete the organization -// itself. -// -// - ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove -// an account from the organization that doesn't yet have enough information -// to exist as a standalone account. This account requires you to first complete -// phone verification. Follow the steps at Removing a member account from -// your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) -// in the Organizations User Guide. -// -// - ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can create in one day. -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. If you need more accounts, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) -// to request an increase in your limit. Or the number of invitations that -// you tried to send would cause you to exceed the limit of accounts in your -// organization. Send fewer invitations or contact Amazon Web Services Support -// to request an increase in the number of accounts. Deleted and closed accounts -// still count toward your limit. If you get this exception when running -// a command immediately after creating the organization, wait one hour and -// try again. After an hour, if the command continues to fail with this error, -// contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). -// -// - CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to -// register the management account of the organization as a delegated administrator -// for an Amazon Web Services service integrated with Organizations. You -// can designate only a member account as a delegated administrator. -// -// - CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management -// account. To close the management account for the organization, you must -// first either remove or close all member accounts in the organization. -// Follow standard account closure process using root credentials.​ -// -// - CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove -// an account that is registered as a delegated administrator for a service -// integrated with your organization. To complete this operation, you must -// first deregister this account as a delegated administrator. -// -// - CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota -// for the past 30 days. -// -// - CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number -// of accounts that you can close at a time. ​ -// -// - CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an -// organization in the specified region, you must enable all features mode. -// -// - DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register -// an Amazon Web Services account as a delegated administrator for an Amazon -// Web Services service that already has a delegated administrator. To complete -// this operation, you must first deregister any existing delegated administrators -// for this service. -// -// - EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only -// valid for a limited period of time. You must resubmit the request and -// generate a new verfication code. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no -// supported payment method is associated with the account. Amazon Web Services -// does not support cards issued by financial institutions in Russia or Belarus. -// For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). -// -// - MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account -// in this organization, you first must migrate the organization's management -// account to the marketplace that corresponds to the management account's -// address. For example, accounts with India addresses must be associated -// with the AISPL marketplace. All accounts in an organization must be associated -// with the same marketplace. -// -// - MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon -// Web Services /> Regions in China. To create an organization, the master -// must have a valid business license. For more information, contact customer -// support. -// -// - MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you -// must first provide a valid contact address and phone number for the management -// account. Then try the operation again. -// -// - MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the -// management account must have an associated account in the Amazon Web Services -// GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) -// in the Amazon Web Services GovCloud User Guide. -// -// - MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization -// with this management account, you first must associate a valid payment -// instrument, such as a credit card, with the account. Follow the steps -// at To leave an organization when all required account information has -// not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted -// to register more delegated administrators than allowed for the service -// principal. -// -// - MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the -// number of policies of a certain type that can be attached to an entity -// at one time. -// -// - MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed -// on this resource. -// -// - MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation -// with this member account, you first must associate a valid payment instrument, -// such as a credit card, with the account. Follow the steps at To leave -// an organization when all required account information has not yet been -// provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) -// in the Organizations User Guide. -// -// - MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a -// policy from an entity that would cause the entity to have fewer than the -// minimum number of policies of a certain type required. -// -// - ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation -// that requires the organization to be configured to support all features. -// An organization that supports only consolidated billing features can't -// perform this operation. -// -// - OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is -// too many levels deep. -// -// - OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs -// that you can have in an organization. -// -// - POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that -// is larger than the maximum size. -// -// - POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of -// policies that you can have in an organization. -// -// - SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator -// before you enabled service access. Call the EnableAWSServiceAccess API -// first. -// -// - TAG_POLICY_VIOLATION: You attempted to create or update a resource with -// tags that are not compliant with the tag policy requirements for this -// account. -// -// - WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, -// there is a waiting period before you can remove it from the organization. -// If you get an error that indicates that a wait period is required, try -// again in a few days. -type ConstraintViolationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - Reason *string `type:"string" enum:"ConstraintViolationExceptionReason"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ConstraintViolationException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ConstraintViolationException) GoString() string { - return s.String() -} - -func newErrorConstraintViolationException(v protocol.ResponseMetadata) error { - return &ConstraintViolationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConstraintViolationException) Code() string { - return "ConstraintViolationException" -} - -// Message returns the exception's message. -func (s *ConstraintViolationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConstraintViolationException) OrigErr() error { - return nil -} - -func (s *ConstraintViolationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConstraintViolationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConstraintViolationException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateAccountInput struct { - _ struct{} `type:"structure"` - - // The friendly name of the member account. - // - // AccountName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAccountInput's - // String and GoString methods. - // - // AccountName is a required field - AccountName *string `min:"1" type:"string" required:"true" sensitive:"true"` - - // The email address of the owner to assign to the new member account. This - // email address must not already be associated with another Amazon Web Services - // account. You must use a valid email address to complete account creation. - // - // The rules for a valid email address: - // - // * The address must be a minimum of 6 and a maximum of 64 characters long. - // - // * All characters must be 7-bit ASCII characters. - // - // * There must be one and only one @ symbol, which separates the local name - // from the domain name. - // - // * The local name can't contain any of the following characters: whitespace, - // " ' ( ) < > [ ] : ; , \ | % & - // - // * The local name can't begin with a dot (.) - // - // * The domain name can consist of only the characters [a-z],[A-Z],[0-9], - // hyphen (-), or dot (.) - // - // * The domain name can't begin or end with a hyphen (-) or dot (.) - // - // * The domain name must contain at least one dot - // - // You can't access the root user of the account or remove an account that was - // created with an invalid email address. - // - // Email is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAccountInput's - // String and GoString methods. - // - // Email is a required field - Email *string `min:"6" type:"string" required:"true" sensitive:"true"` - - // If set to ALLOW, the new account enables IAM users to access account billing - // information if they have the required permissions. If set to DENY, only the - // root user of the new account can access account billing information. For - // more information, see Activating Access to the Billing and Cost Management - // Console (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate) - // in the Amazon Web Services Billing and Cost Management User Guide. - // - // If you don't specify this parameter, the value defaults to ALLOW, and IAM - // users and roles with the required permissions can access billing information - // for the new account. - IamUserAccessToBilling *string `type:"string" enum:"IAMUserAccessToBilling"` - - // The name of an IAM role that Organizations automatically preconfigures in - // the new member account. This role trusts the management account, allowing - // users in the management account to assume the role, as permitted by the management - // account administrator. The role has administrator permissions in the new - // member account. - // - // If you don't specify this parameter, the role name defaults to OrganizationAccountAccessRole. - // - // For more information about how to use this role to access the member account, - // see the following links: - // - // * Accessing and Administering the Member Accounts in Your Organization - // (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html#orgs_manage_accounts_create-cross-account-role) - // in the Organizations User Guide - // - // * Steps 2 and 3 in Tutorial: Delegate Access Across Amazon Web Services - // accounts Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html) - // in the IAM User Guide - // - // The regex pattern (http://wikipedia.org/wiki/regex) that is used to validate - // this parameter. The pattern can include uppercase letters, lowercase letters, - // digits with no spaces, and any of the following characters: =,.@- - RoleName *string `type:"string"` - - // A list of tags that you want to attach to the newly created account. For - // each tag in the list, you must specify both a tag key and a value. You can - // set the value to an empty string, but you can't set it to null. For more - // information about tagging, see Tagging Organizations resources (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html) - // in the Organizations User Guide. - // - // If any one of the tags is invalid or if you exceed the maximum allowed number - // of tags for an account, then the entire request fails and the account is - // not created. - Tags []*Tag `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateAccountInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateAccountInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateAccountInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateAccountInput"} - if s.AccountName == nil { - invalidParams.Add(request.NewErrParamRequired("AccountName")) - } - if s.AccountName != nil && len(*s.AccountName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AccountName", 1)) - } - if s.Email == nil { - invalidParams.Add(request.NewErrParamRequired("Email")) - } - if s.Email != nil && len(*s.Email) < 6 { - invalidParams.Add(request.NewErrParamMinLen("Email", 6)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountName sets the AccountName field's value. -func (s *CreateAccountInput) SetAccountName(v string) *CreateAccountInput { - s.AccountName = &v - return s -} - -// SetEmail sets the Email field's value. -func (s *CreateAccountInput) SetEmail(v string) *CreateAccountInput { - s.Email = &v - return s -} - -// SetIamUserAccessToBilling sets the IamUserAccessToBilling field's value. -func (s *CreateAccountInput) SetIamUserAccessToBilling(v string) *CreateAccountInput { - s.IamUserAccessToBilling = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *CreateAccountInput) SetRoleName(v string) *CreateAccountInput { - s.RoleName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateAccountInput) SetTags(v []*Tag) *CreateAccountInput { - s.Tags = v - return s -} - -type CreateAccountOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains details about the request to create an account. - // This response structure might not be fully populated when you first receive - // it because account creation is an asynchronous process. You can pass the - // returned CreateAccountStatus ID as a parameter to DescribeCreateAccountStatus - // to get status about the progress of the request at later times. You can also - // check the CloudTrail log for the CreateAccountResult event. For more information, - // see Monitoring the Activity in Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_monitoring.html) - // in the Organizations User Guide. - CreateAccountStatus *CreateAccountStatus `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateAccountOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateAccountOutput) GoString() string { - return s.String() -} - -// SetCreateAccountStatus sets the CreateAccountStatus field's value. -func (s *CreateAccountOutput) SetCreateAccountStatus(v *CreateAccountStatus) *CreateAccountOutput { - s.CreateAccountStatus = v - return s -} - -// Contains the status about a CreateAccount or CreateGovCloudAccount request -// to create an Amazon Web Services account or an Amazon Web Services GovCloud -// (US) account in an organization. -type CreateAccountStatus struct { - _ struct{} `type:"structure"` - - // If the account was created successfully, the unique identifier (ID) of the - // new account. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for an account ID string - // requires exactly 12 digits. - AccountId *string `type:"string"` - - // The account name given to the account when it was created. - // - // AccountName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateAccountStatus's - // String and GoString methods. - AccountName *string `min:"1" type:"string" sensitive:"true"` - - // The date and time that the account was created and the request completed. - CompletedTimestamp *time.Time `type:"timestamp"` - - // If the request failed, a description of the reason for the failure. - // - // * ACCOUNT_LIMIT_EXCEEDED: The account couldn't be created because you - // reached the limit on the number of accounts in your organization. - // - // * CONCURRENT_ACCOUNT_MODIFICATION: You already submitted a request with - // the same information. - // - // * EMAIL_ALREADY_EXISTS: The account could not be created because another - // Amazon Web Services account with that email address already exists. - // - // * FAILED_BUSINESS_VALIDATION: The Amazon Web Services account that owns - // your organization failed to receive business license validation. - // - // * GOVCLOUD_ACCOUNT_ALREADY_EXISTS: The account in the Amazon Web Services - // GovCloud (US) Region could not be created because this Region already - // includes an account with that email address. - // - // * IDENTITY_INVALID_BUSINESS_VALIDATION: The Amazon Web Services account - // that owns your organization can't complete business license validation - // because it doesn't have valid identity data. - // - // * INVALID_ADDRESS: The account could not be created because the address - // you provided is not valid. - // - // * INVALID_EMAIL: The account could not be created because the email address - // you provided is not valid. - // - // * INVALID_PAYMENT_INSTRUMENT: The Amazon Web Services account that owns - // your organization does not have a supported payment method associated - // with the account. Amazon Web Services does not support cards issued by - // financial institutions in Russia or Belarus. For more information, see - // Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). - // - // * INTERNAL_FAILURE: The account could not be created because of an internal - // failure. Try again later. If the problem persists, contact Amazon Web - // Services Customer Support. - // - // * MISSING_BUSINESS_VALIDATION: The Amazon Web Services account that owns - // your organization has not received Business Validation. - // - // * MISSING_PAYMENT_INSTRUMENT: You must configure the management account - // with a valid payment method, such as a credit card. - // - // * PENDING_BUSINESS_VALIDATION: The Amazon Web Services account that owns - // your organization is still in the process of completing business license - // validation. - // - // * UNKNOWN_BUSINESS_VALIDATION: The Amazon Web Services account that owns - // your organization has an unknown issue with business license validation. - FailureReason *string `type:"string" enum:"CreateAccountFailureReason"` - - // If the account was created successfully, the unique identifier (ID) of the - // new account in the Amazon Web Services GovCloud (US) Region. - GovCloudAccountId *string `type:"string"` - - // The unique identifier (ID) that references this request. You get this value - // from the response of the initial CreateAccount request to create the account. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a create account - // request ID string requires "car-" followed by from 8 to 32 lowercase letters - // or digits. - Id *string `type:"string"` - - // The date and time that the request was made for the account creation. - RequestedTimestamp *time.Time `type:"timestamp"` - - // The status of the asynchronous request to create an Amazon Web Services account. - State *string `type:"string" enum:"CreateAccountState"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateAccountStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateAccountStatus) GoString() string { - return s.String() -} - -// SetAccountId sets the AccountId field's value. -func (s *CreateAccountStatus) SetAccountId(v string) *CreateAccountStatus { - s.AccountId = &v - return s -} - -// SetAccountName sets the AccountName field's value. -func (s *CreateAccountStatus) SetAccountName(v string) *CreateAccountStatus { - s.AccountName = &v - return s -} - -// SetCompletedTimestamp sets the CompletedTimestamp field's value. -func (s *CreateAccountStatus) SetCompletedTimestamp(v time.Time) *CreateAccountStatus { - s.CompletedTimestamp = &v - return s -} - -// SetFailureReason sets the FailureReason field's value. -func (s *CreateAccountStatus) SetFailureReason(v string) *CreateAccountStatus { - s.FailureReason = &v - return s -} - -// SetGovCloudAccountId sets the GovCloudAccountId field's value. -func (s *CreateAccountStatus) SetGovCloudAccountId(v string) *CreateAccountStatus { - s.GovCloudAccountId = &v - return s -} - -// SetId sets the Id field's value. -func (s *CreateAccountStatus) SetId(v string) *CreateAccountStatus { - s.Id = &v - return s -} - -// SetRequestedTimestamp sets the RequestedTimestamp field's value. -func (s *CreateAccountStatus) SetRequestedTimestamp(v time.Time) *CreateAccountStatus { - s.RequestedTimestamp = &v - return s -} - -// SetState sets the State field's value. -func (s *CreateAccountStatus) SetState(v string) *CreateAccountStatus { - s.State = &v - return s -} - -// We can't find an create account request with the CreateAccountRequestId that -// you specified. -type CreateAccountStatusNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateAccountStatusNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateAccountStatusNotFoundException) GoString() string { - return s.String() -} - -func newErrorCreateAccountStatusNotFoundException(v protocol.ResponseMetadata) error { - return &CreateAccountStatusNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *CreateAccountStatusNotFoundException) Code() string { - return "CreateAccountStatusNotFoundException" -} - -// Message returns the exception's message. -func (s *CreateAccountStatusNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *CreateAccountStatusNotFoundException) OrigErr() error { - return nil -} - -func (s *CreateAccountStatusNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *CreateAccountStatusNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *CreateAccountStatusNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -type CreateGovCloudAccountInput struct { - _ struct{} `type:"structure"` - - // The friendly name of the member account. - // - // The account name can consist of only the characters [a-z],[A-Z],[0-9], hyphen - // (-), or dot (.) You can't separate characters with a dash (–). - // - // AccountName is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateGovCloudAccountInput's - // String and GoString methods. - // - // AccountName is a required field - AccountName *string `min:"1" type:"string" required:"true" sensitive:"true"` - - // Specifies the email address of the owner to assign to the new member account - // in the commercial Region. This email address must not already be associated - // with another Amazon Web Services account. You must use a valid email address - // to complete account creation. - // - // The rules for a valid email address: - // - // * The address must be a minimum of 6 and a maximum of 64 characters long. - // - // * All characters must be 7-bit ASCII characters. - // - // * There must be one and only one @ symbol, which separates the local name - // from the domain name. - // - // * The local name can't contain any of the following characters: whitespace, - // " ' ( ) < > [ ] : ; , \ | % & - // - // * The local name can't begin with a dot (.) - // - // * The domain name can consist of only the characters [a-z],[A-Z],[0-9], - // hyphen (-), or dot (.) - // - // * The domain name can't begin or end with a hyphen (-) or dot (.) - // - // * The domain name must contain at least one dot - // - // You can't access the root user of the account or remove an account that was - // created with an invalid email address. Like all request parameters for CreateGovCloudAccount, - // the request for the email address for the Amazon Web Services GovCloud (US) - // account originates from the commercial Region, not from the Amazon Web Services - // GovCloud (US) Region. - // - // Email is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateGovCloudAccountInput's - // String and GoString methods. - // - // Email is a required field - Email *string `min:"6" type:"string" required:"true" sensitive:"true"` - - // If set to ALLOW, the new linked account in the commercial Region enables - // IAM users to access account billing information if they have the required - // permissions. If set to DENY, only the root user of the new account can access - // account billing information. For more information, see Activating Access - // to the Billing and Cost Management Console (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/grantaccess.html#ControllingAccessWebsite-Activate) - // in the Amazon Web Services Billing and Cost Management User Guide. - // - // If you don't specify this parameter, the value defaults to ALLOW, and IAM - // users and roles with the required permissions can access billing information - // for the new account. - IamUserAccessToBilling *string `type:"string" enum:"IAMUserAccessToBilling"` - - // (Optional) - // - // The name of an IAM role that Organizations automatically preconfigures in - // the new member accounts in both the Amazon Web Services GovCloud (US) Region - // and in the commercial Region. This role trusts the management account, allowing - // users in the management account to assume the role, as permitted by the management - // account administrator. The role has administrator permissions in the new - // member account. - // - // If you don't specify this parameter, the role name defaults to OrganizationAccountAccessRole. - // - // For more information about how to use this role to access the member account, - // see Accessing and Administering the Member Accounts in Your Organization - // (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_access.html#orgs_manage_accounts_create-cross-account-role) - // in the Organizations User Guide and steps 2 and 3 in Tutorial: Delegate Access - // Across Amazon Web Services accounts Using IAM Roles (https://docs.aws.amazon.com/IAM/latest/UserGuide/tutorial_cross-account-with-roles.html) - // in the IAM User Guide. - // - // The regex pattern (http://wikipedia.org/wiki/regex) that is used to validate - // this parameter. The pattern can include uppercase letters, lowercase letters, - // digits with no spaces, and any of the following characters: =,.@- - RoleName *string `type:"string"` - - // A list of tags that you want to attach to the newly created account. These - // tags are attached to the commercial account associated with the GovCloud - // account, and not to the GovCloud account itself. To add tags to the actual - // GovCloud account, call the TagResource operation in the GovCloud region after - // the new GovCloud account exists. - // - // For each tag in the list, you must specify both a tag key and a value. You - // can set the value to an empty string, but you can't set it to null. For more - // information about tagging, see Tagging Organizations resources (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html) - // in the Organizations User Guide. - // - // If any one of the tags is invalid or if you exceed the maximum allowed number - // of tags for an account, then the entire request fails and the account is - // not created. - Tags []*Tag `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateGovCloudAccountInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateGovCloudAccountInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateGovCloudAccountInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateGovCloudAccountInput"} - if s.AccountName == nil { - invalidParams.Add(request.NewErrParamRequired("AccountName")) - } - if s.AccountName != nil && len(*s.AccountName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("AccountName", 1)) - } - if s.Email == nil { - invalidParams.Add(request.NewErrParamRequired("Email")) - } - if s.Email != nil && len(*s.Email) < 6 { - invalidParams.Add(request.NewErrParamMinLen("Email", 6)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountName sets the AccountName field's value. -func (s *CreateGovCloudAccountInput) SetAccountName(v string) *CreateGovCloudAccountInput { - s.AccountName = &v - return s -} - -// SetEmail sets the Email field's value. -func (s *CreateGovCloudAccountInput) SetEmail(v string) *CreateGovCloudAccountInput { - s.Email = &v - return s -} - -// SetIamUserAccessToBilling sets the IamUserAccessToBilling field's value. -func (s *CreateGovCloudAccountInput) SetIamUserAccessToBilling(v string) *CreateGovCloudAccountInput { - s.IamUserAccessToBilling = &v - return s -} - -// SetRoleName sets the RoleName field's value. -func (s *CreateGovCloudAccountInput) SetRoleName(v string) *CreateGovCloudAccountInput { - s.RoleName = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateGovCloudAccountInput) SetTags(v []*Tag) *CreateGovCloudAccountInput { - s.Tags = v - return s -} - -type CreateGovCloudAccountOutput struct { - _ struct{} `type:"structure"` - - // Contains the status about a CreateAccount or CreateGovCloudAccount request - // to create an Amazon Web Services account or an Amazon Web Services GovCloud - // (US) account in an organization. - CreateAccountStatus *CreateAccountStatus `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateGovCloudAccountOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateGovCloudAccountOutput) GoString() string { - return s.String() -} - -// SetCreateAccountStatus sets the CreateAccountStatus field's value. -func (s *CreateGovCloudAccountOutput) SetCreateAccountStatus(v *CreateAccountStatus) *CreateGovCloudAccountOutput { - s.CreateAccountStatus = v - return s -} - -type CreateOrganizationInput struct { - _ struct{} `type:"structure"` - - // Specifies the feature set supported by the new organization. Each feature - // set supports different levels of functionality. - // - // * CONSOLIDATED_BILLING: All member accounts have their bills consolidated - // to and paid by the management account. For more information, see Consolidated - // billing (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#feature-set-cb-only) - // in the Organizations User Guide. The consolidated billing feature subset - // isn't available for organizations in the Amazon Web Services GovCloud - // (US) Region. - // - // * ALL: In addition to all the features supported by the consolidated billing - // feature set, the management account can also apply any policy type to - // any member account in the organization. For more information, see All - // features (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_getting-started_concepts.html#feature-set-all) - // in the Organizations User Guide. - FeatureSet *string `type:"string" enum:"OrganizationFeatureSet"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateOrganizationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateOrganizationInput) GoString() string { - return s.String() -} - -// SetFeatureSet sets the FeatureSet field's value. -func (s *CreateOrganizationInput) SetFeatureSet(v string) *CreateOrganizationInput { - s.FeatureSet = &v - return s -} - -type CreateOrganizationOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains details about the newly created organization. - Organization *Organization `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateOrganizationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateOrganizationOutput) GoString() string { - return s.String() -} - -// SetOrganization sets the Organization field's value. -func (s *CreateOrganizationOutput) SetOrganization(v *Organization) *CreateOrganizationOutput { - s.Organization = v - return s -} - -type CreateOrganizationalUnitInput struct { - _ struct{} `type:"structure"` - - // The friendly name to assign to the new OU. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // The unique identifier (ID) of the parent root or OU that you want to create - // the new OU in. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a parent ID string - // requires one of the following: - // - // * Root - A string that begins with "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lowercase letters or digits (the ID of the root that the - // OU is in). This string is followed by a second "-" dash and from 8 to - // 32 additional lowercase letters or digits. - // - // ParentId is a required field - ParentId *string `type:"string" required:"true"` - - // A list of tags that you want to attach to the newly created OU. For each - // tag in the list, you must specify both a tag key and a value. You can set - // the value to an empty string, but you can't set it to null. For more information - // about tagging, see Tagging Organizations resources (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html) - // in the Organizations User Guide. - // - // If any one of the tags is invalid or if you exceed the allowed number of - // tags for an OU, then the entire request fails and the OU is not created. - Tags []*Tag `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateOrganizationalUnitInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateOrganizationalUnitInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateOrganizationalUnitInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateOrganizationalUnitInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.ParentId == nil { - invalidParams.Add(request.NewErrParamRequired("ParentId")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *CreateOrganizationalUnitInput) SetName(v string) *CreateOrganizationalUnitInput { - s.Name = &v - return s -} - -// SetParentId sets the ParentId field's value. -func (s *CreateOrganizationalUnitInput) SetParentId(v string) *CreateOrganizationalUnitInput { - s.ParentId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateOrganizationalUnitInput) SetTags(v []*Tag) *CreateOrganizationalUnitInput { - s.Tags = v - return s -} - -type CreateOrganizationalUnitOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains details about the newly created OU. - OrganizationalUnit *OrganizationalUnit `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateOrganizationalUnitOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateOrganizationalUnitOutput) GoString() string { - return s.String() -} - -// SetOrganizationalUnit sets the OrganizationalUnit field's value. -func (s *CreateOrganizationalUnitOutput) SetOrganizationalUnit(v *OrganizationalUnit) *CreateOrganizationalUnitOutput { - s.OrganizationalUnit = v - return s -} - -type CreatePolicyInput struct { - _ struct{} `type:"structure"` - - // The policy text content to add to the new policy. The text that you supply - // must adhere to the rules of the policy type you specify in the Type parameter. - // - // Content is a required field - Content *string `min:"1" type:"string" required:"true"` - - // An optional description to assign to the policy. - // - // Description is a required field - Description *string `type:"string" required:"true"` - - // The friendly name to assign to the policy. - // - // The regex pattern (http://wikipedia.org/wiki/regex) that is used to validate - // this parameter is a string of any of the characters in the ASCII character - // range. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // A list of tags that you want to attach to the newly created policy. For each - // tag in the list, you must specify both a tag key and a value. You can set - // the value to an empty string, but you can't set it to null. For more information - // about tagging, see Tagging Organizations resources (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html) - // in the Organizations User Guide. - // - // If any one of the tags is invalid or if you exceed the allowed number of - // tags for a policy, then the entire request fails and the policy is not created. - Tags []*Tag `type:"list"` - - // The type of policy to create. You can specify one of the following values: - // - // * AISERVICES_OPT_OUT_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html) - // - // * BACKUP_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html) - // - // * SERVICE_CONTROL_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html) - // - // * TAG_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"PolicyType"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreatePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreatePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreatePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreatePolicyInput"} - if s.Content == nil { - invalidParams.Add(request.NewErrParamRequired("Content")) - } - if s.Content != nil && len(*s.Content) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Content", 1)) - } - if s.Description == nil { - invalidParams.Add(request.NewErrParamRequired("Description")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContent sets the Content field's value. -func (s *CreatePolicyInput) SetContent(v string) *CreatePolicyInput { - s.Content = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreatePolicyInput) SetDescription(v string) *CreatePolicyInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreatePolicyInput) SetName(v string) *CreatePolicyInput { - s.Name = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreatePolicyInput) SetTags(v []*Tag) *CreatePolicyInput { - s.Tags = v - return s -} - -// SetType sets the Type field's value. -func (s *CreatePolicyInput) SetType(v string) *CreatePolicyInput { - s.Type = &v - return s -} - -type CreatePolicyOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains details about the newly created policy. - Policy *Policy `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreatePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreatePolicyOutput) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *CreatePolicyOutput) SetPolicy(v *Policy) *CreatePolicyOutput { - s.Policy = v - return s -} - -type DeclineHandshakeInput struct { - _ struct{} `type:"structure"` - - // The unique identifier (ID) of the handshake that you want to decline. You - // can get the ID from the ListHandshakesForAccount operation. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for handshake ID string - // requires "h-" followed by from 8 to 32 lowercase letters or digits. - // - // HandshakeId is a required field - HandshakeId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeclineHandshakeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeclineHandshakeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeclineHandshakeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeclineHandshakeInput"} - if s.HandshakeId == nil { - invalidParams.Add(request.NewErrParamRequired("HandshakeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHandshakeId sets the HandshakeId field's value. -func (s *DeclineHandshakeInput) SetHandshakeId(v string) *DeclineHandshakeInput { - s.HandshakeId = &v - return s -} - -type DeclineHandshakeOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains details about the declined handshake. The state - // is updated to show the value DECLINED. - Handshake *Handshake `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeclineHandshakeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeclineHandshakeOutput) GoString() string { - return s.String() -} - -// SetHandshake sets the Handshake field's value. -func (s *DeclineHandshakeOutput) SetHandshake(v *Handshake) *DeclineHandshakeOutput { - s.Handshake = v - return s -} - -// Contains information about the delegated administrator. -type DelegatedAdministrator struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the delegated administrator's account. - Arn *string `type:"string"` - - // The date when the account was made a delegated administrator. - DelegationEnabledDate *time.Time `type:"timestamp"` - - // The email address that is associated with the delegated administrator's Amazon - // Web Services account. - // - // Email is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DelegatedAdministrator's - // String and GoString methods. - Email *string `min:"6" type:"string" sensitive:"true"` - - // The unique identifier (ID) of the delegated administrator's account. - Id *string `type:"string"` - - // The method by which the delegated administrator's account joined the organization. - JoinedMethod *string `type:"string" enum:"AccountJoinedMethod"` - - // The date when the delegated administrator's account became a part of the - // organization. - JoinedTimestamp *time.Time `type:"timestamp"` - - // The friendly name of the delegated administrator's account. - // - // Name is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by DelegatedAdministrator's - // String and GoString methods. - Name *string `min:"1" type:"string" sensitive:"true"` - - // The status of the delegated administrator's account in the organization. - Status *string `type:"string" enum:"AccountStatus"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DelegatedAdministrator) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DelegatedAdministrator) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *DelegatedAdministrator) SetArn(v string) *DelegatedAdministrator { - s.Arn = &v - return s -} - -// SetDelegationEnabledDate sets the DelegationEnabledDate field's value. -func (s *DelegatedAdministrator) SetDelegationEnabledDate(v time.Time) *DelegatedAdministrator { - s.DelegationEnabledDate = &v - return s -} - -// SetEmail sets the Email field's value. -func (s *DelegatedAdministrator) SetEmail(v string) *DelegatedAdministrator { - s.Email = &v - return s -} - -// SetId sets the Id field's value. -func (s *DelegatedAdministrator) SetId(v string) *DelegatedAdministrator { - s.Id = &v - return s -} - -// SetJoinedMethod sets the JoinedMethod field's value. -func (s *DelegatedAdministrator) SetJoinedMethod(v string) *DelegatedAdministrator { - s.JoinedMethod = &v - return s -} - -// SetJoinedTimestamp sets the JoinedTimestamp field's value. -func (s *DelegatedAdministrator) SetJoinedTimestamp(v time.Time) *DelegatedAdministrator { - s.JoinedTimestamp = &v - return s -} - -// SetName sets the Name field's value. -func (s *DelegatedAdministrator) SetName(v string) *DelegatedAdministrator { - s.Name = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DelegatedAdministrator) SetStatus(v string) *DelegatedAdministrator { - s.Status = &v - return s -} - -// Contains information about the Amazon Web Services service for which the -// account is a delegated administrator. -type DelegatedService struct { - _ struct{} `type:"structure"` - - // The date that the account became a delegated administrator for this service. - DelegationEnabledDate *time.Time `type:"timestamp"` - - // The name of an Amazon Web Services service that can request an operation - // for the specified service. This is typically in the form of a URL, such as: - // servicename.amazonaws.com. - ServicePrincipal *string `min:"1" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DelegatedService) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DelegatedService) GoString() string { - return s.String() -} - -// SetDelegationEnabledDate sets the DelegationEnabledDate field's value. -func (s *DelegatedService) SetDelegationEnabledDate(v time.Time) *DelegatedService { - s.DelegationEnabledDate = &v - return s -} - -// SetServicePrincipal sets the ServicePrincipal field's value. -func (s *DelegatedService) SetServicePrincipal(v string) *DelegatedService { - s.ServicePrincipal = &v - return s -} - -type DeleteOrganizationInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteOrganizationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteOrganizationInput) GoString() string { - return s.String() -} - -type DeleteOrganizationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteOrganizationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteOrganizationOutput) GoString() string { - return s.String() -} - -type DeleteOrganizationalUnitInput struct { - _ struct{} `type:"structure"` - - // The unique identifier (ID) of the organizational unit that you want to delete. - // You can get the ID from the ListOrganizationalUnitsForParent operation. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for an organizational - // unit ID string requires "ou-" followed by from 4 to 32 lowercase letters - // or digits (the ID of the root that contains the OU). This string is followed - // by a second "-" dash and from 8 to 32 additional lowercase letters or digits. - // - // OrganizationalUnitId is a required field - OrganizationalUnitId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteOrganizationalUnitInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteOrganizationalUnitInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteOrganizationalUnitInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteOrganizationalUnitInput"} - if s.OrganizationalUnitId == nil { - invalidParams.Add(request.NewErrParamRequired("OrganizationalUnitId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOrganizationalUnitId sets the OrganizationalUnitId field's value. -func (s *DeleteOrganizationalUnitInput) SetOrganizationalUnitId(v string) *DeleteOrganizationalUnitInput { - s.OrganizationalUnitId = &v - return s -} - -type DeleteOrganizationalUnitOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteOrganizationalUnitOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteOrganizationalUnitOutput) GoString() string { - return s.String() -} - -type DeletePolicyInput struct { - _ struct{} `type:"structure"` - - // The unique identifier (ID) of the policy that you want to delete. You can - // get the ID from the ListPolicies or ListPoliciesForTarget operations. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a policy ID string - // requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, - // or the underscore character (_). - // - // PolicyId is a required field - PolicyId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeletePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeletePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePolicyInput"} - if s.PolicyId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyId sets the PolicyId field's value. -func (s *DeletePolicyInput) SetPolicyId(v string) *DeletePolicyInput { - s.PolicyId = &v - return s -} - -type DeletePolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeletePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeletePolicyOutput) GoString() string { - return s.String() -} - -type DeleteResourcePolicyInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteResourcePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteResourcePolicyInput) GoString() string { - return s.String() -} - -type DeleteResourcePolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteResourcePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteResourcePolicyOutput) GoString() string { - return s.String() -} - -type DeregisterDelegatedAdministratorInput struct { - _ struct{} `type:"structure"` - - // The account ID number of the member account in the organization that you - // want to deregister as a delegated administrator. - // - // AccountId is a required field - AccountId *string `type:"string" required:"true"` - - // The service principal name of an Amazon Web Services service for which the - // account is a delegated administrator. - // - // Delegated administrator privileges are revoked for only the specified Amazon - // Web Services service from the member account. If the specified service is - // the only service for which the member account is a delegated administrator, - // the operation also revokes Organizations read action permissions. - // - // ServicePrincipal is a required field - ServicePrincipal *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeregisterDelegatedAdministratorInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeregisterDelegatedAdministratorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeregisterDelegatedAdministratorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeregisterDelegatedAdministratorInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.ServicePrincipal == nil { - invalidParams.Add(request.NewErrParamRequired("ServicePrincipal")) - } - if s.ServicePrincipal != nil && len(*s.ServicePrincipal) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ServicePrincipal", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *DeregisterDelegatedAdministratorInput) SetAccountId(v string) *DeregisterDelegatedAdministratorInput { - s.AccountId = &v - return s -} - -// SetServicePrincipal sets the ServicePrincipal field's value. -func (s *DeregisterDelegatedAdministratorInput) SetServicePrincipal(v string) *DeregisterDelegatedAdministratorInput { - s.ServicePrincipal = &v - return s -} - -type DeregisterDelegatedAdministratorOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeregisterDelegatedAdministratorOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeregisterDelegatedAdministratorOutput) GoString() string { - return s.String() -} - -type DescribeAccountInput struct { - _ struct{} `type:"structure"` - - // The unique identifier (ID) of the Amazon Web Services account that you want - // information about. You can get the ID from the ListAccounts or ListAccountsForParent - // operations. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for an account ID string - // requires exactly 12 digits. - // - // AccountId is a required field - AccountId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeAccountInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeAccountInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeAccountInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeAccountInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *DescribeAccountInput) SetAccountId(v string) *DescribeAccountInput { - s.AccountId = &v - return s -} - -type DescribeAccountOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains information about the requested account. - Account *Account `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeAccountOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeAccountOutput) GoString() string { - return s.String() -} - -// SetAccount sets the Account field's value. -func (s *DescribeAccountOutput) SetAccount(v *Account) *DescribeAccountOutput { - s.Account = v - return s -} - -type DescribeCreateAccountStatusInput struct { - _ struct{} `type:"structure"` - - // Specifies the Id value that uniquely identifies the CreateAccount request. - // You can get the value from the CreateAccountStatus.Id response in an earlier - // CreateAccount request, or from the ListCreateAccountStatus operation. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a create account - // request ID string requires "car-" followed by from 8 to 32 lowercase letters - // or digits. - // - // CreateAccountRequestId is a required field - CreateAccountRequestId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeCreateAccountStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeCreateAccountStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeCreateAccountStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeCreateAccountStatusInput"} - if s.CreateAccountRequestId == nil { - invalidParams.Add(request.NewErrParamRequired("CreateAccountRequestId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCreateAccountRequestId sets the CreateAccountRequestId field's value. -func (s *DescribeCreateAccountStatusInput) SetCreateAccountRequestId(v string) *DescribeCreateAccountStatusInput { - s.CreateAccountRequestId = &v - return s -} - -type DescribeCreateAccountStatusOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains the current status of an account creation request. - CreateAccountStatus *CreateAccountStatus `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeCreateAccountStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeCreateAccountStatusOutput) GoString() string { - return s.String() -} - -// SetCreateAccountStatus sets the CreateAccountStatus field's value. -func (s *DescribeCreateAccountStatusOutput) SetCreateAccountStatus(v *CreateAccountStatus) *DescribeCreateAccountStatusOutput { - s.CreateAccountStatus = v - return s -} - -type DescribeEffectivePolicyInput struct { - _ struct{} `type:"structure"` - - // The type of policy that you want information about. You can specify one of - // the following values: - // - // * AISERVICES_OPT_OUT_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html) - // - // * BACKUP_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html) - // - // * TAG_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) - // - // PolicyType is a required field - PolicyType *string `type:"string" required:"true" enum:"EffectivePolicyType"` - - // When you're signed in as the management account, specify the ID of the account - // that you want details about. Specifying an organization root or organizational - // unit (OU) as the target is not supported. - TargetId *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeEffectivePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeEffectivePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeEffectivePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeEffectivePolicyInput"} - if s.PolicyType == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyType sets the PolicyType field's value. -func (s *DescribeEffectivePolicyInput) SetPolicyType(v string) *DescribeEffectivePolicyInput { - s.PolicyType = &v - return s -} - -// SetTargetId sets the TargetId field's value. -func (s *DescribeEffectivePolicyInput) SetTargetId(v string) *DescribeEffectivePolicyInput { - s.TargetId = &v - return s -} - -type DescribeEffectivePolicyOutput struct { - _ struct{} `type:"structure"` - - // The contents of the effective policy. - EffectivePolicy *EffectivePolicy `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeEffectivePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeEffectivePolicyOutput) GoString() string { - return s.String() -} - -// SetEffectivePolicy sets the EffectivePolicy field's value. -func (s *DescribeEffectivePolicyOutput) SetEffectivePolicy(v *EffectivePolicy) *DescribeEffectivePolicyOutput { - s.EffectivePolicy = v - return s -} - -type DescribeHandshakeInput struct { - _ struct{} `type:"structure"` - - // The unique identifier (ID) of the handshake that you want information about. - // You can get the ID from the original call to InviteAccountToOrganization, - // or from a call to ListHandshakesForAccount or ListHandshakesForOrganization. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for handshake ID string - // requires "h-" followed by from 8 to 32 lowercase letters or digits. - // - // HandshakeId is a required field - HandshakeId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeHandshakeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeHandshakeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeHandshakeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeHandshakeInput"} - if s.HandshakeId == nil { - invalidParams.Add(request.NewErrParamRequired("HandshakeId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHandshakeId sets the HandshakeId field's value. -func (s *DescribeHandshakeInput) SetHandshakeId(v string) *DescribeHandshakeInput { - s.HandshakeId = &v - return s -} - -type DescribeHandshakeOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains information about the specified handshake. - Handshake *Handshake `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeHandshakeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeHandshakeOutput) GoString() string { - return s.String() -} - -// SetHandshake sets the Handshake field's value. -func (s *DescribeHandshakeOutput) SetHandshake(v *Handshake) *DescribeHandshakeOutput { - s.Handshake = v - return s -} - -type DescribeOrganizationInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeOrganizationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeOrganizationInput) GoString() string { - return s.String() -} - -type DescribeOrganizationOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains information about the organization. - // - // The AvailablePolicyTypes part of the response is deprecated, and you shouldn't - // use it in your apps. It doesn't include any policy type supported by Organizations - // other than SCPs. To determine which policy types are enabled in your organization, - // use the ListRoots operation. - Organization *Organization `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeOrganizationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeOrganizationOutput) GoString() string { - return s.String() -} - -// SetOrganization sets the Organization field's value. -func (s *DescribeOrganizationOutput) SetOrganization(v *Organization) *DescribeOrganizationOutput { - s.Organization = v - return s -} - -type DescribeOrganizationalUnitInput struct { - _ struct{} `type:"structure"` - - // The unique identifier (ID) of the organizational unit that you want details - // about. You can get the ID from the ListOrganizationalUnitsForParent operation. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for an organizational - // unit ID string requires "ou-" followed by from 4 to 32 lowercase letters - // or digits (the ID of the root that contains the OU). This string is followed - // by a second "-" dash and from 8 to 32 additional lowercase letters or digits. - // - // OrganizationalUnitId is a required field - OrganizationalUnitId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeOrganizationalUnitInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeOrganizationalUnitInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeOrganizationalUnitInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeOrganizationalUnitInput"} - if s.OrganizationalUnitId == nil { - invalidParams.Add(request.NewErrParamRequired("OrganizationalUnitId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOrganizationalUnitId sets the OrganizationalUnitId field's value. -func (s *DescribeOrganizationalUnitInput) SetOrganizationalUnitId(v string) *DescribeOrganizationalUnitInput { - s.OrganizationalUnitId = &v - return s -} - -type DescribeOrganizationalUnitOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains details about the specified OU. - OrganizationalUnit *OrganizationalUnit `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeOrganizationalUnitOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeOrganizationalUnitOutput) GoString() string { - return s.String() -} - -// SetOrganizationalUnit sets the OrganizationalUnit field's value. -func (s *DescribeOrganizationalUnitOutput) SetOrganizationalUnit(v *OrganizationalUnit) *DescribeOrganizationalUnitOutput { - s.OrganizationalUnit = v - return s -} - -type DescribePolicyInput struct { - _ struct{} `type:"structure"` - - // The unique identifier (ID) of the policy that you want details about. You - // can get the ID from the ListPolicies or ListPoliciesForTarget operations. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a policy ID string - // requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, - // or the underscore character (_). - // - // PolicyId is a required field - PolicyId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribePolicyInput"} - if s.PolicyId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyId sets the PolicyId field's value. -func (s *DescribePolicyInput) SetPolicyId(v string) *DescribePolicyInput { - s.PolicyId = &v - return s -} - -type DescribePolicyOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains details about the specified policy. - Policy *Policy `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribePolicyOutput) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *DescribePolicyOutput) SetPolicy(v *Policy) *DescribePolicyOutput { - s.Policy = v - return s -} - -type DescribeResourcePolicyInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeResourcePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeResourcePolicyInput) GoString() string { - return s.String() -} - -type DescribeResourcePolicyOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains details about the resource policy. - ResourcePolicy *ResourcePolicy `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeResourcePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeResourcePolicyOutput) GoString() string { - return s.String() -} - -// SetResourcePolicy sets the ResourcePolicy field's value. -func (s *DescribeResourcePolicyOutput) SetResourcePolicy(v *ResourcePolicy) *DescribeResourcePolicyOutput { - s.ResourcePolicy = v - return s -} - -// We can't find the destination container (a root or OU) with the ParentId -// that you specified. -type DestinationParentNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DestinationParentNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DestinationParentNotFoundException) GoString() string { - return s.String() -} - -func newErrorDestinationParentNotFoundException(v protocol.ResponseMetadata) error { - return &DestinationParentNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *DestinationParentNotFoundException) Code() string { - return "DestinationParentNotFoundException" -} - -// Message returns the exception's message. -func (s *DestinationParentNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *DestinationParentNotFoundException) OrigErr() error { - return nil -} - -func (s *DestinationParentNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *DestinationParentNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *DestinationParentNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -type DetachPolicyInput struct { - _ struct{} `type:"structure"` - - // The unique identifier (ID) of the policy you want to detach. You can get - // the ID from the ListPolicies or ListPoliciesForTarget operations. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a policy ID string - // requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, - // or the underscore character (_). - // - // PolicyId is a required field - PolicyId *string `type:"string" required:"true"` - - // The unique identifier (ID) of the root, OU, or account that you want to detach - // the policy from. You can get the ID from the ListRoots, ListOrganizationalUnitsForParent, - // or ListAccounts operations. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a target ID string - // requires one of the following: - // - // * Root - A string that begins with "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // * Account - A string that consists of exactly 12 digits. - // - // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lowercase letters or digits (the ID of the root that the - // OU is in). This string is followed by a second "-" dash and from 8 to - // 32 additional lowercase letters or digits. - // - // TargetId is a required field - TargetId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DetachPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DetachPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DetachPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DetachPolicyInput"} - if s.PolicyId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyId")) - } - if s.TargetId == nil { - invalidParams.Add(request.NewErrParamRequired("TargetId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyId sets the PolicyId field's value. -func (s *DetachPolicyInput) SetPolicyId(v string) *DetachPolicyInput { - s.PolicyId = &v - return s -} - -// SetTargetId sets the TargetId field's value. -func (s *DetachPolicyInput) SetTargetId(v string) *DetachPolicyInput { - s.TargetId = &v - return s -} - -type DetachPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DetachPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DetachPolicyOutput) GoString() string { - return s.String() -} - -type DisableAWSServiceAccessInput struct { - _ struct{} `type:"structure"` - - // The service principal name of the Amazon Web Services service for which you - // want to disable integration with your organization. This is typically in - // the form of a URL, such as service-abbreviation.amazonaws.com. - // - // ServicePrincipal is a required field - ServicePrincipal *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DisableAWSServiceAccessInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DisableAWSServiceAccessInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisableAWSServiceAccessInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisableAWSServiceAccessInput"} - if s.ServicePrincipal == nil { - invalidParams.Add(request.NewErrParamRequired("ServicePrincipal")) - } - if s.ServicePrincipal != nil && len(*s.ServicePrincipal) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ServicePrincipal", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetServicePrincipal sets the ServicePrincipal field's value. -func (s *DisableAWSServiceAccessInput) SetServicePrincipal(v string) *DisableAWSServiceAccessInput { - s.ServicePrincipal = &v - return s -} - -type DisableAWSServiceAccessOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DisableAWSServiceAccessOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DisableAWSServiceAccessOutput) GoString() string { - return s.String() -} - -type DisablePolicyTypeInput struct { - _ struct{} `type:"structure"` - - // The policy type that you want to disable in this root. You can specify one - // of the following values: - // - // * AISERVICES_OPT_OUT_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html) - // - // * BACKUP_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html) - // - // * SERVICE_CONTROL_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html) - // - // * TAG_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) - // - // PolicyType is a required field - PolicyType *string `type:"string" required:"true" enum:"PolicyType"` - - // The unique identifier (ID) of the root in which you want to disable a policy - // type. You can get the ID from the ListRoots operation. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a root ID string - // requires "r-" followed by from 4 to 32 lowercase letters or digits. - // - // RootId is a required field - RootId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DisablePolicyTypeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DisablePolicyTypeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DisablePolicyTypeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DisablePolicyTypeInput"} - if s.PolicyType == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyType")) - } - if s.RootId == nil { - invalidParams.Add(request.NewErrParamRequired("RootId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyType sets the PolicyType field's value. -func (s *DisablePolicyTypeInput) SetPolicyType(v string) *DisablePolicyTypeInput { - s.PolicyType = &v - return s -} - -// SetRootId sets the RootId field's value. -func (s *DisablePolicyTypeInput) SetRootId(v string) *DisablePolicyTypeInput { - s.RootId = &v - return s -} - -type DisablePolicyTypeOutput struct { - _ struct{} `type:"structure"` - - // A structure that shows the root with the updated list of enabled policy types. - Root *Root `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DisablePolicyTypeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DisablePolicyTypeOutput) GoString() string { - return s.String() -} - -// SetRoot sets the Root field's value. -func (s *DisablePolicyTypeOutput) SetRoot(v *Root) *DisablePolicyTypeOutput { - s.Root = v - return s -} - -// That account is already present in the specified destination. -type DuplicateAccountException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DuplicateAccountException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DuplicateAccountException) GoString() string { - return s.String() -} - -func newErrorDuplicateAccountException(v protocol.ResponseMetadata) error { - return &DuplicateAccountException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *DuplicateAccountException) Code() string { - return "DuplicateAccountException" -} - -// Message returns the exception's message. -func (s *DuplicateAccountException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *DuplicateAccountException) OrigErr() error { - return nil -} - -func (s *DuplicateAccountException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *DuplicateAccountException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *DuplicateAccountException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A handshake with the same action and target already exists. For example, -// if you invited an account to join your organization, the invited account -// might already have a pending invitation from this organization. If you intend -// to resend an invitation to an account, ensure that existing handshakes that -// might be considered duplicates are canceled or declined. -type DuplicateHandshakeException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DuplicateHandshakeException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DuplicateHandshakeException) GoString() string { - return s.String() -} - -func newErrorDuplicateHandshakeException(v protocol.ResponseMetadata) error { - return &DuplicateHandshakeException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *DuplicateHandshakeException) Code() string { - return "DuplicateHandshakeException" -} - -// Message returns the exception's message. -func (s *DuplicateHandshakeException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *DuplicateHandshakeException) OrigErr() error { - return nil -} - -func (s *DuplicateHandshakeException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *DuplicateHandshakeException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *DuplicateHandshakeException) RequestID() string { - return s.RespMetadata.RequestID -} - -// An OU with the same name already exists. -type DuplicateOrganizationalUnitException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DuplicateOrganizationalUnitException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DuplicateOrganizationalUnitException) GoString() string { - return s.String() -} - -func newErrorDuplicateOrganizationalUnitException(v protocol.ResponseMetadata) error { - return &DuplicateOrganizationalUnitException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *DuplicateOrganizationalUnitException) Code() string { - return "DuplicateOrganizationalUnitException" -} - -// Message returns the exception's message. -func (s *DuplicateOrganizationalUnitException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *DuplicateOrganizationalUnitException) OrigErr() error { - return nil -} - -func (s *DuplicateOrganizationalUnitException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *DuplicateOrganizationalUnitException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *DuplicateOrganizationalUnitException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The selected policy is already attached to the specified target. -type DuplicatePolicyAttachmentException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DuplicatePolicyAttachmentException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DuplicatePolicyAttachmentException) GoString() string { - return s.String() -} - -func newErrorDuplicatePolicyAttachmentException(v protocol.ResponseMetadata) error { - return &DuplicatePolicyAttachmentException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *DuplicatePolicyAttachmentException) Code() string { - return "DuplicatePolicyAttachmentException" -} - -// Message returns the exception's message. -func (s *DuplicatePolicyAttachmentException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *DuplicatePolicyAttachmentException) OrigErr() error { - return nil -} - -func (s *DuplicatePolicyAttachmentException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *DuplicatePolicyAttachmentException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *DuplicatePolicyAttachmentException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A policy with the same name already exists. -type DuplicatePolicyException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DuplicatePolicyException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DuplicatePolicyException) GoString() string { - return s.String() -} - -func newErrorDuplicatePolicyException(v protocol.ResponseMetadata) error { - return &DuplicatePolicyException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *DuplicatePolicyException) Code() string { - return "DuplicatePolicyException" -} - -// Message returns the exception's message. -func (s *DuplicatePolicyException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *DuplicatePolicyException) OrigErr() error { - return nil -} - -func (s *DuplicatePolicyException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *DuplicatePolicyException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *DuplicatePolicyException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains rules to be applied to the affected accounts. The effective policy -// is the aggregation of any policies the account inherits, plus any policy -// directly attached to the account. -type EffectivePolicy struct { - _ struct{} `type:"structure"` - - // The time of the last update to this policy. - LastUpdatedTimestamp *time.Time `type:"timestamp"` - - // The text content of the policy. - PolicyContent *string `min:"1" type:"string"` - - // The policy type. - PolicyType *string `type:"string" enum:"EffectivePolicyType"` - - // The account ID of the policy target. - TargetId *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EffectivePolicy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EffectivePolicy) GoString() string { - return s.String() -} - -// SetLastUpdatedTimestamp sets the LastUpdatedTimestamp field's value. -func (s *EffectivePolicy) SetLastUpdatedTimestamp(v time.Time) *EffectivePolicy { - s.LastUpdatedTimestamp = &v - return s -} - -// SetPolicyContent sets the PolicyContent field's value. -func (s *EffectivePolicy) SetPolicyContent(v string) *EffectivePolicy { - s.PolicyContent = &v - return s -} - -// SetPolicyType sets the PolicyType field's value. -func (s *EffectivePolicy) SetPolicyType(v string) *EffectivePolicy { - s.PolicyType = &v - return s -} - -// SetTargetId sets the TargetId field's value. -func (s *EffectivePolicy) SetTargetId(v string) *EffectivePolicy { - s.TargetId = &v - return s -} - -// If you ran this action on the management account, this policy type is not -// enabled. If you ran the action on a member account, the account doesn't have -// an effective policy of this type. Contact the administrator of your organization -// about attaching a policy of this type to the account. -type EffectivePolicyNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EffectivePolicyNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EffectivePolicyNotFoundException) GoString() string { - return s.String() -} - -func newErrorEffectivePolicyNotFoundException(v protocol.ResponseMetadata) error { - return &EffectivePolicyNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *EffectivePolicyNotFoundException) Code() string { - return "EffectivePolicyNotFoundException" -} - -// Message returns the exception's message. -func (s *EffectivePolicyNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *EffectivePolicyNotFoundException) OrigErr() error { - return nil -} - -func (s *EffectivePolicyNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *EffectivePolicyNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *EffectivePolicyNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -type EnableAWSServiceAccessInput struct { - _ struct{} `type:"structure"` - - // The service principal name of the Amazon Web Services service for which you - // want to enable integration with your organization. This is typically in the - // form of a URL, such as service-abbreviation.amazonaws.com. - // - // ServicePrincipal is a required field - ServicePrincipal *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EnableAWSServiceAccessInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EnableAWSServiceAccessInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnableAWSServiceAccessInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnableAWSServiceAccessInput"} - if s.ServicePrincipal == nil { - invalidParams.Add(request.NewErrParamRequired("ServicePrincipal")) - } - if s.ServicePrincipal != nil && len(*s.ServicePrincipal) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ServicePrincipal", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetServicePrincipal sets the ServicePrincipal field's value. -func (s *EnableAWSServiceAccessInput) SetServicePrincipal(v string) *EnableAWSServiceAccessInput { - s.ServicePrincipal = &v - return s -} - -type EnableAWSServiceAccessOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EnableAWSServiceAccessOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EnableAWSServiceAccessOutput) GoString() string { - return s.String() -} - -type EnableAllFeaturesInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EnableAllFeaturesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EnableAllFeaturesInput) GoString() string { - return s.String() -} - -type EnableAllFeaturesOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains details about the handshake created to support - // this request to enable all features in the organization. - Handshake *Handshake `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EnableAllFeaturesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EnableAllFeaturesOutput) GoString() string { - return s.String() -} - -// SetHandshake sets the Handshake field's value. -func (s *EnableAllFeaturesOutput) SetHandshake(v *Handshake) *EnableAllFeaturesOutput { - s.Handshake = v - return s -} - -type EnablePolicyTypeInput struct { - _ struct{} `type:"structure"` - - // The policy type that you want to enable. You can specify one of the following - // values: - // - // * AISERVICES_OPT_OUT_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html) - // - // * BACKUP_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html) - // - // * SERVICE_CONTROL_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html) - // - // * TAG_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) - // - // PolicyType is a required field - PolicyType *string `type:"string" required:"true" enum:"PolicyType"` - - // The unique identifier (ID) of the root in which you want to enable a policy - // type. You can get the ID from the ListRoots operation. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a root ID string - // requires "r-" followed by from 4 to 32 lowercase letters or digits. - // - // RootId is a required field - RootId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EnablePolicyTypeInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EnablePolicyTypeInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *EnablePolicyTypeInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "EnablePolicyTypeInput"} - if s.PolicyType == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyType")) - } - if s.RootId == nil { - invalidParams.Add(request.NewErrParamRequired("RootId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPolicyType sets the PolicyType field's value. -func (s *EnablePolicyTypeInput) SetPolicyType(v string) *EnablePolicyTypeInput { - s.PolicyType = &v - return s -} - -// SetRootId sets the RootId field's value. -func (s *EnablePolicyTypeInput) SetRootId(v string) *EnablePolicyTypeInput { - s.RootId = &v - return s -} - -type EnablePolicyTypeOutput struct { - _ struct{} `type:"structure"` - - // A structure that shows the root with the updated list of enabled policy types. - Root *Root `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EnablePolicyTypeOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EnablePolicyTypeOutput) GoString() string { - return s.String() -} - -// SetRoot sets the Root field's value. -func (s *EnablePolicyTypeOutput) SetRoot(v *Root) *EnablePolicyTypeOutput { - s.Root = v - return s -} - -// A structure that contains details of a service principal that represents -// an Amazon Web Services service that is enabled to integrate with Organizations. -type EnabledServicePrincipal struct { - _ struct{} `type:"structure"` - - // The date that the service principal was enabled for integration with Organizations. - DateEnabled *time.Time `type:"timestamp"` - - // The name of the service principal. This is typically in the form of a URL, - // such as: servicename.amazonaws.com. - ServicePrincipal *string `min:"1" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EnabledServicePrincipal) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EnabledServicePrincipal) GoString() string { - return s.String() -} - -// SetDateEnabled sets the DateEnabled field's value. -func (s *EnabledServicePrincipal) SetDateEnabled(v time.Time) *EnabledServicePrincipal { - s.DateEnabled = &v - return s -} - -// SetServicePrincipal sets the ServicePrincipal field's value. -func (s *EnabledServicePrincipal) SetServicePrincipal(v string) *EnabledServicePrincipal { - s.ServicePrincipal = &v - return s -} - -// Organizations couldn't perform the operation because your organization hasn't -// finished initializing. This can take up to an hour. Try again later. If after -// one hour you continue to receive this error, contact Amazon Web Services -// Support (https://console.aws.amazon.com/support/home#/). -type FinalizingOrganizationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s FinalizingOrganizationException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s FinalizingOrganizationException) GoString() string { - return s.String() -} - -func newErrorFinalizingOrganizationException(v protocol.ResponseMetadata) error { - return &FinalizingOrganizationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *FinalizingOrganizationException) Code() string { - return "FinalizingOrganizationException" -} - -// Message returns the exception's message. -func (s *FinalizingOrganizationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *FinalizingOrganizationException) OrigErr() error { - return nil -} - -func (s *FinalizingOrganizationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *FinalizingOrganizationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *FinalizingOrganizationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains information that must be exchanged to securely establish a relationship -// between two accounts (an originator and a recipient). For example, when a -// management account (the originator) invites another account (the recipient) -// to join its organization, the two accounts exchange information as a series -// of handshake requests and responses. -// -// Note: Handshakes that are CANCELED, ACCEPTED, DECLINED, or EXPIRED show up -// in lists for only 30 days after entering that state After that they are deleted. -type Handshake struct { - _ struct{} `type:"structure"` - - // The type of handshake, indicating what action occurs when the recipient accepts - // the handshake. The following handshake types are supported: - // - // * INVITE: This type of handshake represents a request to join an organization. - // It is always sent from the management account to only non-member accounts. - // - // * ENABLE_ALL_FEATURES: This type of handshake represents a request to - // enable all features in an organization. It is always sent from the management - // account to only invited member accounts. Created accounts do not receive - // this because those accounts were created by the organization's management - // account and approval is inferred. - // - // * APPROVE_ALL_FEATURES: This type of handshake is sent from the Organizations - // service when all member accounts have approved the ENABLE_ALL_FEATURES - // invitation. It is sent only to the management account and signals the - // master that it can finalize the process to enable all features. - Action *string `type:"string" enum:"ActionType"` - - // The Amazon Resource Name (ARN) of a handshake. - // - // For more information about ARNs in Organizations, see ARN Formats Supported - // by Organizations (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies) - // in the Amazon Web Services Service Authorization Reference. - Arn *string `type:"string"` - - // The date and time that the handshake expires. If the recipient of the handshake - // request fails to respond before the specified date and time, the handshake - // becomes inactive and is no longer valid. - ExpirationTimestamp *time.Time `type:"timestamp"` - - // The unique identifier (ID) of a handshake. The originating account creates - // the ID when it initiates the handshake. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for handshake ID string - // requires "h-" followed by from 8 to 32 lowercase letters or digits. - Id *string `type:"string"` - - // Information about the two accounts that are participating in the handshake. - Parties []*HandshakeParty `type:"list"` - - // The date and time that the handshake request was made. - RequestedTimestamp *time.Time `type:"timestamp"` - - // Additional information that is needed to process the handshake. - Resources []*HandshakeResource `type:"list"` - - // The current state of the handshake. Use the state to trace the flow of the - // handshake through the process from its creation to its acceptance. The meaning - // of each of the valid values is as follows: - // - // * REQUESTED: This handshake was sent to multiple recipients (applicable - // to only some handshake types) and not all recipients have responded yet. - // The request stays in this state until all recipients respond. - // - // * OPEN: This handshake was sent to multiple recipients (applicable to - // only some policy types) and all recipients have responded, allowing the - // originator to complete the handshake action. - // - // * CANCELED: This handshake is no longer active because it was canceled - // by the originating account. - // - // * ACCEPTED: This handshake is complete because it has been accepted by - // the recipient. - // - // * DECLINED: This handshake is no longer active because it was declined - // by the recipient account. - // - // * EXPIRED: This handshake is no longer active because the originator did - // not receive a response of any kind from the recipient before the expiration - // time (15 days). - State *string `type:"string" enum:"HandshakeState"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Handshake) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Handshake) GoString() string { - return s.String() -} - -// SetAction sets the Action field's value. -func (s *Handshake) SetAction(v string) *Handshake { - s.Action = &v - return s -} - -// SetArn sets the Arn field's value. -func (s *Handshake) SetArn(v string) *Handshake { - s.Arn = &v - return s -} - -// SetExpirationTimestamp sets the ExpirationTimestamp field's value. -func (s *Handshake) SetExpirationTimestamp(v time.Time) *Handshake { - s.ExpirationTimestamp = &v - return s -} - -// SetId sets the Id field's value. -func (s *Handshake) SetId(v string) *Handshake { - s.Id = &v - return s -} - -// SetParties sets the Parties field's value. -func (s *Handshake) SetParties(v []*HandshakeParty) *Handshake { - s.Parties = v - return s -} - -// SetRequestedTimestamp sets the RequestedTimestamp field's value. -func (s *Handshake) SetRequestedTimestamp(v time.Time) *Handshake { - s.RequestedTimestamp = &v - return s -} - -// SetResources sets the Resources field's value. -func (s *Handshake) SetResources(v []*HandshakeResource) *Handshake { - s.Resources = v - return s -} - -// SetState sets the State field's value. -func (s *Handshake) SetState(v string) *Handshake { - s.State = &v - return s -} - -// The specified handshake is already in the requested state. For example, you -// can't accept a handshake that was already accepted. -type HandshakeAlreadyInStateException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s HandshakeAlreadyInStateException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s HandshakeAlreadyInStateException) GoString() string { - return s.String() -} - -func newErrorHandshakeAlreadyInStateException(v protocol.ResponseMetadata) error { - return &HandshakeAlreadyInStateException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *HandshakeAlreadyInStateException) Code() string { - return "HandshakeAlreadyInStateException" -} - -// Message returns the exception's message. -func (s *HandshakeAlreadyInStateException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *HandshakeAlreadyInStateException) OrigErr() error { - return nil -} - -func (s *HandshakeAlreadyInStateException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *HandshakeAlreadyInStateException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *HandshakeAlreadyInStateException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The requested operation would violate the constraint identified in the reason -// code. -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation: -// -// - ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on -// the number of accounts in an organization. Note that deleted and closed -// accounts still count toward your limit. If you get this exception immediately -// after creating the organization, wait one hour and try again. If after -// an hour it continues to fail with this error, contact Amazon Web Services -// Support (https://docs.aws.amazon.com/support/home#/). -// -// - ALREADY_IN_AN_ORGANIZATION: The handshake request is invalid because -// the invited account is already a member of an organization. -// -// - HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of -// handshakes that you can send in one day. -// -// - INVITE_DISABLED_DURING_ENABLE_ALL_FEATURES: You can't issue new invitations -// to join an organization while it's in the process of enabling all features. -// You can resume inviting accounts after you finalize the process when all -// accounts have agreed to the change. -// -// - ORGANIZATION_ALREADY_HAS_ALL_FEATURES: The handshake request is invalid -// because the organization has already enabled all features. -// -// - ORGANIZATION_IS_ALREADY_PENDING_ALL_FEATURES_MIGRATION: The handshake -// request is invalid because the organization has already started the process -// to enable all features. -// -// - ORGANIZATION_FROM_DIFFERENT_SELLER_OF_RECORD: The request failed because -// the account is from a different marketplace than the accounts in the organization. -// For example, accounts with India addresses must be associated with the -// AISPL marketplace. All accounts in an organization must be from the same -// marketplace. -// -// - ORGANIZATION_MEMBERSHIP_CHANGE_RATE_LIMIT_EXCEEDED: You attempted to -// change the membership of an account too quickly after its previous change. -// -// - PAYMENT_INSTRUMENT_REQUIRED: You can't complete the operation with an -// account that doesn't have a payment instrument, such as a credit card, -// associated with it. -type HandshakeConstraintViolationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - Reason *string `type:"string" enum:"HandshakeConstraintViolationExceptionReason"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s HandshakeConstraintViolationException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s HandshakeConstraintViolationException) GoString() string { - return s.String() -} - -func newErrorHandshakeConstraintViolationException(v protocol.ResponseMetadata) error { - return &HandshakeConstraintViolationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *HandshakeConstraintViolationException) Code() string { - return "HandshakeConstraintViolationException" -} - -// Message returns the exception's message. -func (s *HandshakeConstraintViolationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *HandshakeConstraintViolationException) OrigErr() error { - return nil -} - -func (s *HandshakeConstraintViolationException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *HandshakeConstraintViolationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *HandshakeConstraintViolationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Specifies the criteria that are used to select the handshakes for the operation. -type HandshakeFilter struct { - _ struct{} `type:"structure"` - - // Specifies the type of handshake action. - // - // If you specify ActionType, you cannot also specify ParentHandshakeId. - ActionType *string `type:"string" enum:"ActionType"` - - // Specifies the parent handshake. Only used for handshake types that are a - // child of another type. - // - // If you specify ParentHandshakeId, you cannot also specify ActionType. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for handshake ID string - // requires "h-" followed by from 8 to 32 lowercase letters or digits. - ParentHandshakeId *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s HandshakeFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s HandshakeFilter) GoString() string { - return s.String() -} - -// SetActionType sets the ActionType field's value. -func (s *HandshakeFilter) SetActionType(v string) *HandshakeFilter { - s.ActionType = &v - return s -} - -// SetParentHandshakeId sets the ParentHandshakeId field's value. -func (s *HandshakeFilter) SetParentHandshakeId(v string) *HandshakeFilter { - s.ParentHandshakeId = &v - return s -} - -// We can't find a handshake with the HandshakeId that you specified. -type HandshakeNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s HandshakeNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s HandshakeNotFoundException) GoString() string { - return s.String() -} - -func newErrorHandshakeNotFoundException(v protocol.ResponseMetadata) error { - return &HandshakeNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *HandshakeNotFoundException) Code() string { - return "HandshakeNotFoundException" -} - -// Message returns the exception's message. -func (s *HandshakeNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *HandshakeNotFoundException) OrigErr() error { - return nil -} - -func (s *HandshakeNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *HandshakeNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *HandshakeNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Identifies a participant in a handshake. -type HandshakeParty struct { - _ struct{} `type:"structure"` - - // The unique identifier (ID) for the party. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for handshake ID string - // requires "h-" followed by from 8 to 32 lowercase letters or digits. - // - // Id is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by HandshakeParty's - // String and GoString methods. - // - // Id is a required field - Id *string `min:"1" type:"string" required:"true" sensitive:"true"` - - // The type of party. - // - // Type is a required field - Type *string `type:"string" required:"true" enum:"HandshakePartyType"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s HandshakeParty) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s HandshakeParty) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *HandshakeParty) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HandshakeParty"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *HandshakeParty) SetId(v string) *HandshakeParty { - s.Id = &v - return s -} - -// SetType sets the Type field's value. -func (s *HandshakeParty) SetType(v string) *HandshakeParty { - s.Type = &v - return s -} - -// Contains additional data that is needed to process a handshake. -type HandshakeResource struct { - _ struct{} `type:"structure"` - - // When needed, contains an additional array of HandshakeResource objects. - Resources []*HandshakeResource `type:"list"` - - // The type of information being passed, specifying how the value is to be interpreted - // by the other party: - // - // * ACCOUNT - Specifies an Amazon Web Services account ID number. - // - // * ORGANIZATION - Specifies an organization ID number. - // - // * EMAIL - Specifies the email address that is associated with the account - // that receives the handshake. - // - // * OWNER_EMAIL - Specifies the email address associated with the management - // account. Included as information about an organization. - // - // * OWNER_NAME - Specifies the name associated with the management account. - // Included as information about an organization. - // - // * NOTES - Additional text provided by the handshake initiator and intended - // for the recipient to read. - Type *string `type:"string" enum:"HandshakeResourceType"` - - // The information that is passed to the other party in the handshake. The format - // of the value string must match the requirements of the specified type. - // - // Value is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by HandshakeResource's - // String and GoString methods. - Value *string `type:"string" sensitive:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s HandshakeResource) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s HandshakeResource) GoString() string { - return s.String() -} - -// SetResources sets the Resources field's value. -func (s *HandshakeResource) SetResources(v []*HandshakeResource) *HandshakeResource { - s.Resources = v - return s -} - -// SetType sets the Type field's value. -func (s *HandshakeResource) SetType(v string) *HandshakeResource { - s.Type = &v - return s -} - -// SetValue sets the Value field's value. -func (s *HandshakeResource) SetValue(v string) *HandshakeResource { - s.Value = &v - return s -} - -// You can't perform the operation on the handshake in its current state. For -// example, you can't cancel a handshake that was already accepted or accept -// a handshake that was already declined. -type InvalidHandshakeTransitionException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidHandshakeTransitionException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidHandshakeTransitionException) GoString() string { - return s.String() -} - -func newErrorInvalidHandshakeTransitionException(v protocol.ResponseMetadata) error { - return &InvalidHandshakeTransitionException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidHandshakeTransitionException) Code() string { - return "InvalidHandshakeTransitionException" -} - -// Message returns the exception's message. -func (s *InvalidHandshakeTransitionException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidHandshakeTransitionException) OrigErr() error { - return nil -} - -func (s *InvalidHandshakeTransitionException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidHandshakeTransitionException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidHandshakeTransitionException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The requested operation failed because you provided invalid values for one -// or more of the request parameters. This exception includes a reason that -// contains additional information about the violated limit: -// -// Some of the reasons in the following list might not be applicable to this -// specific API or operation. -// -// - DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to -// the same entity. -// -// - IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web -// Services and can't be modified. -// -// - INPUT_REQUIRED: You must include a value for all required parameters. -// -// - INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address -// for the invited account owner. -// -// - INVALID_ENUM: You specified an invalid value. -// -// - INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. -// -// - INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid -// characters. -// -// - INVALID_LIST_MEMBER: You provided a list to a parameter that contains -// at least one invalid value. -// -// - INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter -// from the response to a previous call of the operation. -// -// - INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, -// organization, or email) as a party. -// -// - INVALID_PATTERN: You provided a value that doesn't match the required -// pattern. -// -// - INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't -// match the required pattern. -// -// - INVALID_ROLE_NAME: You provided a role name that isn't valid. A role -// name can't begin with the reserved prefix AWSServiceRoleFor. -// -// - INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource -// Name (ARN) for the organization. -// -// - INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. -// -// - INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system -// tag. You can’t add, edit, or delete system tag keys because they're -// reserved for Amazon Web Services use. System tags don’t count against -// your tags per resource limit. -// -// - MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter -// for the operation. -// -// - MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer -// than allowed. -// -// - MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger -// value than allowed. -// -// - MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter -// than allowed. -// -// - MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller -// value than allowed. -// -// - MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only -// between entities in the same root. -// -// - TARGET_NOT_SUPPORTED: You can't perform the specified operation on that -// target entity. -// -// - UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that -// isn't recognized. -type InvalidInputException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - Reason *string `type:"string" enum:"InvalidInputExceptionReason"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidInputException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidInputException) GoString() string { - return s.String() -} - -func newErrorInvalidInputException(v protocol.ResponseMetadata) error { - return &InvalidInputException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidInputException) Code() string { - return "InvalidInputException" -} - -// Message returns the exception's message. -func (s *InvalidInputException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidInputException) OrigErr() error { - return nil -} - -func (s *InvalidInputException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidInputException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidInputException) RequestID() string { - return s.RespMetadata.RequestID -} - -type InviteAccountToOrganizationInput struct { - _ struct{} `type:"structure"` - - // Additional information that you want to include in the generated email to - // the recipient account owner. - // - // Notes is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by InviteAccountToOrganizationInput's - // String and GoString methods. - Notes *string `type:"string" sensitive:"true"` - - // A list of tags that you want to attach to the account when it becomes a member - // of the organization. For each tag in the list, you must specify both a tag - // key and a value. You can set the value to an empty string, but you can't - // set it to null. For more information about tagging, see Tagging Organizations - // resources (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html) - // in the Organizations User Guide. - // - // Any tags in the request are checked for compliance with any applicable tag - // policies when the request is made. The request is rejected if the tags in - // the request don't match the requirements of the policy at that time. Tag - // policy compliance is not checked again when the invitation is accepted and - // the tags are actually attached to the account. That means that if the tag - // policy changes between the invitation and the acceptance, then that tags - // could potentially be non-compliant. - // - // If any one of the tags is invalid or if you exceed the allowed number of - // tags for an account, then the entire request fails and invitations are not - // sent. - Tags []*Tag `type:"list"` - - // The identifier (ID) of the Amazon Web Services account that you want to invite - // to join your organization. This is a JSON object that contains the following - // elements: - // - // { "Type": "ACCOUNT", "Id": "< account id number >" } - // - // If you use the CLI, you can submit this as a single string, similar to the - // following example: - // - // --target Id=123456789012,Type=ACCOUNT - // - // If you specify "Type": "ACCOUNT", you must provide the Amazon Web Services - // account ID number as the Id. If you specify "Type": "EMAIL", you must specify - // the email address that is associated with the account. - // - // --target Id=diego@example.com,Type=EMAIL - // - // Target is a required field - Target *HandshakeParty `type:"structure" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InviteAccountToOrganizationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InviteAccountToOrganizationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InviteAccountToOrganizationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InviteAccountToOrganizationInput"} - if s.Target == nil { - invalidParams.Add(request.NewErrParamRequired("Target")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Target != nil { - if err := s.Target.Validate(); err != nil { - invalidParams.AddNested("Target", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNotes sets the Notes field's value. -func (s *InviteAccountToOrganizationInput) SetNotes(v string) *InviteAccountToOrganizationInput { - s.Notes = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *InviteAccountToOrganizationInput) SetTags(v []*Tag) *InviteAccountToOrganizationInput { - s.Tags = v - return s -} - -// SetTarget sets the Target field's value. -func (s *InviteAccountToOrganizationInput) SetTarget(v *HandshakeParty) *InviteAccountToOrganizationInput { - s.Target = v - return s -} - -type InviteAccountToOrganizationOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains details about the handshake that is created to - // support this invitation request. - Handshake *Handshake `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InviteAccountToOrganizationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InviteAccountToOrganizationOutput) GoString() string { - return s.String() -} - -// SetHandshake sets the Handshake field's value. -func (s *InviteAccountToOrganizationOutput) SetHandshake(v *Handshake) *InviteAccountToOrganizationOutput { - s.Handshake = v - return s -} - -type LeaveOrganizationInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LeaveOrganizationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LeaveOrganizationInput) GoString() string { - return s.String() -} - -type LeaveOrganizationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LeaveOrganizationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LeaveOrganizationOutput) GoString() string { - return s.String() -} - -type ListAWSServiceAccessForOrganizationInput struct { - _ struct{} `type:"structure"` - - // The total number of results that you want included on each page of the response. - // If you do not include this parameter, it defaults to a value that is specific - // to the operation. If additional items exist beyond the maximum you specify, - // the NextToken response element is present and has a value (is not null). - // Include that value as the NextToken request parameter in the next call to - // the operation to get the next part of the results. Note that Organizations - // might return fewer results than the maximum even when there are more results - // available. You should check NextToken after every operation to ensure that - // you receive all of the results. - MaxResults *int64 `min:"1" type:"integer"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. - NextToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListAWSServiceAccessForOrganizationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListAWSServiceAccessForOrganizationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAWSServiceAccessForOrganizationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAWSServiceAccessForOrganizationInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAWSServiceAccessForOrganizationInput) SetMaxResults(v int64) *ListAWSServiceAccessForOrganizationInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAWSServiceAccessForOrganizationInput) SetNextToken(v string) *ListAWSServiceAccessForOrganizationInput { - s.NextToken = &v - return s -} - -type ListAWSServiceAccessForOrganizationOutput struct { - _ struct{} `type:"structure"` - - // A list of the service principals for the services that are enabled to integrate - // with your organization. Each principal is a structure that includes the name - // and the date that it was enabled for integration with Organizations. - EnabledServicePrincipals []*EnabledServicePrincipal `type:"list"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - NextToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListAWSServiceAccessForOrganizationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListAWSServiceAccessForOrganizationOutput) GoString() string { - return s.String() -} - -// SetEnabledServicePrincipals sets the EnabledServicePrincipals field's value. -func (s *ListAWSServiceAccessForOrganizationOutput) SetEnabledServicePrincipals(v []*EnabledServicePrincipal) *ListAWSServiceAccessForOrganizationOutput { - s.EnabledServicePrincipals = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAWSServiceAccessForOrganizationOutput) SetNextToken(v string) *ListAWSServiceAccessForOrganizationOutput { - s.NextToken = &v - return s -} - -type ListAccountsForParentInput struct { - _ struct{} `type:"structure"` - - // The total number of results that you want included on each page of the response. - // If you do not include this parameter, it defaults to a value that is specific - // to the operation. If additional items exist beyond the maximum you specify, - // the NextToken response element is present and has a value (is not null). - // Include that value as the NextToken request parameter in the next call to - // the operation to get the next part of the results. Note that Organizations - // might return fewer results than the maximum even when there are more results - // available. You should check NextToken after every operation to ensure that - // you receive all of the results. - MaxResults *int64 `min:"1" type:"integer"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. - NextToken *string `type:"string"` - - // The unique identifier (ID) for the parent root or organization unit (OU) - // whose accounts you want to list. - // - // ParentId is a required field - ParentId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListAccountsForParentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListAccountsForParentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAccountsForParentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAccountsForParentInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.ParentId == nil { - invalidParams.Add(request.NewErrParamRequired("ParentId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAccountsForParentInput) SetMaxResults(v int64) *ListAccountsForParentInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAccountsForParentInput) SetNextToken(v string) *ListAccountsForParentInput { - s.NextToken = &v - return s -} - -// SetParentId sets the ParentId field's value. -func (s *ListAccountsForParentInput) SetParentId(v string) *ListAccountsForParentInput { - s.ParentId = &v - return s -} - -type ListAccountsForParentOutput struct { - _ struct{} `type:"structure"` - - // A list of the accounts in the specified root or OU. - Accounts []*Account `type:"list"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - NextToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListAccountsForParentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListAccountsForParentOutput) GoString() string { - return s.String() -} - -// SetAccounts sets the Accounts field's value. -func (s *ListAccountsForParentOutput) SetAccounts(v []*Account) *ListAccountsForParentOutput { - s.Accounts = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAccountsForParentOutput) SetNextToken(v string) *ListAccountsForParentOutput { - s.NextToken = &v - return s -} - -type ListAccountsInput struct { - _ struct{} `type:"structure"` - - // The total number of results that you want included on each page of the response. - // If you do not include this parameter, it defaults to a value that is specific - // to the operation. If additional items exist beyond the maximum you specify, - // the NextToken response element is present and has a value (is not null). - // Include that value as the NextToken request parameter in the next call to - // the operation to get the next part of the results. Note that Organizations - // might return fewer results than the maximum even when there are more results - // available. You should check NextToken after every operation to ensure that - // you receive all of the results. - MaxResults *int64 `min:"1" type:"integer"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. - NextToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListAccountsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListAccountsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListAccountsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListAccountsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListAccountsInput) SetMaxResults(v int64) *ListAccountsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAccountsInput) SetNextToken(v string) *ListAccountsInput { - s.NextToken = &v - return s -} - -type ListAccountsOutput struct { - _ struct{} `type:"structure"` - - // A list of objects in the organization. - Accounts []*Account `type:"list"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - NextToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListAccountsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListAccountsOutput) GoString() string { - return s.String() -} - -// SetAccounts sets the Accounts field's value. -func (s *ListAccountsOutput) SetAccounts(v []*Account) *ListAccountsOutput { - s.Accounts = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListAccountsOutput) SetNextToken(v string) *ListAccountsOutput { - s.NextToken = &v - return s -} - -type ListChildrenInput struct { - _ struct{} `type:"structure"` - - // Filters the output to include only the specified child type. - // - // ChildType is a required field - ChildType *string `type:"string" required:"true" enum:"ChildType"` - - // The total number of results that you want included on each page of the response. - // If you do not include this parameter, it defaults to a value that is specific - // to the operation. If additional items exist beyond the maximum you specify, - // the NextToken response element is present and has a value (is not null). - // Include that value as the NextToken request parameter in the next call to - // the operation to get the next part of the results. Note that Organizations - // might return fewer results than the maximum even when there are more results - // available. You should check NextToken after every operation to ensure that - // you receive all of the results. - MaxResults *int64 `min:"1" type:"integer"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. - NextToken *string `type:"string"` - - // The unique identifier (ID) for the parent root or OU whose children you want - // to list. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a parent ID string - // requires one of the following: - // - // * Root - A string that begins with "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lowercase letters or digits (the ID of the root that the - // OU is in). This string is followed by a second "-" dash and from 8 to - // 32 additional lowercase letters or digits. - // - // ParentId is a required field - ParentId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListChildrenInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListChildrenInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListChildrenInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListChildrenInput"} - if s.ChildType == nil { - invalidParams.Add(request.NewErrParamRequired("ChildType")) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.ParentId == nil { - invalidParams.Add(request.NewErrParamRequired("ParentId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChildType sets the ChildType field's value. -func (s *ListChildrenInput) SetChildType(v string) *ListChildrenInput { - s.ChildType = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListChildrenInput) SetMaxResults(v int64) *ListChildrenInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListChildrenInput) SetNextToken(v string) *ListChildrenInput { - s.NextToken = &v - return s -} - -// SetParentId sets the ParentId field's value. -func (s *ListChildrenInput) SetParentId(v string) *ListChildrenInput { - s.ParentId = &v - return s -} - -type ListChildrenOutput struct { - _ struct{} `type:"structure"` - - // The list of children of the specified parent container. - Children []*Child `type:"list"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - NextToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListChildrenOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListChildrenOutput) GoString() string { - return s.String() -} - -// SetChildren sets the Children field's value. -func (s *ListChildrenOutput) SetChildren(v []*Child) *ListChildrenOutput { - s.Children = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListChildrenOutput) SetNextToken(v string) *ListChildrenOutput { - s.NextToken = &v - return s -} - -type ListCreateAccountStatusInput struct { - _ struct{} `type:"structure"` - - // The total number of results that you want included on each page of the response. - // If you do not include this parameter, it defaults to a value that is specific - // to the operation. If additional items exist beyond the maximum you specify, - // the NextToken response element is present and has a value (is not null). - // Include that value as the NextToken request parameter in the next call to - // the operation to get the next part of the results. Note that Organizations - // might return fewer results than the maximum even when there are more results - // available. You should check NextToken after every operation to ensure that - // you receive all of the results. - MaxResults *int64 `min:"1" type:"integer"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. - NextToken *string `type:"string"` - - // A list of one or more states that you want included in the response. If this - // parameter isn't present, all requests are included in the response. - States []*string `type:"list" enum:"CreateAccountState"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListCreateAccountStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListCreateAccountStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListCreateAccountStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListCreateAccountStatusInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListCreateAccountStatusInput) SetMaxResults(v int64) *ListCreateAccountStatusInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCreateAccountStatusInput) SetNextToken(v string) *ListCreateAccountStatusInput { - s.NextToken = &v - return s -} - -// SetStates sets the States field's value. -func (s *ListCreateAccountStatusInput) SetStates(v []*string) *ListCreateAccountStatusInput { - s.States = v - return s -} - -type ListCreateAccountStatusOutput struct { - _ struct{} `type:"structure"` - - // A list of objects with details about the requests. Certain elements, such - // as the accountId number, are present in the output only after the account - // has been successfully created. - CreateAccountStatuses []*CreateAccountStatus `type:"list"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - NextToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListCreateAccountStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListCreateAccountStatusOutput) GoString() string { - return s.String() -} - -// SetCreateAccountStatuses sets the CreateAccountStatuses field's value. -func (s *ListCreateAccountStatusOutput) SetCreateAccountStatuses(v []*CreateAccountStatus) *ListCreateAccountStatusOutput { - s.CreateAccountStatuses = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListCreateAccountStatusOutput) SetNextToken(v string) *ListCreateAccountStatusOutput { - s.NextToken = &v - return s -} - -type ListDelegatedAdministratorsInput struct { - _ struct{} `type:"structure"` - - // The total number of results that you want included on each page of the response. - // If you do not include this parameter, it defaults to a value that is specific - // to the operation. If additional items exist beyond the maximum you specify, - // the NextToken response element is present and has a value (is not null). - // Include that value as the NextToken request parameter in the next call to - // the operation to get the next part of the results. Note that Organizations - // might return fewer results than the maximum even when there are more results - // available. You should check NextToken after every operation to ensure that - // you receive all of the results. - MaxResults *int64 `min:"1" type:"integer"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. - NextToken *string `type:"string"` - - // Specifies a service principal name. If specified, then the operation lists - // the delegated administrators only for the specified service. - // - // If you don't specify a service principal, the operation lists all delegated - // administrators for all services in your organization. - ServicePrincipal *string `min:"1" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListDelegatedAdministratorsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListDelegatedAdministratorsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDelegatedAdministratorsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDelegatedAdministratorsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.ServicePrincipal != nil && len(*s.ServicePrincipal) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ServicePrincipal", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDelegatedAdministratorsInput) SetMaxResults(v int64) *ListDelegatedAdministratorsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDelegatedAdministratorsInput) SetNextToken(v string) *ListDelegatedAdministratorsInput { - s.NextToken = &v - return s -} - -// SetServicePrincipal sets the ServicePrincipal field's value. -func (s *ListDelegatedAdministratorsInput) SetServicePrincipal(v string) *ListDelegatedAdministratorsInput { - s.ServicePrincipal = &v - return s -} - -type ListDelegatedAdministratorsOutput struct { - _ struct{} `type:"structure"` - - // The list of delegated administrators in your organization. - DelegatedAdministrators []*DelegatedAdministrator `type:"list"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - NextToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListDelegatedAdministratorsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListDelegatedAdministratorsOutput) GoString() string { - return s.String() -} - -// SetDelegatedAdministrators sets the DelegatedAdministrators field's value. -func (s *ListDelegatedAdministratorsOutput) SetDelegatedAdministrators(v []*DelegatedAdministrator) *ListDelegatedAdministratorsOutput { - s.DelegatedAdministrators = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDelegatedAdministratorsOutput) SetNextToken(v string) *ListDelegatedAdministratorsOutput { - s.NextToken = &v - return s -} - -type ListDelegatedServicesForAccountInput struct { - _ struct{} `type:"structure"` - - // The account ID number of a delegated administrator account in the organization. - // - // AccountId is a required field - AccountId *string `type:"string" required:"true"` - - // The total number of results that you want included on each page of the response. - // If you do not include this parameter, it defaults to a value that is specific - // to the operation. If additional items exist beyond the maximum you specify, - // the NextToken response element is present and has a value (is not null). - // Include that value as the NextToken request parameter in the next call to - // the operation to get the next part of the results. Note that Organizations - // might return fewer results than the maximum even when there are more results - // available. You should check NextToken after every operation to ensure that - // you receive all of the results. - MaxResults *int64 `min:"1" type:"integer"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. - NextToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListDelegatedServicesForAccountInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListDelegatedServicesForAccountInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListDelegatedServicesForAccountInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListDelegatedServicesForAccountInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *ListDelegatedServicesForAccountInput) SetAccountId(v string) *ListDelegatedServicesForAccountInput { - s.AccountId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListDelegatedServicesForAccountInput) SetMaxResults(v int64) *ListDelegatedServicesForAccountInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDelegatedServicesForAccountInput) SetNextToken(v string) *ListDelegatedServicesForAccountInput { - s.NextToken = &v - return s -} - -type ListDelegatedServicesForAccountOutput struct { - _ struct{} `type:"structure"` - - // The services for which the account is a delegated administrator. - DelegatedServices []*DelegatedService `type:"list"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - NextToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListDelegatedServicesForAccountOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListDelegatedServicesForAccountOutput) GoString() string { - return s.String() -} - -// SetDelegatedServices sets the DelegatedServices field's value. -func (s *ListDelegatedServicesForAccountOutput) SetDelegatedServices(v []*DelegatedService) *ListDelegatedServicesForAccountOutput { - s.DelegatedServices = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListDelegatedServicesForAccountOutput) SetNextToken(v string) *ListDelegatedServicesForAccountOutput { - s.NextToken = &v - return s -} - -type ListHandshakesForAccountInput struct { - _ struct{} `type:"structure"` - - // Filters the handshakes that you want included in the response. The default - // is all types. Use the ActionType element to limit the output to only a specified - // type, such as INVITE, ENABLE_ALL_FEATURES, or APPROVE_ALL_FEATURES. Alternatively, - // for the ENABLE_ALL_FEATURES handshake that generates a separate child handshake - // for each member account, you can specify ParentHandshakeId to see only the - // handshakes that were generated by that parent request. - Filter *HandshakeFilter `type:"structure"` - - // The total number of results that you want included on each page of the response. - // If you do not include this parameter, it defaults to a value that is specific - // to the operation. If additional items exist beyond the maximum you specify, - // the NextToken response element is present and has a value (is not null). - // Include that value as the NextToken request parameter in the next call to - // the operation to get the next part of the results. Note that Organizations - // might return fewer results than the maximum even when there are more results - // available. You should check NextToken after every operation to ensure that - // you receive all of the results. - MaxResults *int64 `min:"1" type:"integer"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. - NextToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListHandshakesForAccountInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListHandshakesForAccountInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListHandshakesForAccountInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListHandshakesForAccountInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListHandshakesForAccountInput) SetFilter(v *HandshakeFilter) *ListHandshakesForAccountInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListHandshakesForAccountInput) SetMaxResults(v int64) *ListHandshakesForAccountInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListHandshakesForAccountInput) SetNextToken(v string) *ListHandshakesForAccountInput { - s.NextToken = &v - return s -} - -type ListHandshakesForAccountOutput struct { - _ struct{} `type:"structure"` - - // A list of Handshake objects with details about each of the handshakes that - // is associated with the specified account. - Handshakes []*Handshake `type:"list"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - NextToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListHandshakesForAccountOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListHandshakesForAccountOutput) GoString() string { - return s.String() -} - -// SetHandshakes sets the Handshakes field's value. -func (s *ListHandshakesForAccountOutput) SetHandshakes(v []*Handshake) *ListHandshakesForAccountOutput { - s.Handshakes = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListHandshakesForAccountOutput) SetNextToken(v string) *ListHandshakesForAccountOutput { - s.NextToken = &v - return s -} - -type ListHandshakesForOrganizationInput struct { - _ struct{} `type:"structure"` - - // A filter of the handshakes that you want included in the response. The default - // is all types. Use the ActionType element to limit the output to only a specified - // type, such as INVITE, ENABLE-ALL-FEATURES, or APPROVE-ALL-FEATURES. Alternatively, - // for the ENABLE-ALL-FEATURES handshake that generates a separate child handshake - // for each member account, you can specify the ParentHandshakeId to see only - // the handshakes that were generated by that parent request. - Filter *HandshakeFilter `type:"structure"` - - // The total number of results that you want included on each page of the response. - // If you do not include this parameter, it defaults to a value that is specific - // to the operation. If additional items exist beyond the maximum you specify, - // the NextToken response element is present and has a value (is not null). - // Include that value as the NextToken request parameter in the next call to - // the operation to get the next part of the results. Note that Organizations - // might return fewer results than the maximum even when there are more results - // available. You should check NextToken after every operation to ensure that - // you receive all of the results. - MaxResults *int64 `min:"1" type:"integer"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. - NextToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListHandshakesForOrganizationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListHandshakesForOrganizationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListHandshakesForOrganizationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListHandshakesForOrganizationInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListHandshakesForOrganizationInput) SetFilter(v *HandshakeFilter) *ListHandshakesForOrganizationInput { - s.Filter = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListHandshakesForOrganizationInput) SetMaxResults(v int64) *ListHandshakesForOrganizationInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListHandshakesForOrganizationInput) SetNextToken(v string) *ListHandshakesForOrganizationInput { - s.NextToken = &v - return s -} - -type ListHandshakesForOrganizationOutput struct { - _ struct{} `type:"structure"` - - // A list of Handshake objects with details about each of the handshakes that - // are associated with an organization. - Handshakes []*Handshake `type:"list"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - NextToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListHandshakesForOrganizationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListHandshakesForOrganizationOutput) GoString() string { - return s.String() -} - -// SetHandshakes sets the Handshakes field's value. -func (s *ListHandshakesForOrganizationOutput) SetHandshakes(v []*Handshake) *ListHandshakesForOrganizationOutput { - s.Handshakes = v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListHandshakesForOrganizationOutput) SetNextToken(v string) *ListHandshakesForOrganizationOutput { - s.NextToken = &v - return s -} - -type ListOrganizationalUnitsForParentInput struct { - _ struct{} `type:"structure"` - - // The total number of results that you want included on each page of the response. - // If you do not include this parameter, it defaults to a value that is specific - // to the operation. If additional items exist beyond the maximum you specify, - // the NextToken response element is present and has a value (is not null). - // Include that value as the NextToken request parameter in the next call to - // the operation to get the next part of the results. Note that Organizations - // might return fewer results than the maximum even when there are more results - // available. You should check NextToken after every operation to ensure that - // you receive all of the results. - MaxResults *int64 `min:"1" type:"integer"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. - NextToken *string `type:"string"` - - // The unique identifier (ID) of the root or OU whose child OUs you want to - // list. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a parent ID string - // requires one of the following: - // - // * Root - A string that begins with "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lowercase letters or digits (the ID of the root that the - // OU is in). This string is followed by a second "-" dash and from 8 to - // 32 additional lowercase letters or digits. - // - // ParentId is a required field - ParentId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListOrganizationalUnitsForParentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListOrganizationalUnitsForParentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListOrganizationalUnitsForParentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListOrganizationalUnitsForParentInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.ParentId == nil { - invalidParams.Add(request.NewErrParamRequired("ParentId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListOrganizationalUnitsForParentInput) SetMaxResults(v int64) *ListOrganizationalUnitsForParentInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListOrganizationalUnitsForParentInput) SetNextToken(v string) *ListOrganizationalUnitsForParentInput { - s.NextToken = &v - return s -} - -// SetParentId sets the ParentId field's value. -func (s *ListOrganizationalUnitsForParentInput) SetParentId(v string) *ListOrganizationalUnitsForParentInput { - s.ParentId = &v - return s -} - -type ListOrganizationalUnitsForParentOutput struct { - _ struct{} `type:"structure"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - NextToken *string `type:"string"` - - // A list of the OUs in the specified root or parent OU. - OrganizationalUnits []*OrganizationalUnit `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListOrganizationalUnitsForParentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListOrganizationalUnitsForParentOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListOrganizationalUnitsForParentOutput) SetNextToken(v string) *ListOrganizationalUnitsForParentOutput { - s.NextToken = &v - return s -} - -// SetOrganizationalUnits sets the OrganizationalUnits field's value. -func (s *ListOrganizationalUnitsForParentOutput) SetOrganizationalUnits(v []*OrganizationalUnit) *ListOrganizationalUnitsForParentOutput { - s.OrganizationalUnits = v - return s -} - -type ListParentsInput struct { - _ struct{} `type:"structure"` - - // The unique identifier (ID) of the OU or account whose parent containers you - // want to list. Don't specify a root. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a child ID string - // requires one of the following: - // - // * Account - A string that consists of exactly 12 digits. - // - // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lowercase letters or digits (the ID of the root that contains - // the OU). This string is followed by a second "-" dash and from 8 to 32 - // additional lowercase letters or digits. - // - // ChildId is a required field - ChildId *string `type:"string" required:"true"` - - // The total number of results that you want included on each page of the response. - // If you do not include this parameter, it defaults to a value that is specific - // to the operation. If additional items exist beyond the maximum you specify, - // the NextToken response element is present and has a value (is not null). - // Include that value as the NextToken request parameter in the next call to - // the operation to get the next part of the results. Note that Organizations - // might return fewer results than the maximum even when there are more results - // available. You should check NextToken after every operation to ensure that - // you receive all of the results. - MaxResults *int64 `min:"1" type:"integer"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. - NextToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListParentsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListParentsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListParentsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListParentsInput"} - if s.ChildId == nil { - invalidParams.Add(request.NewErrParamRequired("ChildId")) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetChildId sets the ChildId field's value. -func (s *ListParentsInput) SetChildId(v string) *ListParentsInput { - s.ChildId = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListParentsInput) SetMaxResults(v int64) *ListParentsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListParentsInput) SetNextToken(v string) *ListParentsInput { - s.NextToken = &v - return s -} - -type ListParentsOutput struct { - _ struct{} `type:"structure"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - NextToken *string `type:"string"` - - // A list of parents for the specified child account or OU. - Parents []*Parent `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListParentsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListParentsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListParentsOutput) SetNextToken(v string) *ListParentsOutput { - s.NextToken = &v - return s -} - -// SetParents sets the Parents field's value. -func (s *ListParentsOutput) SetParents(v []*Parent) *ListParentsOutput { - s.Parents = v - return s -} - -type ListPoliciesForTargetInput struct { - _ struct{} `type:"structure"` - - // The type of policy that you want to include in the returned list. You must - // specify one of the following values: - // - // * AISERVICES_OPT_OUT_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html) - // - // * BACKUP_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html) - // - // * SERVICE_CONTROL_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html) - // - // * TAG_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) - // - // Filter is a required field - Filter *string `type:"string" required:"true" enum:"PolicyType"` - - // The total number of results that you want included on each page of the response. - // If you do not include this parameter, it defaults to a value that is specific - // to the operation. If additional items exist beyond the maximum you specify, - // the NextToken response element is present and has a value (is not null). - // Include that value as the NextToken request parameter in the next call to - // the operation to get the next part of the results. Note that Organizations - // might return fewer results than the maximum even when there are more results - // available. You should check NextToken after every operation to ensure that - // you receive all of the results. - MaxResults *int64 `min:"1" type:"integer"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. - NextToken *string `type:"string"` - - // The unique identifier (ID) of the root, organizational unit, or account whose - // policies you want to list. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a target ID string - // requires one of the following: - // - // * Root - A string that begins with "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // * Account - A string that consists of exactly 12 digits. - // - // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lowercase letters or digits (the ID of the root that the - // OU is in). This string is followed by a second "-" dash and from 8 to - // 32 additional lowercase letters or digits. - // - // TargetId is a required field - TargetId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListPoliciesForTargetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListPoliciesForTargetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListPoliciesForTargetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListPoliciesForTargetInput"} - if s.Filter == nil { - invalidParams.Add(request.NewErrParamRequired("Filter")) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.TargetId == nil { - invalidParams.Add(request.NewErrParamRequired("TargetId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListPoliciesForTargetInput) SetFilter(v string) *ListPoliciesForTargetInput { - s.Filter = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListPoliciesForTargetInput) SetMaxResults(v int64) *ListPoliciesForTargetInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPoliciesForTargetInput) SetNextToken(v string) *ListPoliciesForTargetInput { - s.NextToken = &v - return s -} - -// SetTargetId sets the TargetId field's value. -func (s *ListPoliciesForTargetInput) SetTargetId(v string) *ListPoliciesForTargetInput { - s.TargetId = &v - return s -} - -type ListPoliciesForTargetOutput struct { - _ struct{} `type:"structure"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - NextToken *string `type:"string"` - - // The list of policies that match the criteria in the request. - Policies []*PolicySummary `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListPoliciesForTargetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListPoliciesForTargetOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPoliciesForTargetOutput) SetNextToken(v string) *ListPoliciesForTargetOutput { - s.NextToken = &v - return s -} - -// SetPolicies sets the Policies field's value. -func (s *ListPoliciesForTargetOutput) SetPolicies(v []*PolicySummary) *ListPoliciesForTargetOutput { - s.Policies = v - return s -} - -type ListPoliciesInput struct { - _ struct{} `type:"structure"` - - // Specifies the type of policy that you want to include in the response. You - // must specify one of the following values: - // - // * AISERVICES_OPT_OUT_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_ai-opt-out.html) - // - // * BACKUP_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_backup.html) - // - // * SERVICE_CONTROL_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_scp.html) - // - // * TAG_POLICY (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) - // - // Filter is a required field - Filter *string `type:"string" required:"true" enum:"PolicyType"` - - // The total number of results that you want included on each page of the response. - // If you do not include this parameter, it defaults to a value that is specific - // to the operation. If additional items exist beyond the maximum you specify, - // the NextToken response element is present and has a value (is not null). - // Include that value as the NextToken request parameter in the next call to - // the operation to get the next part of the results. Note that Organizations - // might return fewer results than the maximum even when there are more results - // available. You should check NextToken after every operation to ensure that - // you receive all of the results. - MaxResults *int64 `min:"1" type:"integer"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. - NextToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListPoliciesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListPoliciesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListPoliciesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListPoliciesInput"} - if s.Filter == nil { - invalidParams.Add(request.NewErrParamRequired("Filter")) - } - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *ListPoliciesInput) SetFilter(v string) *ListPoliciesInput { - s.Filter = &v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListPoliciesInput) SetMaxResults(v int64) *ListPoliciesInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPoliciesInput) SetNextToken(v string) *ListPoliciesInput { - s.NextToken = &v - return s -} - -type ListPoliciesOutput struct { - _ struct{} `type:"structure"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - NextToken *string `type:"string"` - - // A list of policies that match the filter criteria in the request. The output - // list doesn't include the policy contents. To see the content for a policy, - // see DescribePolicy. - Policies []*PolicySummary `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListPoliciesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListPoliciesOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListPoliciesOutput) SetNextToken(v string) *ListPoliciesOutput { - s.NextToken = &v - return s -} - -// SetPolicies sets the Policies field's value. -func (s *ListPoliciesOutput) SetPolicies(v []*PolicySummary) *ListPoliciesOutput { - s.Policies = v - return s -} - -type ListRootsInput struct { - _ struct{} `type:"structure"` - - // The total number of results that you want included on each page of the response. - // If you do not include this parameter, it defaults to a value that is specific - // to the operation. If additional items exist beyond the maximum you specify, - // the NextToken response element is present and has a value (is not null). - // Include that value as the NextToken request parameter in the next call to - // the operation to get the next part of the results. Note that Organizations - // might return fewer results than the maximum even when there are more results - // available. You should check NextToken after every operation to ensure that - // you receive all of the results. - MaxResults *int64 `min:"1" type:"integer"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. - NextToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListRootsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListRootsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListRootsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListRootsInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListRootsInput) SetMaxResults(v int64) *ListRootsInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRootsInput) SetNextToken(v string) *ListRootsInput { - s.NextToken = &v - return s -} - -type ListRootsOutput struct { - _ struct{} `type:"structure"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - NextToken *string `type:"string"` - - // A list of roots that are defined in an organization. - Roots []*Root `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListRootsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListRootsOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListRootsOutput) SetNextToken(v string) *ListRootsOutput { - s.NextToken = &v - return s -} - -// SetRoots sets the Roots field's value. -func (s *ListRootsOutput) SetRoots(v []*Root) *ListRootsOutput { - s.Roots = v - return s -} - -type ListTagsForResourceInput struct { - _ struct{} `type:"structure"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. - NextToken *string `type:"string"` - - // The ID of the resource with the tags to list. - // - // You can specify any of the following taggable resources. - // - // * Amazon Web Services account – specify the account ID number. - // - // * Organizational unit – specify the OU ID that begins with ou- and looks - // similar to: ou-1a2b-34uvwxyz - // - // * Root – specify the root ID that begins with r- and looks similar to: - // r-1a2b - // - // * Policy – specify the policy ID that begins with p- andlooks similar - // to: p-12abcdefg3 - // - // ResourceId is a required field - ResourceId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListTagsForResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListTagsForResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTagsForResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTagsForResourceInput"} - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTagsForResourceInput) SetNextToken(v string) *ListTagsForResourceInput { - s.NextToken = &v - return s -} - -// SetResourceId sets the ResourceId field's value. -func (s *ListTagsForResourceInput) SetResourceId(v string) *ListTagsForResourceInput { - s.ResourceId = &v - return s -} - -type ListTagsForResourceOutput struct { - _ struct{} `type:"structure"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - NextToken *string `type:"string"` - - // The tags that are assigned to the resource. - Tags []*Tag `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListTagsForResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListTagsForResourceOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTagsForResourceOutput) SetNextToken(v string) *ListTagsForResourceOutput { - s.NextToken = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ListTagsForResourceOutput) SetTags(v []*Tag) *ListTagsForResourceOutput { - s.Tags = v - return s -} - -type ListTargetsForPolicyInput struct { - _ struct{} `type:"structure"` - - // The total number of results that you want included on each page of the response. - // If you do not include this parameter, it defaults to a value that is specific - // to the operation. If additional items exist beyond the maximum you specify, - // the NextToken response element is present and has a value (is not null). - // Include that value as the NextToken request parameter in the next call to - // the operation to get the next part of the results. Note that Organizations - // might return fewer results than the maximum even when there are more results - // available. You should check NextToken after every operation to ensure that - // you receive all of the results. - MaxResults *int64 `min:"1" type:"integer"` - - // The parameter for receiving additional results if you receive a NextToken - // response in a previous request. A NextToken response indicates that more - // output is available. Set this parameter to the value of the previous call's - // NextToken response to indicate where the output should continue from. - NextToken *string `type:"string"` - - // The unique identifier (ID) of the policy whose attachments you want to know. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a policy ID string - // requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, - // or the underscore character (_). - // - // PolicyId is a required field - PolicyId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListTargetsForPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListTargetsForPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListTargetsForPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListTargetsForPolicyInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.PolicyId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMaxResults sets the MaxResults field's value. -func (s *ListTargetsForPolicyInput) SetMaxResults(v int64) *ListTargetsForPolicyInput { - s.MaxResults = &v - return s -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTargetsForPolicyInput) SetNextToken(v string) *ListTargetsForPolicyInput { - s.NextToken = &v - return s -} - -// SetPolicyId sets the PolicyId field's value. -func (s *ListTargetsForPolicyInput) SetPolicyId(v string) *ListTargetsForPolicyInput { - s.PolicyId = &v - return s -} - -type ListTargetsForPolicyOutput struct { - _ struct{} `type:"structure"` - - // If present, indicates that more output is available than is included in the - // current response. Use this value in the NextToken request parameter in a - // subsequent call to the operation to get the next part of the output. You - // should repeat this until the NextToken response element comes back as null. - NextToken *string `type:"string"` - - // A list of structures, each of which contains details about one of the entities - // to which the specified policy is attached. - Targets []*PolicyTargetSummary `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListTargetsForPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListTargetsForPolicyOutput) GoString() string { - return s.String() -} - -// SetNextToken sets the NextToken field's value. -func (s *ListTargetsForPolicyOutput) SetNextToken(v string) *ListTargetsForPolicyOutput { - s.NextToken = &v - return s -} - -// SetTargets sets the Targets field's value. -func (s *ListTargetsForPolicyOutput) SetTargets(v []*PolicyTargetSummary) *ListTargetsForPolicyOutput { - s.Targets = v - return s -} - -// The provided policy document doesn't meet the requirements of the specified -// policy type. For example, the syntax might be incorrect. For details about -// service control policy syntax, see Service Control Policy Syntax (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_scp-syntax.html) -// in the Organizations User Guide. -type MalformedPolicyDocumentException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MalformedPolicyDocumentException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MalformedPolicyDocumentException) GoString() string { - return s.String() -} - -func newErrorMalformedPolicyDocumentException(v protocol.ResponseMetadata) error { - return &MalformedPolicyDocumentException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *MalformedPolicyDocumentException) Code() string { - return "MalformedPolicyDocumentException" -} - -// Message returns the exception's message. -func (s *MalformedPolicyDocumentException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *MalformedPolicyDocumentException) OrigErr() error { - return nil -} - -func (s *MalformedPolicyDocumentException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *MalformedPolicyDocumentException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *MalformedPolicyDocumentException) RequestID() string { - return s.RespMetadata.RequestID -} - -// You can't remove a management account from an organization. If you want the -// management account to become a member account in another organization, you -// must first delete the current organization of the management account. -type MasterCannotLeaveOrganizationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MasterCannotLeaveOrganizationException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MasterCannotLeaveOrganizationException) GoString() string { - return s.String() -} - -func newErrorMasterCannotLeaveOrganizationException(v protocol.ResponseMetadata) error { - return &MasterCannotLeaveOrganizationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *MasterCannotLeaveOrganizationException) Code() string { - return "MasterCannotLeaveOrganizationException" -} - -// Message returns the exception's message. -func (s *MasterCannotLeaveOrganizationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *MasterCannotLeaveOrganizationException) OrigErr() error { - return nil -} - -func (s *MasterCannotLeaveOrganizationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *MasterCannotLeaveOrganizationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *MasterCannotLeaveOrganizationException) RequestID() string { - return s.RespMetadata.RequestID -} - -type MoveAccountInput struct { - _ struct{} `type:"structure"` - - // The unique identifier (ID) of the account that you want to move. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for an account ID string - // requires exactly 12 digits. - // - // AccountId is a required field - AccountId *string `type:"string" required:"true"` - - // The unique identifier (ID) of the root or organizational unit that you want - // to move the account to. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a parent ID string - // requires one of the following: - // - // * Root - A string that begins with "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lowercase letters or digits (the ID of the root that the - // OU is in). This string is followed by a second "-" dash and from 8 to - // 32 additional lowercase letters or digits. - // - // DestinationParentId is a required field - DestinationParentId *string `type:"string" required:"true"` - - // The unique identifier (ID) of the root or organizational unit that you want - // to move the account from. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a parent ID string - // requires one of the following: - // - // * Root - A string that begins with "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lowercase letters or digits (the ID of the root that the - // OU is in). This string is followed by a second "-" dash and from 8 to - // 32 additional lowercase letters or digits. - // - // SourceParentId is a required field - SourceParentId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MoveAccountInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MoveAccountInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MoveAccountInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MoveAccountInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.DestinationParentId == nil { - invalidParams.Add(request.NewErrParamRequired("DestinationParentId")) - } - if s.SourceParentId == nil { - invalidParams.Add(request.NewErrParamRequired("SourceParentId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *MoveAccountInput) SetAccountId(v string) *MoveAccountInput { - s.AccountId = &v - return s -} - -// SetDestinationParentId sets the DestinationParentId field's value. -func (s *MoveAccountInput) SetDestinationParentId(v string) *MoveAccountInput { - s.DestinationParentId = &v - return s -} - -// SetSourceParentId sets the SourceParentId field's value. -func (s *MoveAccountInput) SetSourceParentId(v string) *MoveAccountInput { - s.SourceParentId = &v - return s -} - -type MoveAccountOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MoveAccountOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MoveAccountOutput) GoString() string { - return s.String() -} - -// Contains details about an organization. An organization is a collection of -// accounts that are centrally managed together using consolidated billing, -// organized hierarchically with organizational units (OUs), and controlled -// with policies . -type Organization struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of an organization. - // - // For more information about ARNs in Organizations, see ARN Formats Supported - // by Organizations (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies) - // in the Amazon Web Services Service Authorization Reference. - Arn *string `type:"string"` - - // - // Do not use. This field is deprecated and doesn't provide complete information - // about the policies in your organization. - // - // To determine the policies that are enabled and available for use in your - // organization, use the ListRoots operation instead. - AvailablePolicyTypes []*PolicyTypeSummary `type:"list"` - - // Specifies the functionality that currently is available to the organization. - // If set to "ALL", then all features are enabled and policies can be applied - // to accounts in the organization. If set to "CONSOLIDATED_BILLING", then only - // consolidated billing functionality is available. For more information, see - // Enabling All Features in Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) - // in the Organizations User Guide. - FeatureSet *string `type:"string" enum:"OrganizationFeatureSet"` - - // The unique identifier (ID) of an organization. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for an organization ID - // string requires "o-" followed by from 10 to 32 lowercase letters or digits. - Id *string `type:"string"` - - // The Amazon Resource Name (ARN) of the account that is designated as the management - // account for the organization. - // - // For more information about ARNs in Organizations, see ARN Formats Supported - // by Organizations (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies) - // in the Amazon Web Services Service Authorization Reference. - MasterAccountArn *string `type:"string"` - - // The email address that is associated with the Amazon Web Services account - // that is designated as the management account for the organization. - // - // MasterAccountEmail is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Organization's - // String and GoString methods. - MasterAccountEmail *string `min:"6" type:"string" sensitive:"true"` - - // The unique identifier (ID) of the management account of an organization. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for an account ID string - // requires exactly 12 digits. - MasterAccountId *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Organization) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Organization) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Organization) SetArn(v string) *Organization { - s.Arn = &v - return s -} - -// SetAvailablePolicyTypes sets the AvailablePolicyTypes field's value. -func (s *Organization) SetAvailablePolicyTypes(v []*PolicyTypeSummary) *Organization { - s.AvailablePolicyTypes = v - return s -} - -// SetFeatureSet sets the FeatureSet field's value. -func (s *Organization) SetFeatureSet(v string) *Organization { - s.FeatureSet = &v - return s -} - -// SetId sets the Id field's value. -func (s *Organization) SetId(v string) *Organization { - s.Id = &v - return s -} - -// SetMasterAccountArn sets the MasterAccountArn field's value. -func (s *Organization) SetMasterAccountArn(v string) *Organization { - s.MasterAccountArn = &v - return s -} - -// SetMasterAccountEmail sets the MasterAccountEmail field's value. -func (s *Organization) SetMasterAccountEmail(v string) *Organization { - s.MasterAccountEmail = &v - return s -} - -// SetMasterAccountId sets the MasterAccountId field's value. -func (s *Organization) SetMasterAccountId(v string) *Organization { - s.MasterAccountId = &v - return s -} - -// The organization isn't empty. To delete an organization, you must first remove -// all accounts except the management account, delete all OUs, and delete all -// policies. -type OrganizationNotEmptyException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OrganizationNotEmptyException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OrganizationNotEmptyException) GoString() string { - return s.String() -} - -func newErrorOrganizationNotEmptyException(v protocol.ResponseMetadata) error { - return &OrganizationNotEmptyException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *OrganizationNotEmptyException) Code() string { - return "OrganizationNotEmptyException" -} - -// Message returns the exception's message. -func (s *OrganizationNotEmptyException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *OrganizationNotEmptyException) OrigErr() error { - return nil -} - -func (s *OrganizationNotEmptyException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *OrganizationNotEmptyException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *OrganizationNotEmptyException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains details about an organizational unit (OU). An OU is a container -// of Amazon Web Services accounts within a root of an organization. Policies -// that are attached to an OU apply to all accounts contained in that OU and -// in any child OUs. -type OrganizationalUnit struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of this OU. - // - // For more information about ARNs in Organizations, see ARN Formats Supported - // by Organizations (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies) - // in the Amazon Web Services Service Authorization Reference. - Arn *string `type:"string"` - - // The unique identifier (ID) associated with this OU. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for an organizational - // unit ID string requires "ou-" followed by from 4 to 32 lowercase letters - // or digits (the ID of the root that contains the OU). This string is followed - // by a second "-" dash and from 8 to 32 additional lowercase letters or digits. - Id *string `type:"string"` - - // The friendly name of this OU. - // - // The regex pattern (http://wikipedia.org/wiki/regex) that is used to validate - // this parameter is a string of any of the characters in the ASCII character - // range. - Name *string `min:"1" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OrganizationalUnit) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OrganizationalUnit) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *OrganizationalUnit) SetArn(v string) *OrganizationalUnit { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *OrganizationalUnit) SetId(v string) *OrganizationalUnit { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *OrganizationalUnit) SetName(v string) *OrganizationalUnit { - s.Name = &v - return s -} - -// The specified OU is not empty. Move all accounts to another root or to other -// OUs, remove all child OUs, and try the operation again. -type OrganizationalUnitNotEmptyException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OrganizationalUnitNotEmptyException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OrganizationalUnitNotEmptyException) GoString() string { - return s.String() -} - -func newErrorOrganizationalUnitNotEmptyException(v protocol.ResponseMetadata) error { - return &OrganizationalUnitNotEmptyException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *OrganizationalUnitNotEmptyException) Code() string { - return "OrganizationalUnitNotEmptyException" -} - -// Message returns the exception's message. -func (s *OrganizationalUnitNotEmptyException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *OrganizationalUnitNotEmptyException) OrigErr() error { - return nil -} - -func (s *OrganizationalUnitNotEmptyException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *OrganizationalUnitNotEmptyException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *OrganizationalUnitNotEmptyException) RequestID() string { - return s.RespMetadata.RequestID -} - -// We can't find an OU with the OrganizationalUnitId that you specified. -type OrganizationalUnitNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OrganizationalUnitNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OrganizationalUnitNotFoundException) GoString() string { - return s.String() -} - -func newErrorOrganizationalUnitNotFoundException(v protocol.ResponseMetadata) error { - return &OrganizationalUnitNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *OrganizationalUnitNotFoundException) Code() string { - return "OrganizationalUnitNotFoundException" -} - -// Message returns the exception's message. -func (s *OrganizationalUnitNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *OrganizationalUnitNotFoundException) OrigErr() error { - return nil -} - -func (s *OrganizationalUnitNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *OrganizationalUnitNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *OrganizationalUnitNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains information about either a root or an organizational unit (OU) that -// can contain OUs or accounts in an organization. -type Parent struct { - _ struct{} `type:"structure"` - - // The unique identifier (ID) of the parent entity. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a parent ID string - // requires one of the following: - // - // * Root - A string that begins with "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lowercase letters or digits (the ID of the root that the - // OU is in). This string is followed by a second "-" dash and from 8 to - // 32 additional lowercase letters or digits. - Id *string `type:"string"` - - // The type of the parent entity. - Type *string `type:"string" enum:"ParentType"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Parent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Parent) GoString() string { - return s.String() -} - -// SetId sets the Id field's value. -func (s *Parent) SetId(v string) *Parent { - s.Id = &v - return s -} - -// SetType sets the Type field's value. -func (s *Parent) SetType(v string) *Parent { - s.Type = &v - return s -} - -// We can't find a root or OU with the ParentId that you specified. -type ParentNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ParentNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ParentNotFoundException) GoString() string { - return s.String() -} - -func newErrorParentNotFoundException(v protocol.ResponseMetadata) error { - return &ParentNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ParentNotFoundException) Code() string { - return "ParentNotFoundException" -} - -// Message returns the exception's message. -func (s *ParentNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ParentNotFoundException) OrigErr() error { - return nil -} - -func (s *ParentNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ParentNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ParentNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains rules to be applied to the affected accounts. Policies can be attached -// directly to accounts, or to roots and OUs to affect all accounts in those -// hierarchies. -type Policy struct { - _ struct{} `type:"structure"` - - // The text content of the policy. - Content *string `min:"1" type:"string"` - - // A structure that contains additional details about the policy. - PolicySummary *PolicySummary `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Policy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Policy) GoString() string { - return s.String() -} - -// SetContent sets the Content field's value. -func (s *Policy) SetContent(v string) *Policy { - s.Content = &v - return s -} - -// SetPolicySummary sets the PolicySummary field's value. -func (s *Policy) SetPolicySummary(v *PolicySummary) *Policy { - s.PolicySummary = v - return s -} - -// Changes to the effective policy are in progress, and its contents can't be -// returned. Try the operation again later. -type PolicyChangesInProgressException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicyChangesInProgressException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicyChangesInProgressException) GoString() string { - return s.String() -} - -func newErrorPolicyChangesInProgressException(v protocol.ResponseMetadata) error { - return &PolicyChangesInProgressException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *PolicyChangesInProgressException) Code() string { - return "PolicyChangesInProgressException" -} - -// Message returns the exception's message. -func (s *PolicyChangesInProgressException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *PolicyChangesInProgressException) OrigErr() error { - return nil -} - -func (s *PolicyChangesInProgressException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *PolicyChangesInProgressException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *PolicyChangesInProgressException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The policy is attached to one or more entities. You must detach it from all -// roots, OUs, and accounts before performing this operation. -type PolicyInUseException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicyInUseException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicyInUseException) GoString() string { - return s.String() -} - -func newErrorPolicyInUseException(v protocol.ResponseMetadata) error { - return &PolicyInUseException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *PolicyInUseException) Code() string { - return "PolicyInUseException" -} - -// Message returns the exception's message. -func (s *PolicyInUseException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *PolicyInUseException) OrigErr() error { - return nil -} - -func (s *PolicyInUseException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *PolicyInUseException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *PolicyInUseException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The policy isn't attached to the specified target in the specified root. -type PolicyNotAttachedException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicyNotAttachedException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicyNotAttachedException) GoString() string { - return s.String() -} - -func newErrorPolicyNotAttachedException(v protocol.ResponseMetadata) error { - return &PolicyNotAttachedException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *PolicyNotAttachedException) Code() string { - return "PolicyNotAttachedException" -} - -// Message returns the exception's message. -func (s *PolicyNotAttachedException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *PolicyNotAttachedException) OrigErr() error { - return nil -} - -func (s *PolicyNotAttachedException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *PolicyNotAttachedException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *PolicyNotAttachedException) RequestID() string { - return s.RespMetadata.RequestID -} - -// We can't find a policy with the PolicyId that you specified. -type PolicyNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicyNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicyNotFoundException) GoString() string { - return s.String() -} - -func newErrorPolicyNotFoundException(v protocol.ResponseMetadata) error { - return &PolicyNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *PolicyNotFoundException) Code() string { - return "PolicyNotFoundException" -} - -// Message returns the exception's message. -func (s *PolicyNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *PolicyNotFoundException) OrigErr() error { - return nil -} - -func (s *PolicyNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *PolicyNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *PolicyNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains information about a policy, but does not include the content. To -// see the content of a policy, see DescribePolicy. -type PolicySummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the policy. - // - // For more information about ARNs in Organizations, see ARN Formats Supported - // by Organizations (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies) - // in the Amazon Web Services Service Authorization Reference. - Arn *string `type:"string"` - - // A boolean value that indicates whether the specified policy is an Amazon - // Web Services managed policy. If true, then you can attach the policy to roots, - // OUs, or accounts, but you cannot edit it. - AwsManaged *bool `type:"boolean"` - - // The description of the policy. - Description *string `type:"string"` - - // The unique identifier (ID) of the policy. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a policy ID string - // requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, - // or the underscore character (_). - Id *string `type:"string"` - - // The friendly name of the policy. - // - // The regex pattern (http://wikipedia.org/wiki/regex) that is used to validate - // this parameter is a string of any of the characters in the ASCII character - // range. - Name *string `min:"1" type:"string"` - - // The type of policy. - Type *string `type:"string" enum:"PolicyType"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicySummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicySummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *PolicySummary) SetArn(v string) *PolicySummary { - s.Arn = &v - return s -} - -// SetAwsManaged sets the AwsManaged field's value. -func (s *PolicySummary) SetAwsManaged(v bool) *PolicySummary { - s.AwsManaged = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *PolicySummary) SetDescription(v string) *PolicySummary { - s.Description = &v - return s -} - -// SetId sets the Id field's value. -func (s *PolicySummary) SetId(v string) *PolicySummary { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *PolicySummary) SetName(v string) *PolicySummary { - s.Name = &v - return s -} - -// SetType sets the Type field's value. -func (s *PolicySummary) SetType(v string) *PolicySummary { - s.Type = &v - return s -} - -// Contains information about a root, OU, or account that a policy is attached -// to. -type PolicyTargetSummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the policy target. - // - // For more information about ARNs in Organizations, see ARN Formats Supported - // by Organizations (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies) - // in the Amazon Web Services Service Authorization Reference. - Arn *string `type:"string"` - - // The friendly name of the policy target. - // - // The regex pattern (http://wikipedia.org/wiki/regex) that is used to validate - // this parameter is a string of any of the characters in the ASCII character - // range. - Name *string `min:"1" type:"string"` - - // The unique identifier (ID) of the policy target. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a target ID string - // requires one of the following: - // - // * Root - A string that begins with "r-" followed by from 4 to 32 lowercase - // letters or digits. - // - // * Account - A string that consists of exactly 12 digits. - // - // * Organizational unit (OU) - A string that begins with "ou-" followed - // by from 4 to 32 lowercase letters or digits (the ID of the root that the - // OU is in). This string is followed by a second "-" dash and from 8 to - // 32 additional lowercase letters or digits. - TargetId *string `type:"string"` - - // The type of the policy target. - Type *string `type:"string" enum:"TargetType"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicyTargetSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicyTargetSummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *PolicyTargetSummary) SetArn(v string) *PolicyTargetSummary { - s.Arn = &v - return s -} - -// SetName sets the Name field's value. -func (s *PolicyTargetSummary) SetName(v string) *PolicyTargetSummary { - s.Name = &v - return s -} - -// SetTargetId sets the TargetId field's value. -func (s *PolicyTargetSummary) SetTargetId(v string) *PolicyTargetSummary { - s.TargetId = &v - return s -} - -// SetType sets the Type field's value. -func (s *PolicyTargetSummary) SetType(v string) *PolicyTargetSummary { - s.Type = &v - return s -} - -// The specified policy type is already enabled in the specified root. -type PolicyTypeAlreadyEnabledException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicyTypeAlreadyEnabledException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicyTypeAlreadyEnabledException) GoString() string { - return s.String() -} - -func newErrorPolicyTypeAlreadyEnabledException(v protocol.ResponseMetadata) error { - return &PolicyTypeAlreadyEnabledException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *PolicyTypeAlreadyEnabledException) Code() string { - return "PolicyTypeAlreadyEnabledException" -} - -// Message returns the exception's message. -func (s *PolicyTypeAlreadyEnabledException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *PolicyTypeAlreadyEnabledException) OrigErr() error { - return nil -} - -func (s *PolicyTypeAlreadyEnabledException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *PolicyTypeAlreadyEnabledException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *PolicyTypeAlreadyEnabledException) RequestID() string { - return s.RespMetadata.RequestID -} - -// You can't use the specified policy type with the feature set currently enabled -// for this organization. For example, you can enable SCPs only after you enable -// all features in the organization. For more information, see Managing Organizations -// Policies (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html#enable_policies_on_root)in -// the Organizations User Guide. -type PolicyTypeNotAvailableForOrganizationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicyTypeNotAvailableForOrganizationException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicyTypeNotAvailableForOrganizationException) GoString() string { - return s.String() -} - -func newErrorPolicyTypeNotAvailableForOrganizationException(v protocol.ResponseMetadata) error { - return &PolicyTypeNotAvailableForOrganizationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *PolicyTypeNotAvailableForOrganizationException) Code() string { - return "PolicyTypeNotAvailableForOrganizationException" -} - -// Message returns the exception's message. -func (s *PolicyTypeNotAvailableForOrganizationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *PolicyTypeNotAvailableForOrganizationException) OrigErr() error { - return nil -} - -func (s *PolicyTypeNotAvailableForOrganizationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *PolicyTypeNotAvailableForOrganizationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *PolicyTypeNotAvailableForOrganizationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The specified policy type isn't currently enabled in this root. You can't -// attach policies of the specified type to entities in a root until you enable -// that type in the root. For more information, see Enabling All Features in -// Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) -// in the Organizations User Guide. -type PolicyTypeNotEnabledException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicyTypeNotEnabledException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicyTypeNotEnabledException) GoString() string { - return s.String() -} - -func newErrorPolicyTypeNotEnabledException(v protocol.ResponseMetadata) error { - return &PolicyTypeNotEnabledException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *PolicyTypeNotEnabledException) Code() string { - return "PolicyTypeNotEnabledException" -} - -// Message returns the exception's message. -func (s *PolicyTypeNotEnabledException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *PolicyTypeNotEnabledException) OrigErr() error { - return nil -} - -func (s *PolicyTypeNotEnabledException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *PolicyTypeNotEnabledException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *PolicyTypeNotEnabledException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Contains information about a policy type and its status in the associated -// root. -type PolicyTypeSummary struct { - _ struct{} `type:"structure"` - - // The status of the policy type as it relates to the associated root. To attach - // a policy of the specified type to a root or to an OU or account in that root, - // it must be available in the organization and enabled for that root. - Status *string `type:"string" enum:"PolicyTypeStatus"` - - // The name of the policy type. - Type *string `type:"string" enum:"PolicyType"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicyTypeSummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicyTypeSummary) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *PolicyTypeSummary) SetStatus(v string) *PolicyTypeSummary { - s.Status = &v - return s -} - -// SetType sets the Type field's value. -func (s *PolicyTypeSummary) SetType(v string) *PolicyTypeSummary { - s.Type = &v - return s -} - -type PutResourcePolicyInput struct { - _ struct{} `type:"structure"` - - // If provided, the new content for the resource policy. The text must be correctly - // formatted JSON that complies with the syntax for the resource policy's type. - // For more information, see Service Control Policy Syntax (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_scp-syntax.html) - // in the Organizations User Guide. - // - // Content is a required field - Content *string `min:"1" type:"string" required:"true"` - - // Updates the list of tags that you want to attach to the newly-created resource - // policy. For each tag in the list, you must specify both a tag key and a value. - // You can set the value to an empty string, but you can't set it to null. For - // more information about tagging, see Tagging Organizations resources (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_tagging.html) - // in the Organizations User Guide. - // - // Calls with tags apply to the initial creation of the resource policy, otherwise - // an exception is thrown. If any one of the tags is invalid or if you exceed - // the allowed number of tags for the resource policy, then the entire request - // fails and the resource policy is not created. - Tags []*Tag `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutResourcePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutResourcePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutResourcePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutResourcePolicyInput"} - if s.Content == nil { - invalidParams.Add(request.NewErrParamRequired("Content")) - } - if s.Content != nil && len(*s.Content) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Content", 1)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContent sets the Content field's value. -func (s *PutResourcePolicyInput) SetContent(v string) *PutResourcePolicyInput { - s.Content = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *PutResourcePolicyInput) SetTags(v []*Tag) *PutResourcePolicyInput { - s.Tags = v - return s -} - -type PutResourcePolicyOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains details about the resource policy. - ResourcePolicy *ResourcePolicy `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutResourcePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutResourcePolicyOutput) GoString() string { - return s.String() -} - -// SetResourcePolicy sets the ResourcePolicy field's value. -func (s *PutResourcePolicyOutput) SetResourcePolicy(v *ResourcePolicy) *PutResourcePolicyOutput { - s.ResourcePolicy = v - return s -} - -type RegisterDelegatedAdministratorInput struct { - _ struct{} `type:"structure"` - - // The account ID number of the member account in the organization to register - // as a delegated administrator. - // - // AccountId is a required field - AccountId *string `type:"string" required:"true"` - - // The service principal of the Amazon Web Services service for which you want - // to make the member account a delegated administrator. - // - // ServicePrincipal is a required field - ServicePrincipal *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RegisterDelegatedAdministratorInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RegisterDelegatedAdministratorInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RegisterDelegatedAdministratorInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RegisterDelegatedAdministratorInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - if s.ServicePrincipal == nil { - invalidParams.Add(request.NewErrParamRequired("ServicePrincipal")) - } - if s.ServicePrincipal != nil && len(*s.ServicePrincipal) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ServicePrincipal", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *RegisterDelegatedAdministratorInput) SetAccountId(v string) *RegisterDelegatedAdministratorInput { - s.AccountId = &v - return s -} - -// SetServicePrincipal sets the ServicePrincipal field's value. -func (s *RegisterDelegatedAdministratorInput) SetServicePrincipal(v string) *RegisterDelegatedAdministratorInput { - s.ServicePrincipal = &v - return s -} - -type RegisterDelegatedAdministratorOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RegisterDelegatedAdministratorOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RegisterDelegatedAdministratorOutput) GoString() string { - return s.String() -} - -type RemoveAccountFromOrganizationInput struct { - _ struct{} `type:"structure"` - - // The unique identifier (ID) of the member account that you want to remove - // from the organization. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for an account ID string - // requires exactly 12 digits. - // - // AccountId is a required field - AccountId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RemoveAccountFromOrganizationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RemoveAccountFromOrganizationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RemoveAccountFromOrganizationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RemoveAccountFromOrganizationInput"} - if s.AccountId == nil { - invalidParams.Add(request.NewErrParamRequired("AccountId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *RemoveAccountFromOrganizationInput) SetAccountId(v string) *RemoveAccountFromOrganizationInput { - s.AccountId = &v - return s -} - -type RemoveAccountFromOrganizationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RemoveAccountFromOrganizationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RemoveAccountFromOrganizationOutput) GoString() string { - return s.String() -} - -// A structure that contains details about a resource policy. -type ResourcePolicy struct { - _ struct{} `type:"structure"` - - // The policy text of the resource policy. - Content *string `min:"1" type:"string"` - - // A structure that contains resource policy ID and Amazon Resource Name (ARN). - ResourcePolicySummary *ResourcePolicySummary `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ResourcePolicy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ResourcePolicy) GoString() string { - return s.String() -} - -// SetContent sets the Content field's value. -func (s *ResourcePolicy) SetContent(v string) *ResourcePolicy { - s.Content = &v - return s -} - -// SetResourcePolicySummary sets the ResourcePolicySummary field's value. -func (s *ResourcePolicy) SetResourcePolicySummary(v *ResourcePolicySummary) *ResourcePolicy { - s.ResourcePolicySummary = v - return s -} - -// We can't find a resource policy request with the parameter that you specified. -type ResourcePolicyNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ResourcePolicyNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ResourcePolicyNotFoundException) GoString() string { - return s.String() -} - -func newErrorResourcePolicyNotFoundException(v protocol.ResponseMetadata) error { - return &ResourcePolicyNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ResourcePolicyNotFoundException) Code() string { - return "ResourcePolicyNotFoundException" -} - -// Message returns the exception's message. -func (s *ResourcePolicyNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ResourcePolicyNotFoundException) OrigErr() error { - return nil -} - -func (s *ResourcePolicyNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ResourcePolicyNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ResourcePolicyNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A structure that contains resource policy ID and Amazon Resource Name (ARN). -type ResourcePolicySummary struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource policy. - Arn *string `type:"string"` - - // The unique identifier (ID) of the resource policy. - Id *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ResourcePolicySummary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ResourcePolicySummary) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *ResourcePolicySummary) SetArn(v string) *ResourcePolicySummary { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *ResourcePolicySummary) SetId(v string) *ResourcePolicySummary { - s.Id = &v - return s -} - -// Contains details about a root. A root is a top-level parent node in the hierarchy -// of an organization that can contain organizational units (OUs) and accounts. -// The root contains every Amazon Web Services account in the organization. -type Root struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the root. - // - // For more information about ARNs in Organizations, see ARN Formats Supported - // by Organizations (https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsorganizations.html#awsorganizations-resources-for-iam-policies) - // in the Amazon Web Services Service Authorization Reference. - Arn *string `type:"string"` - - // The unique identifier (ID) for the root. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a root ID string - // requires "r-" followed by from 4 to 32 lowercase letters or digits. - Id *string `type:"string"` - - // The friendly name of the root. - // - // The regex pattern (http://wikipedia.org/wiki/regex) that is used to validate - // this parameter is a string of any of the characters in the ASCII character - // range. - Name *string `min:"1" type:"string"` - - // The types of policies that are currently enabled for the root and therefore - // can be attached to the root or to its OUs or accounts. - // - // Even if a policy type is shown as available in the organization, you can - // separately enable and disable them at the root level by using EnablePolicyType - // and DisablePolicyType. Use DescribeOrganization to see the availability of - // the policy types in that organization. - PolicyTypes []*PolicyTypeSummary `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Root) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Root) GoString() string { - return s.String() -} - -// SetArn sets the Arn field's value. -func (s *Root) SetArn(v string) *Root { - s.Arn = &v - return s -} - -// SetId sets the Id field's value. -func (s *Root) SetId(v string) *Root { - s.Id = &v - return s -} - -// SetName sets the Name field's value. -func (s *Root) SetName(v string) *Root { - s.Name = &v - return s -} - -// SetPolicyTypes sets the PolicyTypes field's value. -func (s *Root) SetPolicyTypes(v []*PolicyTypeSummary) *Root { - s.PolicyTypes = v - return s -} - -// We can't find a root with the RootId that you specified. -type RootNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RootNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RootNotFoundException) GoString() string { - return s.String() -} - -func newErrorRootNotFoundException(v protocol.ResponseMetadata) error { - return &RootNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *RootNotFoundException) Code() string { - return "RootNotFoundException" -} - -// Message returns the exception's message. -func (s *RootNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *RootNotFoundException) OrigErr() error { - return nil -} - -func (s *RootNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *RootNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *RootNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// Organizations can't complete your request because of an internal service -// error. Try again later. -type ServiceException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ServiceException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ServiceException) GoString() string { - return s.String() -} - -func newErrorServiceException(v protocol.ResponseMetadata) error { - return &ServiceException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ServiceException) Code() string { - return "ServiceException" -} - -// Message returns the exception's message. -func (s *ServiceException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ServiceException) OrigErr() error { - return nil -} - -func (s *ServiceException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ServiceException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ServiceException) RequestID() string { - return s.RespMetadata.RequestID -} - -// We can't find a source root or OU with the ParentId that you specified. -type SourceParentNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s SourceParentNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s SourceParentNotFoundException) GoString() string { - return s.String() -} - -func newErrorSourceParentNotFoundException(v protocol.ResponseMetadata) error { - return &SourceParentNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *SourceParentNotFoundException) Code() string { - return "SourceParentNotFoundException" -} - -// Message returns the exception's message. -func (s *SourceParentNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *SourceParentNotFoundException) OrigErr() error { - return nil -} - -func (s *SourceParentNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *SourceParentNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *SourceParentNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A custom key-value pair associated with a resource within your organization. -// -// You can attach tags to any of the following organization resources. -// -// - Amazon Web Services account -// -// - Organizational unit (OU) -// -// - Organization root -// -// - Policy -type Tag struct { - _ struct{} `type:"structure"` - - // The key identifier, or name, of the tag. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // The string value that's associated with the key of the tag. You can set the - // value of a tag to an empty string, but you can't set the value of a tag to - // null. - // - // Value is a required field - Value *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Tag) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -type TagResourceInput struct { - _ struct{} `type:"structure"` - - // The ID of the resource to add a tag to. - // - // You can specify any of the following taggable resources. - // - // * Amazon Web Services account – specify the account ID number. - // - // * Organizational unit – specify the OU ID that begins with ou- and looks - // similar to: ou-1a2b-34uvwxyz - // - // * Root – specify the root ID that begins with r- and looks similar to: - // r-1a2b - // - // * Policy – specify the policy ID that begins with p- andlooks similar - // to: p-12abcdefg3 - // - // ResourceId is a required field - ResourceId *string `type:"string" required:"true"` - - // A list of tags to add to the specified resource. - // - // For each tag in the list, you must specify both a tag key and a value. The - // value can be an empty string, but you can't set it to null. - // - // If any one of the tags is invalid or if you exceed the maximum allowed number - // of tags for a resource, then the entire request fails. - // - // Tags is a required field - Tags []*Tag `type:"list" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TagResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourceInput"} - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceId sets the ResourceId field's value. -func (s *TagResourceInput) SetResourceId(v string) *TagResourceInput { - s.ResourceId = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourceInput) SetTags(v []*Tag) *TagResourceInput { - s.Tags = v - return s -} - -type TagResourceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TagResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TagResourceOutput) GoString() string { - return s.String() -} - -// We can't find a root, OU, account, or policy with the TargetId that you specified. -type TargetNotFoundException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TargetNotFoundException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TargetNotFoundException) GoString() string { - return s.String() -} - -func newErrorTargetNotFoundException(v protocol.ResponseMetadata) error { - return &TargetNotFoundException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *TargetNotFoundException) Code() string { - return "TargetNotFoundException" -} - -// Message returns the exception's message. -func (s *TargetNotFoundException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *TargetNotFoundException) OrigErr() error { - return nil -} - -func (s *TargetNotFoundException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *TargetNotFoundException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *TargetNotFoundException) RequestID() string { - return s.RespMetadata.RequestID -} - -// You have sent too many requests in too short a period of time. The quota -// helps protect against denial-of-service attacks. Try again later. -// -// For information about quotas that affect Organizations, see Quotas for Organizations -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in -// the Organizations User Guide. -type TooManyRequestsException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` - - Type *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TooManyRequestsException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TooManyRequestsException) GoString() string { - return s.String() -} - -func newErrorTooManyRequestsException(v protocol.ResponseMetadata) error { - return &TooManyRequestsException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *TooManyRequestsException) Code() string { - return "TooManyRequestsException" -} - -// Message returns the exception's message. -func (s *TooManyRequestsException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *TooManyRequestsException) OrigErr() error { - return nil -} - -func (s *TooManyRequestsException) Error() string { - return fmt.Sprintf("%s: %s\n%s", s.Code(), s.Message(), s.String()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *TooManyRequestsException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *TooManyRequestsException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This action isn't available in the current Amazon Web Services Region. -type UnsupportedAPIEndpointException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UnsupportedAPIEndpointException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UnsupportedAPIEndpointException) GoString() string { - return s.String() -} - -func newErrorUnsupportedAPIEndpointException(v protocol.ResponseMetadata) error { - return &UnsupportedAPIEndpointException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *UnsupportedAPIEndpointException) Code() string { - return "UnsupportedAPIEndpointException" -} - -// Message returns the exception's message. -func (s *UnsupportedAPIEndpointException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *UnsupportedAPIEndpointException) OrigErr() error { - return nil -} - -func (s *UnsupportedAPIEndpointException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *UnsupportedAPIEndpointException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *UnsupportedAPIEndpointException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourceInput struct { - _ struct{} `type:"structure"` - - // The ID of the resource to remove a tag from. - // - // You can specify any of the following taggable resources. - // - // * Amazon Web Services account – specify the account ID number. - // - // * Organizational unit – specify the OU ID that begins with ou- and looks - // similar to: ou-1a2b-34uvwxyz - // - // * Root – specify the root ID that begins with r- and looks similar to: - // r-1a2b - // - // * Policy – specify the policy ID that begins with p- andlooks similar - // to: p-12abcdefg3 - // - // ResourceId is a required field - ResourceId *string `type:"string" required:"true"` - - // The list of keys for tags to remove from the specified resource. - // - // TagKeys is a required field - TagKeys []*string `type:"list" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UntagResourceInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UntagResourceInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourceInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourceInput"} - if s.ResourceId == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceId")) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceId sets the ResourceId field's value. -func (s *UntagResourceInput) SetResourceId(v string) *UntagResourceInput { - s.ResourceId = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourceInput) SetTagKeys(v []*string) *UntagResourceInput { - s.TagKeys = v - return s -} - -type UntagResourceOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UntagResourceOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UntagResourceOutput) GoString() string { - return s.String() -} - -type UpdateOrganizationalUnitInput struct { - _ struct{} `type:"structure"` - - // The new name that you want to assign to the OU. - // - // The regex pattern (http://wikipedia.org/wiki/regex) that is used to validate - // this parameter is a string of any of the characters in the ASCII character - // range. - Name *string `min:"1" type:"string"` - - // The unique identifier (ID) of the OU that you want to rename. You can get - // the ID from the ListOrganizationalUnitsForParent operation. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for an organizational - // unit ID string requires "ou-" followed by from 4 to 32 lowercase letters - // or digits (the ID of the root that contains the OU). This string is followed - // by a second "-" dash and from 8 to 32 additional lowercase letters or digits. - // - // OrganizationalUnitId is a required field - OrganizationalUnitId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UpdateOrganizationalUnitInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UpdateOrganizationalUnitInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdateOrganizationalUnitInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdateOrganizationalUnitInput"} - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.OrganizationalUnitId == nil { - invalidParams.Add(request.NewErrParamRequired("OrganizationalUnitId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *UpdateOrganizationalUnitInput) SetName(v string) *UpdateOrganizationalUnitInput { - s.Name = &v - return s -} - -// SetOrganizationalUnitId sets the OrganizationalUnitId field's value. -func (s *UpdateOrganizationalUnitInput) SetOrganizationalUnitId(v string) *UpdateOrganizationalUnitInput { - s.OrganizationalUnitId = &v - return s -} - -type UpdateOrganizationalUnitOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains the details about the specified OU, including its - // new name. - OrganizationalUnit *OrganizationalUnit `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UpdateOrganizationalUnitOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UpdateOrganizationalUnitOutput) GoString() string { - return s.String() -} - -// SetOrganizationalUnit sets the OrganizationalUnit field's value. -func (s *UpdateOrganizationalUnitOutput) SetOrganizationalUnit(v *OrganizationalUnit) *UpdateOrganizationalUnitOutput { - s.OrganizationalUnit = v - return s -} - -type UpdatePolicyInput struct { - _ struct{} `type:"structure"` - - // If provided, the new content for the policy. The text must be correctly formatted - // JSON that complies with the syntax for the policy's type. For more information, - // see Service Control Policy Syntax (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_scp-syntax.html) - // in the Organizations User Guide. - Content *string `min:"1" type:"string"` - - // If provided, the new description for the policy. - Description *string `type:"string"` - - // If provided, the new name for the policy. - // - // The regex pattern (http://wikipedia.org/wiki/regex) that is used to validate - // this parameter is a string of any of the characters in the ASCII character - // range. - Name *string `min:"1" type:"string"` - - // The unique identifier (ID) of the policy that you want to update. - // - // The regex pattern (http://wikipedia.org/wiki/regex) for a policy ID string - // requires "p-" followed by from 8 to 128 lowercase or uppercase letters, digits, - // or the underscore character (_). - // - // PolicyId is a required field - PolicyId *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UpdatePolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UpdatePolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UpdatePolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UpdatePolicyInput"} - if s.Content != nil && len(*s.Content) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Content", 1)) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.PolicyId == nil { - invalidParams.Add(request.NewErrParamRequired("PolicyId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContent sets the Content field's value. -func (s *UpdatePolicyInput) SetContent(v string) *UpdatePolicyInput { - s.Content = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *UpdatePolicyInput) SetDescription(v string) *UpdatePolicyInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *UpdatePolicyInput) SetName(v string) *UpdatePolicyInput { - s.Name = &v - return s -} - -// SetPolicyId sets the PolicyId field's value. -func (s *UpdatePolicyInput) SetPolicyId(v string) *UpdatePolicyInput { - s.PolicyId = &v - return s -} - -type UpdatePolicyOutput struct { - _ struct{} `type:"structure"` - - // A structure that contains details about the updated policy, showing the requested - // changes. - Policy *Policy `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UpdatePolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UpdatePolicyOutput) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *UpdatePolicyOutput) SetPolicy(v *Policy) *UpdatePolicyOutput { - s.Policy = v - return s -} - -const ( - // AccessDeniedForDependencyExceptionReasonAccessDeniedDuringCreateServiceLinkedRole is a AccessDeniedForDependencyExceptionReason enum value - AccessDeniedForDependencyExceptionReasonAccessDeniedDuringCreateServiceLinkedRole = "ACCESS_DENIED_DURING_CREATE_SERVICE_LINKED_ROLE" -) - -// AccessDeniedForDependencyExceptionReason_Values returns all elements of the AccessDeniedForDependencyExceptionReason enum -func AccessDeniedForDependencyExceptionReason_Values() []string { - return []string{ - AccessDeniedForDependencyExceptionReasonAccessDeniedDuringCreateServiceLinkedRole, - } -} - -const ( - // AccountJoinedMethodInvited is a AccountJoinedMethod enum value - AccountJoinedMethodInvited = "INVITED" - - // AccountJoinedMethodCreated is a AccountJoinedMethod enum value - AccountJoinedMethodCreated = "CREATED" -) - -// AccountJoinedMethod_Values returns all elements of the AccountJoinedMethod enum -func AccountJoinedMethod_Values() []string { - return []string{ - AccountJoinedMethodInvited, - AccountJoinedMethodCreated, - } -} - -const ( - // AccountStatusActive is a AccountStatus enum value - AccountStatusActive = "ACTIVE" - - // AccountStatusSuspended is a AccountStatus enum value - AccountStatusSuspended = "SUSPENDED" - - // AccountStatusPendingClosure is a AccountStatus enum value - AccountStatusPendingClosure = "PENDING_CLOSURE" -) - -// AccountStatus_Values returns all elements of the AccountStatus enum -func AccountStatus_Values() []string { - return []string{ - AccountStatusActive, - AccountStatusSuspended, - AccountStatusPendingClosure, - } -} - -const ( - // ActionTypeInvite is a ActionType enum value - ActionTypeInvite = "INVITE" - - // ActionTypeEnableAllFeatures is a ActionType enum value - ActionTypeEnableAllFeatures = "ENABLE_ALL_FEATURES" - - // ActionTypeApproveAllFeatures is a ActionType enum value - ActionTypeApproveAllFeatures = "APPROVE_ALL_FEATURES" - - // ActionTypeAddOrganizationsServiceLinkedRole is a ActionType enum value - ActionTypeAddOrganizationsServiceLinkedRole = "ADD_ORGANIZATIONS_SERVICE_LINKED_ROLE" -) - -// ActionType_Values returns all elements of the ActionType enum -func ActionType_Values() []string { - return []string{ - ActionTypeInvite, - ActionTypeEnableAllFeatures, - ActionTypeApproveAllFeatures, - ActionTypeAddOrganizationsServiceLinkedRole, - } -} - -const ( - // ChildTypeAccount is a ChildType enum value - ChildTypeAccount = "ACCOUNT" - - // ChildTypeOrganizationalUnit is a ChildType enum value - ChildTypeOrganizationalUnit = "ORGANIZATIONAL_UNIT" -) - -// ChildType_Values returns all elements of the ChildType enum -func ChildType_Values() []string { - return []string{ - ChildTypeAccount, - ChildTypeOrganizationalUnit, - } -} - -const ( - // ConstraintViolationExceptionReasonAccountNumberLimitExceeded is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonAccountNumberLimitExceeded = "ACCOUNT_NUMBER_LIMIT_EXCEEDED" - - // ConstraintViolationExceptionReasonHandshakeRateLimitExceeded is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonHandshakeRateLimitExceeded = "HANDSHAKE_RATE_LIMIT_EXCEEDED" - - // ConstraintViolationExceptionReasonOuNumberLimitExceeded is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonOuNumberLimitExceeded = "OU_NUMBER_LIMIT_EXCEEDED" - - // ConstraintViolationExceptionReasonOuDepthLimitExceeded is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonOuDepthLimitExceeded = "OU_DEPTH_LIMIT_EXCEEDED" - - // ConstraintViolationExceptionReasonPolicyNumberLimitExceeded is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonPolicyNumberLimitExceeded = "POLICY_NUMBER_LIMIT_EXCEEDED" - - // ConstraintViolationExceptionReasonPolicyContentLimitExceeded is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonPolicyContentLimitExceeded = "POLICY_CONTENT_LIMIT_EXCEEDED" - - // ConstraintViolationExceptionReasonMaxPolicyTypeAttachmentLimitExceeded is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonMaxPolicyTypeAttachmentLimitExceeded = "MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED" - - // ConstraintViolationExceptionReasonMinPolicyTypeAttachmentLimitExceeded is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonMinPolicyTypeAttachmentLimitExceeded = "MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED" - - // ConstraintViolationExceptionReasonAccountCannotLeaveOrganization is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonAccountCannotLeaveOrganization = "ACCOUNT_CANNOT_LEAVE_ORGANIZATION" - - // ConstraintViolationExceptionReasonAccountCannotLeaveWithoutEula is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonAccountCannotLeaveWithoutEula = "ACCOUNT_CANNOT_LEAVE_WITHOUT_EULA" - - // ConstraintViolationExceptionReasonAccountCannotLeaveWithoutPhoneVerification is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonAccountCannotLeaveWithoutPhoneVerification = "ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION" - - // ConstraintViolationExceptionReasonMasterAccountPaymentInstrumentRequired is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonMasterAccountPaymentInstrumentRequired = "MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED" - - // ConstraintViolationExceptionReasonMemberAccountPaymentInstrumentRequired is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonMemberAccountPaymentInstrumentRequired = "MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED" - - // ConstraintViolationExceptionReasonAccountCreationRateLimitExceeded is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonAccountCreationRateLimitExceeded = "ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED" - - // ConstraintViolationExceptionReasonMasterAccountAddressDoesNotMatchMarketplace is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonMasterAccountAddressDoesNotMatchMarketplace = "MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE" - - // ConstraintViolationExceptionReasonMasterAccountMissingContactInfo is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonMasterAccountMissingContactInfo = "MASTER_ACCOUNT_MISSING_CONTACT_INFO" - - // ConstraintViolationExceptionReasonMasterAccountNotGovcloudEnabled is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonMasterAccountNotGovcloudEnabled = "MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED" - - // ConstraintViolationExceptionReasonOrganizationNotInAllFeaturesMode is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonOrganizationNotInAllFeaturesMode = "ORGANIZATION_NOT_IN_ALL_FEATURES_MODE" - - // ConstraintViolationExceptionReasonCreateOrganizationInBillingModeUnsupportedRegion is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonCreateOrganizationInBillingModeUnsupportedRegion = "CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION" - - // ConstraintViolationExceptionReasonEmailVerificationCodeExpired is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonEmailVerificationCodeExpired = "EMAIL_VERIFICATION_CODE_EXPIRED" - - // ConstraintViolationExceptionReasonWaitPeriodActive is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonWaitPeriodActive = "WAIT_PERIOD_ACTIVE" - - // ConstraintViolationExceptionReasonMaxTagLimitExceeded is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonMaxTagLimitExceeded = "MAX_TAG_LIMIT_EXCEEDED" - - // ConstraintViolationExceptionReasonTagPolicyViolation is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonTagPolicyViolation = "TAG_POLICY_VIOLATION" - - // ConstraintViolationExceptionReasonMaxDelegatedAdministratorsForServiceLimitExceeded is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonMaxDelegatedAdministratorsForServiceLimitExceeded = "MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED" - - // ConstraintViolationExceptionReasonCannotRegisterMasterAsDelegatedAdministrator is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonCannotRegisterMasterAsDelegatedAdministrator = "CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR" - - // ConstraintViolationExceptionReasonCannotRemoveDelegatedAdministratorFromOrg is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonCannotRemoveDelegatedAdministratorFromOrg = "CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG" - - // ConstraintViolationExceptionReasonDelegatedAdministratorExistsForThisService is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonDelegatedAdministratorExistsForThisService = "DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE" - - // ConstraintViolationExceptionReasonMasterAccountMissingBusinessLicense is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonMasterAccountMissingBusinessLicense = "MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE" - - // ConstraintViolationExceptionReasonCannotCloseManagementAccount is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonCannotCloseManagementAccount = "CANNOT_CLOSE_MANAGEMENT_ACCOUNT" - - // ConstraintViolationExceptionReasonCloseAccountQuotaExceeded is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonCloseAccountQuotaExceeded = "CLOSE_ACCOUNT_QUOTA_EXCEEDED" - - // ConstraintViolationExceptionReasonCloseAccountRequestsLimitExceeded is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonCloseAccountRequestsLimitExceeded = "CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED" - - // ConstraintViolationExceptionReasonServiceAccessNotEnabled is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonServiceAccessNotEnabled = "SERVICE_ACCESS_NOT_ENABLED" - - // ConstraintViolationExceptionReasonInvalidPaymentInstrument is a ConstraintViolationExceptionReason enum value - ConstraintViolationExceptionReasonInvalidPaymentInstrument = "INVALID_PAYMENT_INSTRUMENT" -) - -// ConstraintViolationExceptionReason_Values returns all elements of the ConstraintViolationExceptionReason enum -func ConstraintViolationExceptionReason_Values() []string { - return []string{ - ConstraintViolationExceptionReasonAccountNumberLimitExceeded, - ConstraintViolationExceptionReasonHandshakeRateLimitExceeded, - ConstraintViolationExceptionReasonOuNumberLimitExceeded, - ConstraintViolationExceptionReasonOuDepthLimitExceeded, - ConstraintViolationExceptionReasonPolicyNumberLimitExceeded, - ConstraintViolationExceptionReasonPolicyContentLimitExceeded, - ConstraintViolationExceptionReasonMaxPolicyTypeAttachmentLimitExceeded, - ConstraintViolationExceptionReasonMinPolicyTypeAttachmentLimitExceeded, - ConstraintViolationExceptionReasonAccountCannotLeaveOrganization, - ConstraintViolationExceptionReasonAccountCannotLeaveWithoutEula, - ConstraintViolationExceptionReasonAccountCannotLeaveWithoutPhoneVerification, - ConstraintViolationExceptionReasonMasterAccountPaymentInstrumentRequired, - ConstraintViolationExceptionReasonMemberAccountPaymentInstrumentRequired, - ConstraintViolationExceptionReasonAccountCreationRateLimitExceeded, - ConstraintViolationExceptionReasonMasterAccountAddressDoesNotMatchMarketplace, - ConstraintViolationExceptionReasonMasterAccountMissingContactInfo, - ConstraintViolationExceptionReasonMasterAccountNotGovcloudEnabled, - ConstraintViolationExceptionReasonOrganizationNotInAllFeaturesMode, - ConstraintViolationExceptionReasonCreateOrganizationInBillingModeUnsupportedRegion, - ConstraintViolationExceptionReasonEmailVerificationCodeExpired, - ConstraintViolationExceptionReasonWaitPeriodActive, - ConstraintViolationExceptionReasonMaxTagLimitExceeded, - ConstraintViolationExceptionReasonTagPolicyViolation, - ConstraintViolationExceptionReasonMaxDelegatedAdministratorsForServiceLimitExceeded, - ConstraintViolationExceptionReasonCannotRegisterMasterAsDelegatedAdministrator, - ConstraintViolationExceptionReasonCannotRemoveDelegatedAdministratorFromOrg, - ConstraintViolationExceptionReasonDelegatedAdministratorExistsForThisService, - ConstraintViolationExceptionReasonMasterAccountMissingBusinessLicense, - ConstraintViolationExceptionReasonCannotCloseManagementAccount, - ConstraintViolationExceptionReasonCloseAccountQuotaExceeded, - ConstraintViolationExceptionReasonCloseAccountRequestsLimitExceeded, - ConstraintViolationExceptionReasonServiceAccessNotEnabled, - ConstraintViolationExceptionReasonInvalidPaymentInstrument, - } -} - -const ( - // CreateAccountFailureReasonAccountLimitExceeded is a CreateAccountFailureReason enum value - CreateAccountFailureReasonAccountLimitExceeded = "ACCOUNT_LIMIT_EXCEEDED" - - // CreateAccountFailureReasonEmailAlreadyExists is a CreateAccountFailureReason enum value - CreateAccountFailureReasonEmailAlreadyExists = "EMAIL_ALREADY_EXISTS" - - // CreateAccountFailureReasonInvalidAddress is a CreateAccountFailureReason enum value - CreateAccountFailureReasonInvalidAddress = "INVALID_ADDRESS" - - // CreateAccountFailureReasonInvalidEmail is a CreateAccountFailureReason enum value - CreateAccountFailureReasonInvalidEmail = "INVALID_EMAIL" - - // CreateAccountFailureReasonConcurrentAccountModification is a CreateAccountFailureReason enum value - CreateAccountFailureReasonConcurrentAccountModification = "CONCURRENT_ACCOUNT_MODIFICATION" - - // CreateAccountFailureReasonInternalFailure is a CreateAccountFailureReason enum value - CreateAccountFailureReasonInternalFailure = "INTERNAL_FAILURE" - - // CreateAccountFailureReasonGovcloudAccountAlreadyExists is a CreateAccountFailureReason enum value - CreateAccountFailureReasonGovcloudAccountAlreadyExists = "GOVCLOUD_ACCOUNT_ALREADY_EXISTS" - - // CreateAccountFailureReasonMissingBusinessValidation is a CreateAccountFailureReason enum value - CreateAccountFailureReasonMissingBusinessValidation = "MISSING_BUSINESS_VALIDATION" - - // CreateAccountFailureReasonFailedBusinessValidation is a CreateAccountFailureReason enum value - CreateAccountFailureReasonFailedBusinessValidation = "FAILED_BUSINESS_VALIDATION" - - // CreateAccountFailureReasonPendingBusinessValidation is a CreateAccountFailureReason enum value - CreateAccountFailureReasonPendingBusinessValidation = "PENDING_BUSINESS_VALIDATION" - - // CreateAccountFailureReasonInvalidIdentityForBusinessValidation is a CreateAccountFailureReason enum value - CreateAccountFailureReasonInvalidIdentityForBusinessValidation = "INVALID_IDENTITY_FOR_BUSINESS_VALIDATION" - - // CreateAccountFailureReasonUnknownBusinessValidation is a CreateAccountFailureReason enum value - CreateAccountFailureReasonUnknownBusinessValidation = "UNKNOWN_BUSINESS_VALIDATION" - - // CreateAccountFailureReasonMissingPaymentInstrument is a CreateAccountFailureReason enum value - CreateAccountFailureReasonMissingPaymentInstrument = "MISSING_PAYMENT_INSTRUMENT" - - // CreateAccountFailureReasonInvalidPaymentInstrument is a CreateAccountFailureReason enum value - CreateAccountFailureReasonInvalidPaymentInstrument = "INVALID_PAYMENT_INSTRUMENT" - - // CreateAccountFailureReasonUpdateExistingResourcePolicyWithTagsNotSupported is a CreateAccountFailureReason enum value - CreateAccountFailureReasonUpdateExistingResourcePolicyWithTagsNotSupported = "UPDATE_EXISTING_RESOURCE_POLICY_WITH_TAGS_NOT_SUPPORTED" -) - -// CreateAccountFailureReason_Values returns all elements of the CreateAccountFailureReason enum -func CreateAccountFailureReason_Values() []string { - return []string{ - CreateAccountFailureReasonAccountLimitExceeded, - CreateAccountFailureReasonEmailAlreadyExists, - CreateAccountFailureReasonInvalidAddress, - CreateAccountFailureReasonInvalidEmail, - CreateAccountFailureReasonConcurrentAccountModification, - CreateAccountFailureReasonInternalFailure, - CreateAccountFailureReasonGovcloudAccountAlreadyExists, - CreateAccountFailureReasonMissingBusinessValidation, - CreateAccountFailureReasonFailedBusinessValidation, - CreateAccountFailureReasonPendingBusinessValidation, - CreateAccountFailureReasonInvalidIdentityForBusinessValidation, - CreateAccountFailureReasonUnknownBusinessValidation, - CreateAccountFailureReasonMissingPaymentInstrument, - CreateAccountFailureReasonInvalidPaymentInstrument, - CreateAccountFailureReasonUpdateExistingResourcePolicyWithTagsNotSupported, - } -} - -const ( - // CreateAccountStateInProgress is a CreateAccountState enum value - CreateAccountStateInProgress = "IN_PROGRESS" - - // CreateAccountStateSucceeded is a CreateAccountState enum value - CreateAccountStateSucceeded = "SUCCEEDED" - - // CreateAccountStateFailed is a CreateAccountState enum value - CreateAccountStateFailed = "FAILED" -) - -// CreateAccountState_Values returns all elements of the CreateAccountState enum -func CreateAccountState_Values() []string { - return []string{ - CreateAccountStateInProgress, - CreateAccountStateSucceeded, - CreateAccountStateFailed, - } -} - -const ( - // EffectivePolicyTypeTagPolicy is a EffectivePolicyType enum value - EffectivePolicyTypeTagPolicy = "TAG_POLICY" - - // EffectivePolicyTypeBackupPolicy is a EffectivePolicyType enum value - EffectivePolicyTypeBackupPolicy = "BACKUP_POLICY" - - // EffectivePolicyTypeAiservicesOptOutPolicy is a EffectivePolicyType enum value - EffectivePolicyTypeAiservicesOptOutPolicy = "AISERVICES_OPT_OUT_POLICY" -) - -// EffectivePolicyType_Values returns all elements of the EffectivePolicyType enum -func EffectivePolicyType_Values() []string { - return []string{ - EffectivePolicyTypeTagPolicy, - EffectivePolicyTypeBackupPolicy, - EffectivePolicyTypeAiservicesOptOutPolicy, - } -} - -const ( - // HandshakeConstraintViolationExceptionReasonAccountNumberLimitExceeded is a HandshakeConstraintViolationExceptionReason enum value - HandshakeConstraintViolationExceptionReasonAccountNumberLimitExceeded = "ACCOUNT_NUMBER_LIMIT_EXCEEDED" - - // HandshakeConstraintViolationExceptionReasonHandshakeRateLimitExceeded is a HandshakeConstraintViolationExceptionReason enum value - HandshakeConstraintViolationExceptionReasonHandshakeRateLimitExceeded = "HANDSHAKE_RATE_LIMIT_EXCEEDED" - - // HandshakeConstraintViolationExceptionReasonAlreadyInAnOrganization is a HandshakeConstraintViolationExceptionReason enum value - HandshakeConstraintViolationExceptionReasonAlreadyInAnOrganization = "ALREADY_IN_AN_ORGANIZATION" - - // HandshakeConstraintViolationExceptionReasonOrganizationAlreadyHasAllFeatures is a HandshakeConstraintViolationExceptionReason enum value - HandshakeConstraintViolationExceptionReasonOrganizationAlreadyHasAllFeatures = "ORGANIZATION_ALREADY_HAS_ALL_FEATURES" - - // HandshakeConstraintViolationExceptionReasonOrganizationIsAlreadyPendingAllFeaturesMigration is a HandshakeConstraintViolationExceptionReason enum value - HandshakeConstraintViolationExceptionReasonOrganizationIsAlreadyPendingAllFeaturesMigration = "ORGANIZATION_IS_ALREADY_PENDING_ALL_FEATURES_MIGRATION" - - // HandshakeConstraintViolationExceptionReasonInviteDisabledDuringEnableAllFeatures is a HandshakeConstraintViolationExceptionReason enum value - HandshakeConstraintViolationExceptionReasonInviteDisabledDuringEnableAllFeatures = "INVITE_DISABLED_DURING_ENABLE_ALL_FEATURES" - - // HandshakeConstraintViolationExceptionReasonPaymentInstrumentRequired is a HandshakeConstraintViolationExceptionReason enum value - HandshakeConstraintViolationExceptionReasonPaymentInstrumentRequired = "PAYMENT_INSTRUMENT_REQUIRED" - - // HandshakeConstraintViolationExceptionReasonOrganizationFromDifferentSellerOfRecord is a HandshakeConstraintViolationExceptionReason enum value - HandshakeConstraintViolationExceptionReasonOrganizationFromDifferentSellerOfRecord = "ORGANIZATION_FROM_DIFFERENT_SELLER_OF_RECORD" - - // HandshakeConstraintViolationExceptionReasonOrganizationMembershipChangeRateLimitExceeded is a HandshakeConstraintViolationExceptionReason enum value - HandshakeConstraintViolationExceptionReasonOrganizationMembershipChangeRateLimitExceeded = "ORGANIZATION_MEMBERSHIP_CHANGE_RATE_LIMIT_EXCEEDED" - - // HandshakeConstraintViolationExceptionReasonManagementAccountEmailNotVerified is a HandshakeConstraintViolationExceptionReason enum value - HandshakeConstraintViolationExceptionReasonManagementAccountEmailNotVerified = "MANAGEMENT_ACCOUNT_EMAIL_NOT_VERIFIED" -) - -// HandshakeConstraintViolationExceptionReason_Values returns all elements of the HandshakeConstraintViolationExceptionReason enum -func HandshakeConstraintViolationExceptionReason_Values() []string { - return []string{ - HandshakeConstraintViolationExceptionReasonAccountNumberLimitExceeded, - HandshakeConstraintViolationExceptionReasonHandshakeRateLimitExceeded, - HandshakeConstraintViolationExceptionReasonAlreadyInAnOrganization, - HandshakeConstraintViolationExceptionReasonOrganizationAlreadyHasAllFeatures, - HandshakeConstraintViolationExceptionReasonOrganizationIsAlreadyPendingAllFeaturesMigration, - HandshakeConstraintViolationExceptionReasonInviteDisabledDuringEnableAllFeatures, - HandshakeConstraintViolationExceptionReasonPaymentInstrumentRequired, - HandshakeConstraintViolationExceptionReasonOrganizationFromDifferentSellerOfRecord, - HandshakeConstraintViolationExceptionReasonOrganizationMembershipChangeRateLimitExceeded, - HandshakeConstraintViolationExceptionReasonManagementAccountEmailNotVerified, - } -} - -const ( - // HandshakePartyTypeAccount is a HandshakePartyType enum value - HandshakePartyTypeAccount = "ACCOUNT" - - // HandshakePartyTypeOrganization is a HandshakePartyType enum value - HandshakePartyTypeOrganization = "ORGANIZATION" - - // HandshakePartyTypeEmail is a HandshakePartyType enum value - HandshakePartyTypeEmail = "EMAIL" -) - -// HandshakePartyType_Values returns all elements of the HandshakePartyType enum -func HandshakePartyType_Values() []string { - return []string{ - HandshakePartyTypeAccount, - HandshakePartyTypeOrganization, - HandshakePartyTypeEmail, - } -} - -const ( - // HandshakeResourceTypeAccount is a HandshakeResourceType enum value - HandshakeResourceTypeAccount = "ACCOUNT" - - // HandshakeResourceTypeOrganization is a HandshakeResourceType enum value - HandshakeResourceTypeOrganization = "ORGANIZATION" - - // HandshakeResourceTypeOrganizationFeatureSet is a HandshakeResourceType enum value - HandshakeResourceTypeOrganizationFeatureSet = "ORGANIZATION_FEATURE_SET" - - // HandshakeResourceTypeEmail is a HandshakeResourceType enum value - HandshakeResourceTypeEmail = "EMAIL" - - // HandshakeResourceTypeMasterEmail is a HandshakeResourceType enum value - HandshakeResourceTypeMasterEmail = "MASTER_EMAIL" - - // HandshakeResourceTypeMasterName is a HandshakeResourceType enum value - HandshakeResourceTypeMasterName = "MASTER_NAME" - - // HandshakeResourceTypeNotes is a HandshakeResourceType enum value - HandshakeResourceTypeNotes = "NOTES" - - // HandshakeResourceTypeParentHandshake is a HandshakeResourceType enum value - HandshakeResourceTypeParentHandshake = "PARENT_HANDSHAKE" -) - -// HandshakeResourceType_Values returns all elements of the HandshakeResourceType enum -func HandshakeResourceType_Values() []string { - return []string{ - HandshakeResourceTypeAccount, - HandshakeResourceTypeOrganization, - HandshakeResourceTypeOrganizationFeatureSet, - HandshakeResourceTypeEmail, - HandshakeResourceTypeMasterEmail, - HandshakeResourceTypeMasterName, - HandshakeResourceTypeNotes, - HandshakeResourceTypeParentHandshake, - } -} - -const ( - // HandshakeStateRequested is a HandshakeState enum value - HandshakeStateRequested = "REQUESTED" - - // HandshakeStateOpen is a HandshakeState enum value - HandshakeStateOpen = "OPEN" - - // HandshakeStateCanceled is a HandshakeState enum value - HandshakeStateCanceled = "CANCELED" - - // HandshakeStateAccepted is a HandshakeState enum value - HandshakeStateAccepted = "ACCEPTED" - - // HandshakeStateDeclined is a HandshakeState enum value - HandshakeStateDeclined = "DECLINED" - - // HandshakeStateExpired is a HandshakeState enum value - HandshakeStateExpired = "EXPIRED" -) - -// HandshakeState_Values returns all elements of the HandshakeState enum -func HandshakeState_Values() []string { - return []string{ - HandshakeStateRequested, - HandshakeStateOpen, - HandshakeStateCanceled, - HandshakeStateAccepted, - HandshakeStateDeclined, - HandshakeStateExpired, - } -} - -const ( - // IAMUserAccessToBillingAllow is a IAMUserAccessToBilling enum value - IAMUserAccessToBillingAllow = "ALLOW" - - // IAMUserAccessToBillingDeny is a IAMUserAccessToBilling enum value - IAMUserAccessToBillingDeny = "DENY" -) - -// IAMUserAccessToBilling_Values returns all elements of the IAMUserAccessToBilling enum -func IAMUserAccessToBilling_Values() []string { - return []string{ - IAMUserAccessToBillingAllow, - IAMUserAccessToBillingDeny, - } -} - -const ( - // InvalidInputExceptionReasonInvalidPartyTypeTarget is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonInvalidPartyTypeTarget = "INVALID_PARTY_TYPE_TARGET" - - // InvalidInputExceptionReasonInvalidSyntaxOrganizationArn is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonInvalidSyntaxOrganizationArn = "INVALID_SYNTAX_ORGANIZATION_ARN" - - // InvalidInputExceptionReasonInvalidSyntaxPolicyId is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonInvalidSyntaxPolicyId = "INVALID_SYNTAX_POLICY_ID" - - // InvalidInputExceptionReasonInvalidEnum is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonInvalidEnum = "INVALID_ENUM" - - // InvalidInputExceptionReasonInvalidEnumPolicyType is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonInvalidEnumPolicyType = "INVALID_ENUM_POLICY_TYPE" - - // InvalidInputExceptionReasonInvalidListMember is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonInvalidListMember = "INVALID_LIST_MEMBER" - - // InvalidInputExceptionReasonMaxLengthExceeded is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonMaxLengthExceeded = "MAX_LENGTH_EXCEEDED" - - // InvalidInputExceptionReasonMaxValueExceeded is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonMaxValueExceeded = "MAX_VALUE_EXCEEDED" - - // InvalidInputExceptionReasonMinLengthExceeded is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonMinLengthExceeded = "MIN_LENGTH_EXCEEDED" - - // InvalidInputExceptionReasonMinValueExceeded is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonMinValueExceeded = "MIN_VALUE_EXCEEDED" - - // InvalidInputExceptionReasonImmutablePolicy is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonImmutablePolicy = "IMMUTABLE_POLICY" - - // InvalidInputExceptionReasonInvalidPattern is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonInvalidPattern = "INVALID_PATTERN" - - // InvalidInputExceptionReasonInvalidPatternTargetId is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonInvalidPatternTargetId = "INVALID_PATTERN_TARGET_ID" - - // InvalidInputExceptionReasonInputRequired is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonInputRequired = "INPUT_REQUIRED" - - // InvalidInputExceptionReasonInvalidNextToken is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonInvalidNextToken = "INVALID_NEXT_TOKEN" - - // InvalidInputExceptionReasonMaxLimitExceededFilter is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonMaxLimitExceededFilter = "MAX_LIMIT_EXCEEDED_FILTER" - - // InvalidInputExceptionReasonMovingAccountBetweenDifferentRoots is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonMovingAccountBetweenDifferentRoots = "MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS" - - // InvalidInputExceptionReasonInvalidFullNameTarget is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonInvalidFullNameTarget = "INVALID_FULL_NAME_TARGET" - - // InvalidInputExceptionReasonUnrecognizedServicePrincipal is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonUnrecognizedServicePrincipal = "UNRECOGNIZED_SERVICE_PRINCIPAL" - - // InvalidInputExceptionReasonInvalidRoleName is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonInvalidRoleName = "INVALID_ROLE_NAME" - - // InvalidInputExceptionReasonInvalidSystemTagsParameter is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonInvalidSystemTagsParameter = "INVALID_SYSTEM_TAGS_PARAMETER" - - // InvalidInputExceptionReasonDuplicateTagKey is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonDuplicateTagKey = "DUPLICATE_TAG_KEY" - - // InvalidInputExceptionReasonTargetNotSupported is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonTargetNotSupported = "TARGET_NOT_SUPPORTED" - - // InvalidInputExceptionReasonInvalidEmailAddressTarget is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonInvalidEmailAddressTarget = "INVALID_EMAIL_ADDRESS_TARGET" - - // InvalidInputExceptionReasonInvalidResourcePolicyJson is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonInvalidResourcePolicyJson = "INVALID_RESOURCE_POLICY_JSON" - - // InvalidInputExceptionReasonUnsupportedActionInResourcePolicy is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonUnsupportedActionInResourcePolicy = "UNSUPPORTED_ACTION_IN_RESOURCE_POLICY" - - // InvalidInputExceptionReasonUnsupportedPolicyTypeInResourcePolicy is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonUnsupportedPolicyTypeInResourcePolicy = "UNSUPPORTED_POLICY_TYPE_IN_RESOURCE_POLICY" - - // InvalidInputExceptionReasonUnsupportedResourceInResourcePolicy is a InvalidInputExceptionReason enum value - InvalidInputExceptionReasonUnsupportedResourceInResourcePolicy = "UNSUPPORTED_RESOURCE_IN_RESOURCE_POLICY" -) - -// InvalidInputExceptionReason_Values returns all elements of the InvalidInputExceptionReason enum -func InvalidInputExceptionReason_Values() []string { - return []string{ - InvalidInputExceptionReasonInvalidPartyTypeTarget, - InvalidInputExceptionReasonInvalidSyntaxOrganizationArn, - InvalidInputExceptionReasonInvalidSyntaxPolicyId, - InvalidInputExceptionReasonInvalidEnum, - InvalidInputExceptionReasonInvalidEnumPolicyType, - InvalidInputExceptionReasonInvalidListMember, - InvalidInputExceptionReasonMaxLengthExceeded, - InvalidInputExceptionReasonMaxValueExceeded, - InvalidInputExceptionReasonMinLengthExceeded, - InvalidInputExceptionReasonMinValueExceeded, - InvalidInputExceptionReasonImmutablePolicy, - InvalidInputExceptionReasonInvalidPattern, - InvalidInputExceptionReasonInvalidPatternTargetId, - InvalidInputExceptionReasonInputRequired, - InvalidInputExceptionReasonInvalidNextToken, - InvalidInputExceptionReasonMaxLimitExceededFilter, - InvalidInputExceptionReasonMovingAccountBetweenDifferentRoots, - InvalidInputExceptionReasonInvalidFullNameTarget, - InvalidInputExceptionReasonUnrecognizedServicePrincipal, - InvalidInputExceptionReasonInvalidRoleName, - InvalidInputExceptionReasonInvalidSystemTagsParameter, - InvalidInputExceptionReasonDuplicateTagKey, - InvalidInputExceptionReasonTargetNotSupported, - InvalidInputExceptionReasonInvalidEmailAddressTarget, - InvalidInputExceptionReasonInvalidResourcePolicyJson, - InvalidInputExceptionReasonUnsupportedActionInResourcePolicy, - InvalidInputExceptionReasonUnsupportedPolicyTypeInResourcePolicy, - InvalidInputExceptionReasonUnsupportedResourceInResourcePolicy, - } -} - -const ( - // OrganizationFeatureSetAll is a OrganizationFeatureSet enum value - OrganizationFeatureSetAll = "ALL" - - // OrganizationFeatureSetConsolidatedBilling is a OrganizationFeatureSet enum value - OrganizationFeatureSetConsolidatedBilling = "CONSOLIDATED_BILLING" -) - -// OrganizationFeatureSet_Values returns all elements of the OrganizationFeatureSet enum -func OrganizationFeatureSet_Values() []string { - return []string{ - OrganizationFeatureSetAll, - OrganizationFeatureSetConsolidatedBilling, - } -} - -const ( - // ParentTypeRoot is a ParentType enum value - ParentTypeRoot = "ROOT" - - // ParentTypeOrganizationalUnit is a ParentType enum value - ParentTypeOrganizationalUnit = "ORGANIZATIONAL_UNIT" -) - -// ParentType_Values returns all elements of the ParentType enum -func ParentType_Values() []string { - return []string{ - ParentTypeRoot, - ParentTypeOrganizationalUnit, - } -} - -const ( - // PolicyTypeServiceControlPolicy is a PolicyType enum value - PolicyTypeServiceControlPolicy = "SERVICE_CONTROL_POLICY" - - // PolicyTypeTagPolicy is a PolicyType enum value - PolicyTypeTagPolicy = "TAG_POLICY" - - // PolicyTypeBackupPolicy is a PolicyType enum value - PolicyTypeBackupPolicy = "BACKUP_POLICY" - - // PolicyTypeAiservicesOptOutPolicy is a PolicyType enum value - PolicyTypeAiservicesOptOutPolicy = "AISERVICES_OPT_OUT_POLICY" -) - -// PolicyType_Values returns all elements of the PolicyType enum -func PolicyType_Values() []string { - return []string{ - PolicyTypeServiceControlPolicy, - PolicyTypeTagPolicy, - PolicyTypeBackupPolicy, - PolicyTypeAiservicesOptOutPolicy, - } -} - -const ( - // PolicyTypeStatusEnabled is a PolicyTypeStatus enum value - PolicyTypeStatusEnabled = "ENABLED" - - // PolicyTypeStatusPendingEnable is a PolicyTypeStatus enum value - PolicyTypeStatusPendingEnable = "PENDING_ENABLE" - - // PolicyTypeStatusPendingDisable is a PolicyTypeStatus enum value - PolicyTypeStatusPendingDisable = "PENDING_DISABLE" -) - -// PolicyTypeStatus_Values returns all elements of the PolicyTypeStatus enum -func PolicyTypeStatus_Values() []string { - return []string{ - PolicyTypeStatusEnabled, - PolicyTypeStatusPendingEnable, - PolicyTypeStatusPendingDisable, - } -} - -const ( - // TargetTypeAccount is a TargetType enum value - TargetTypeAccount = "ACCOUNT" - - // TargetTypeOrganizationalUnit is a TargetType enum value - TargetTypeOrganizationalUnit = "ORGANIZATIONAL_UNIT" - - // TargetTypeRoot is a TargetType enum value - TargetTypeRoot = "ROOT" -) - -// TargetType_Values returns all elements of the TargetType enum -func TargetType_Values() []string { - return []string{ - TargetTypeAccount, - TargetTypeOrganizationalUnit, - TargetTypeRoot, - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/organizations/doc.go b/vendor/github.com/aws/aws-sdk-go/service/organizations/doc.go deleted file mode 100644 index ef00291ac3..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/organizations/doc.go +++ /dev/null @@ -1,77 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package organizations provides the client and types for making API -// requests to AWS Organizations. -// -// Organizations is a web service that enables you to consolidate your multiple -// Amazon Web Services accounts into an organization and centrally manage your -// accounts and their resources. -// -// This guide provides descriptions of the Organizations operations. For more -// information about using this service, see the Organizations User Guide (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_introduction.html). -// -// # Support and feedback for Organizations -// -// We welcome your feedback. Send your comments to feedback-awsorganizations@amazon.com -// (mailto:feedback-awsorganizations@amazon.com) or post your feedback and questions -// in the Organizations support forum (http://forums.aws.amazon.com/forum.jspa?forumID=219). -// For more information about the Amazon Web Services support forums, see Forums -// Help (http://forums.aws.amazon.com/help.jspa). -// -// # Endpoint to call When using the CLI or the Amazon Web Services SDK -// -// For the current release of Organizations, specify the us-east-1 region for -// all Amazon Web Services API and CLI calls made from the commercial Amazon -// Web Services Regions outside of China. If calling from one of the Amazon -// Web Services Regions in China, then specify cn-northwest-1. You can do this -// in the CLI by using these parameters and commands: -// -// - Use the following parameter with each command to specify both the endpoint -// and its region: --endpoint-url https://organizations.us-east-1.amazonaws.com -// (from commercial Amazon Web Services Regions outside of China) or --endpoint-url -// https://organizations.cn-northwest-1.amazonaws.com.cn (from Amazon Web -// Services Regions in China) -// -// - Use the default endpoint, but configure your default region with this -// command: aws configure set default.region us-east-1 (from commercial Amazon -// Web Services Regions outside of China) or aws configure set default.region -// cn-northwest-1 (from Amazon Web Services Regions in China) -// -// - Use the following parameter with each command to specify the endpoint: -// --region us-east-1 (from commercial Amazon Web Services Regions outside -// of China) or --region cn-northwest-1 (from Amazon Web Services Regions -// in China) -// -// # Recording API Requests -// -// Organizations supports CloudTrail, a service that records Amazon Web Services -// API calls for your Amazon Web Services account and delivers log files to -// an Amazon S3 bucket. By using information collected by CloudTrail, you can -// determine which requests the Organizations service received, who made the -// request and when, and so on. For more about Organizations and its support -// for CloudTrail, see Logging Organizations Events with CloudTrail (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_incident-response.html#orgs_cloudtrail-integration) -// in the Organizations User Guide. To learn more about CloudTrail, including -// how to turn it on and find your log files, see the CloudTrail User Guide -// (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/what_is_cloud_trail_top_level.html). -// -// See https://docs.aws.amazon.com/goto/WebAPI/organizations-2016-11-28 for more information on this service. -// -// See organizations package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/organizations/ -// -// # Using the Client -// -// To contact AWS Organizations with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS Organizations client Organizations for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/organizations/#New -package organizations diff --git a/vendor/github.com/aws/aws-sdk-go/service/organizations/errors.go b/vendor/github.com/aws/aws-sdk-go/service/organizations/errors.go deleted file mode 100644 index 9174ef3745..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/organizations/errors.go +++ /dev/null @@ -1,673 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package organizations - -import ( - "github.com/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeAWSOrganizationsNotInUseException for service response error code - // "AWSOrganizationsNotInUseException". - // - // Your account isn't a member of an organization. To make this request, you - // must use the credentials of an account that belongs to an organization. - ErrCodeAWSOrganizationsNotInUseException = "AWSOrganizationsNotInUseException" - - // ErrCodeAccessDeniedException for service response error code - // "AccessDeniedException". - // - // You don't have permissions to perform the requested operation. The user or - // role that is making the request must have at least one IAM permissions policy - // attached that grants the required permissions. For more information, see - // Access Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) - // in the IAM User Guide. - ErrCodeAccessDeniedException = "AccessDeniedException" - - // ErrCodeAccessDeniedForDependencyException for service response error code - // "AccessDeniedForDependencyException". - // - // The operation that you attempted requires you to have the iam:CreateServiceLinkedRole - // for organizations.amazonaws.com permission so that Organizations can create - // the required service-linked role. You don't have that permission. - ErrCodeAccessDeniedForDependencyException = "AccessDeniedForDependencyException" - - // ErrCodeAccountAlreadyClosedException for service response error code - // "AccountAlreadyClosedException". - // - // You attempted to close an account that is already closed. - ErrCodeAccountAlreadyClosedException = "AccountAlreadyClosedException" - - // ErrCodeAccountAlreadyRegisteredException for service response error code - // "AccountAlreadyRegisteredException". - // - // The specified account is already a delegated administrator for this Amazon - // Web Services service. - ErrCodeAccountAlreadyRegisteredException = "AccountAlreadyRegisteredException" - - // ErrCodeAccountNotFoundException for service response error code - // "AccountNotFoundException". - // - // We can't find an Amazon Web Services account with the AccountId that you - // specified, or the account whose credentials you used to make this request - // isn't a member of an organization. - ErrCodeAccountNotFoundException = "AccountNotFoundException" - - // ErrCodeAccountNotRegisteredException for service response error code - // "AccountNotRegisteredException". - // - // The specified account is not a delegated administrator for this Amazon Web - // Services service. - ErrCodeAccountNotRegisteredException = "AccountNotRegisteredException" - - // ErrCodeAccountOwnerNotVerifiedException for service response error code - // "AccountOwnerNotVerifiedException". - // - // You can't invite an existing account to your organization until you verify - // that you own the email address associated with the management account. For - // more information, see Email Address Verification (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_create.html#about-email-verification) - // in the Organizations User Guide. - ErrCodeAccountOwnerNotVerifiedException = "AccountOwnerNotVerifiedException" - - // ErrCodeAlreadyInOrganizationException for service response error code - // "AlreadyInOrganizationException". - // - // This account is already a member of an organization. An account can belong - // to only one organization at a time. - ErrCodeAlreadyInOrganizationException = "AlreadyInOrganizationException" - - // ErrCodeChildNotFoundException for service response error code - // "ChildNotFoundException". - // - // We can't find an organizational unit (OU) or Amazon Web Services account - // with the ChildId that you specified. - ErrCodeChildNotFoundException = "ChildNotFoundException" - - // ErrCodeConcurrentModificationException for service response error code - // "ConcurrentModificationException". - // - // The target of the operation is currently being modified by a different request. - // Try again later. - ErrCodeConcurrentModificationException = "ConcurrentModificationException" - - // ErrCodeConflictException for service response error code - // "ConflictException". - // - // The request failed because it conflicts with the current state of the specified - // resource. - ErrCodeConflictException = "ConflictException" - - // ErrCodeConstraintViolationException for service response error code - // "ConstraintViolationException". - // - // Performing this operation violates a minimum or maximum value limit. For - // example, attempting to remove the last service control policy (SCP) from - // an OU or root, inviting or creating too many accounts to the organization, - // or attaching too many policies to an account, OU, or root. This exception - // includes a reason that contains additional information about the violated - // limit: - // - // Some of the reasons in the following list might not be applicable to this - // specific API or operation. - // - // * ACCOUNT_CANNOT_LEAVE_ORGANIZATION: You attempted to remove the management - // account from the organization. You can't remove the management account. - // Instead, after you remove all member accounts, delete the organization - // itself. - // - // * ACCOUNT_CANNOT_LEAVE_WITHOUT_PHONE_VERIFICATION: You attempted to remove - // an account from the organization that doesn't yet have enough information - // to exist as a standalone account. This account requires you to first complete - // phone verification. Follow the steps at Removing a member account from - // your organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#orgs_manage_accounts_remove-from-master) - // in the Organizations User Guide. - // - // * ACCOUNT_CREATION_RATE_LIMIT_EXCEEDED: You attempted to exceed the number - // of accounts that you can create in one day. - // - // * ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on - // the number of accounts in an organization. If you need more accounts, - // contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/) - // to request an increase in your limit. Or the number of invitations that - // you tried to send would cause you to exceed the limit of accounts in your - // organization. Send fewer invitations or contact Amazon Web Services Support - // to request an increase in the number of accounts. Deleted and closed accounts - // still count toward your limit. If you get this exception when running - // a command immediately after creating the organization, wait one hour and - // try again. After an hour, if the command continues to fail with this error, - // contact Amazon Web Services Support (https://docs.aws.amazon.com/support/home#/). - // - // * CANNOT_REGISTER_MASTER_AS_DELEGATED_ADMINISTRATOR: You attempted to - // register the management account of the organization as a delegated administrator - // for an Amazon Web Services service integrated with Organizations. You - // can designate only a member account as a delegated administrator. - // - // * CANNOT_CLOSE_MANAGEMENT_ACCOUNT: You attempted to close the management - // account. To close the management account for the organization, you must - // first either remove or close all member accounts in the organization. - // Follow standard account closure process using root credentials.​ - // - // * CANNOT_REMOVE_DELEGATED_ADMINISTRATOR_FROM_ORG: You attempted to remove - // an account that is registered as a delegated administrator for a service - // integrated with your organization. To complete this operation, you must - // first deregister this account as a delegated administrator. - // - // * CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota - // for the past 30 days. - // - // * CLOSE_ACCOUNT_REQUESTS_LIMIT_EXCEEDED: You attempted to exceed the number - // of accounts that you can close at a time. ​ - // - // * CREATE_ORGANIZATION_IN_BILLING_MODE_UNSUPPORTED_REGION: To create an - // organization in the specified region, you must enable all features mode. - // - // * DELEGATED_ADMINISTRATOR_EXISTS_FOR_THIS_SERVICE: You attempted to register - // an Amazon Web Services account as a delegated administrator for an Amazon - // Web Services service that already has a delegated administrator. To complete - // this operation, you must first deregister any existing delegated administrators - // for this service. - // - // * EMAIL_VERIFICATION_CODE_EXPIRED: The email verification code is only - // valid for a limited period of time. You must resubmit the request and - // generate a new verfication code. - // - // * HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of - // handshakes that you can send in one day. - // - // * INVALID_PAYMENT_INSTRUMENT: You cannot remove an account because no - // supported payment method is associated with the account. Amazon Web Services - // does not support cards issued by financial institutions in Russia or Belarus. - // For more information, see Managing your Amazon Web Services payments (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/manage-general.html). - // - // * MASTER_ACCOUNT_ADDRESS_DOES_NOT_MATCH_MARKETPLACE: To create an account - // in this organization, you first must migrate the organization's management - // account to the marketplace that corresponds to the management account's - // address. For example, accounts with India addresses must be associated - // with the AISPL marketplace. All accounts in an organization must be associated - // with the same marketplace. - // - // * MASTER_ACCOUNT_MISSING_BUSINESS_LICENSE: Applies only to the Amazon - // Web Services /> Regions in China. To create an organization, the master - // must have a valid business license. For more information, contact customer - // support. - // - // * MASTER_ACCOUNT_MISSING_CONTACT_INFO: To complete this operation, you - // must first provide a valid contact address and phone number for the management - // account. Then try the operation again. - // - // * MASTER_ACCOUNT_NOT_GOVCLOUD_ENABLED: To complete this operation, the - // management account must have an associated account in the Amazon Web Services - // GovCloud (US-West) Region. For more information, see Organizations (https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-organizations.html) - // in the Amazon Web Services GovCloud User Guide. - // - // * MASTER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To create an organization - // with this management account, you first must associate a valid payment - // instrument, such as a credit card, with the account. Follow the steps - // at To leave an organization when all required account information has - // not yet been provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) - // in the Organizations User Guide. - // - // * MAX_DELEGATED_ADMINISTRATORS_FOR_SERVICE_LIMIT_EXCEEDED: You attempted - // to register more delegated administrators than allowed for the service - // principal. - // - // * MAX_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to exceed the - // number of policies of a certain type that can be attached to an entity - // at one time. - // - // * MAX_TAG_LIMIT_EXCEEDED: You have exceeded the number of tags allowed - // on this resource. - // - // * MEMBER_ACCOUNT_PAYMENT_INSTRUMENT_REQUIRED: To complete this operation - // with this member account, you first must associate a valid payment instrument, - // such as a credit card, with the account. Follow the steps at To leave - // an organization when all required account information has not yet been - // provided (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_accounts_remove.html#leave-without-all-info) - // in the Organizations User Guide. - // - // * MIN_POLICY_TYPE_ATTACHMENT_LIMIT_EXCEEDED: You attempted to detach a - // policy from an entity that would cause the entity to have fewer than the - // minimum number of policies of a certain type required. - // - // * ORGANIZATION_NOT_IN_ALL_FEATURES_MODE: You attempted to perform an operation - // that requires the organization to be configured to support all features. - // An organization that supports only consolidated billing features can't - // perform this operation. - // - // * OU_DEPTH_LIMIT_EXCEEDED: You attempted to create an OU tree that is - // too many levels deep. - // - // * OU_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of OUs - // that you can have in an organization. - // - // * POLICY_CONTENT_LIMIT_EXCEEDED: You attempted to create a policy that - // is larger than the maximum size. - // - // * POLICY_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the number of - // policies that you can have in an organization. - // - // * SERVICE_ACCESS_NOT_ENABLED: You attempted to register a delegated administrator - // before you enabled service access. Call the EnableAWSServiceAccess API - // first. - // - // * TAG_POLICY_VIOLATION: You attempted to create or update a resource with - // tags that are not compliant with the tag policy requirements for this - // account. - // - // * WAIT_PERIOD_ACTIVE: After you create an Amazon Web Services account, - // there is a waiting period before you can remove it from the organization. - // If you get an error that indicates that a wait period is required, try - // again in a few days. - ErrCodeConstraintViolationException = "ConstraintViolationException" - - // ErrCodeCreateAccountStatusNotFoundException for service response error code - // "CreateAccountStatusNotFoundException". - // - // We can't find an create account request with the CreateAccountRequestId that - // you specified. - ErrCodeCreateAccountStatusNotFoundException = "CreateAccountStatusNotFoundException" - - // ErrCodeDestinationParentNotFoundException for service response error code - // "DestinationParentNotFoundException". - // - // We can't find the destination container (a root or OU) with the ParentId - // that you specified. - ErrCodeDestinationParentNotFoundException = "DestinationParentNotFoundException" - - // ErrCodeDuplicateAccountException for service response error code - // "DuplicateAccountException". - // - // That account is already present in the specified destination. - ErrCodeDuplicateAccountException = "DuplicateAccountException" - - // ErrCodeDuplicateHandshakeException for service response error code - // "DuplicateHandshakeException". - // - // A handshake with the same action and target already exists. For example, - // if you invited an account to join your organization, the invited account - // might already have a pending invitation from this organization. If you intend - // to resend an invitation to an account, ensure that existing handshakes that - // might be considered duplicates are canceled or declined. - ErrCodeDuplicateHandshakeException = "DuplicateHandshakeException" - - // ErrCodeDuplicateOrganizationalUnitException for service response error code - // "DuplicateOrganizationalUnitException". - // - // An OU with the same name already exists. - ErrCodeDuplicateOrganizationalUnitException = "DuplicateOrganizationalUnitException" - - // ErrCodeDuplicatePolicyAttachmentException for service response error code - // "DuplicatePolicyAttachmentException". - // - // The selected policy is already attached to the specified target. - ErrCodeDuplicatePolicyAttachmentException = "DuplicatePolicyAttachmentException" - - // ErrCodeDuplicatePolicyException for service response error code - // "DuplicatePolicyException". - // - // A policy with the same name already exists. - ErrCodeDuplicatePolicyException = "DuplicatePolicyException" - - // ErrCodeEffectivePolicyNotFoundException for service response error code - // "EffectivePolicyNotFoundException". - // - // If you ran this action on the management account, this policy type is not - // enabled. If you ran the action on a member account, the account doesn't have - // an effective policy of this type. Contact the administrator of your organization - // about attaching a policy of this type to the account. - ErrCodeEffectivePolicyNotFoundException = "EffectivePolicyNotFoundException" - - // ErrCodeFinalizingOrganizationException for service response error code - // "FinalizingOrganizationException". - // - // Organizations couldn't perform the operation because your organization hasn't - // finished initializing. This can take up to an hour. Try again later. If after - // one hour you continue to receive this error, contact Amazon Web Services - // Support (https://console.aws.amazon.com/support/home#/). - ErrCodeFinalizingOrganizationException = "FinalizingOrganizationException" - - // ErrCodeHandshakeAlreadyInStateException for service response error code - // "HandshakeAlreadyInStateException". - // - // The specified handshake is already in the requested state. For example, you - // can't accept a handshake that was already accepted. - ErrCodeHandshakeAlreadyInStateException = "HandshakeAlreadyInStateException" - - // ErrCodeHandshakeConstraintViolationException for service response error code - // "HandshakeConstraintViolationException". - // - // The requested operation would violate the constraint identified in the reason - // code. - // - // Some of the reasons in the following list might not be applicable to this - // specific API or operation: - // - // * ACCOUNT_NUMBER_LIMIT_EXCEEDED: You attempted to exceed the limit on - // the number of accounts in an organization. Note that deleted and closed - // accounts still count toward your limit. If you get this exception immediately - // after creating the organization, wait one hour and try again. If after - // an hour it continues to fail with this error, contact Amazon Web Services - // Support (https://docs.aws.amazon.com/support/home#/). - // - // * ALREADY_IN_AN_ORGANIZATION: The handshake request is invalid because - // the invited account is already a member of an organization. - // - // * HANDSHAKE_RATE_LIMIT_EXCEEDED: You attempted to exceed the number of - // handshakes that you can send in one day. - // - // * INVITE_DISABLED_DURING_ENABLE_ALL_FEATURES: You can't issue new invitations - // to join an organization while it's in the process of enabling all features. - // You can resume inviting accounts after you finalize the process when all - // accounts have agreed to the change. - // - // * ORGANIZATION_ALREADY_HAS_ALL_FEATURES: The handshake request is invalid - // because the organization has already enabled all features. - // - // * ORGANIZATION_IS_ALREADY_PENDING_ALL_FEATURES_MIGRATION: The handshake - // request is invalid because the organization has already started the process - // to enable all features. - // - // * ORGANIZATION_FROM_DIFFERENT_SELLER_OF_RECORD: The request failed because - // the account is from a different marketplace than the accounts in the organization. - // For example, accounts with India addresses must be associated with the - // AISPL marketplace. All accounts in an organization must be from the same - // marketplace. - // - // * ORGANIZATION_MEMBERSHIP_CHANGE_RATE_LIMIT_EXCEEDED: You attempted to - // change the membership of an account too quickly after its previous change. - // - // * PAYMENT_INSTRUMENT_REQUIRED: You can't complete the operation with an - // account that doesn't have a payment instrument, such as a credit card, - // associated with it. - ErrCodeHandshakeConstraintViolationException = "HandshakeConstraintViolationException" - - // ErrCodeHandshakeNotFoundException for service response error code - // "HandshakeNotFoundException". - // - // We can't find a handshake with the HandshakeId that you specified. - ErrCodeHandshakeNotFoundException = "HandshakeNotFoundException" - - // ErrCodeInvalidHandshakeTransitionException for service response error code - // "InvalidHandshakeTransitionException". - // - // You can't perform the operation on the handshake in its current state. For - // example, you can't cancel a handshake that was already accepted or accept - // a handshake that was already declined. - ErrCodeInvalidHandshakeTransitionException = "InvalidHandshakeTransitionException" - - // ErrCodeInvalidInputException for service response error code - // "InvalidInputException". - // - // The requested operation failed because you provided invalid values for one - // or more of the request parameters. This exception includes a reason that - // contains additional information about the violated limit: - // - // Some of the reasons in the following list might not be applicable to this - // specific API or operation. - // - // * DUPLICATE_TAG_KEY: Tag keys must be unique among the tags attached to - // the same entity. - // - // * IMMUTABLE_POLICY: You specified a policy that is managed by Amazon Web - // Services and can't be modified. - // - // * INPUT_REQUIRED: You must include a value for all required parameters. - // - // * INVALID_EMAIL_ADDRESS_TARGET: You specified an invalid email address - // for the invited account owner. - // - // * INVALID_ENUM: You specified an invalid value. - // - // * INVALID_ENUM_POLICY_TYPE: You specified an invalid policy type string. - // - // * INVALID_FULL_NAME_TARGET: You specified a full name that contains invalid - // characters. - // - // * INVALID_LIST_MEMBER: You provided a list to a parameter that contains - // at least one invalid value. - // - // * INVALID_PAGINATION_TOKEN: Get the value for the NextToken parameter - // from the response to a previous call of the operation. - // - // * INVALID_PARTY_TYPE_TARGET: You specified the wrong type of entity (account, - // organization, or email) as a party. - // - // * INVALID_PATTERN: You provided a value that doesn't match the required - // pattern. - // - // * INVALID_PATTERN_TARGET_ID: You specified a policy target ID that doesn't - // match the required pattern. - // - // * INVALID_ROLE_NAME: You provided a role name that isn't valid. A role - // name can't begin with the reserved prefix AWSServiceRoleFor. - // - // * INVALID_SYNTAX_ORGANIZATION_ARN: You specified an invalid Amazon Resource - // Name (ARN) for the organization. - // - // * INVALID_SYNTAX_POLICY_ID: You specified an invalid policy ID. - // - // * INVALID_SYSTEM_TAGS_PARAMETER: You specified a tag key that is a system - // tag. You can’t add, edit, or delete system tag keys because they're - // reserved for Amazon Web Services use. System tags don’t count against - // your tags per resource limit. - // - // * MAX_FILTER_LIMIT_EXCEEDED: You can specify only one filter parameter - // for the operation. - // - // * MAX_LENGTH_EXCEEDED: You provided a string parameter that is longer - // than allowed. - // - // * MAX_VALUE_EXCEEDED: You provided a numeric parameter that has a larger - // value than allowed. - // - // * MIN_LENGTH_EXCEEDED: You provided a string parameter that is shorter - // than allowed. - // - // * MIN_VALUE_EXCEEDED: You provided a numeric parameter that has a smaller - // value than allowed. - // - // * MOVING_ACCOUNT_BETWEEN_DIFFERENT_ROOTS: You can move an account only - // between entities in the same root. - // - // * TARGET_NOT_SUPPORTED: You can't perform the specified operation on that - // target entity. - // - // * UNRECOGNIZED_SERVICE_PRINCIPAL: You specified a service principal that - // isn't recognized. - ErrCodeInvalidInputException = "InvalidInputException" - - // ErrCodeMalformedPolicyDocumentException for service response error code - // "MalformedPolicyDocumentException". - // - // The provided policy document doesn't meet the requirements of the specified - // policy type. For example, the syntax might be incorrect. For details about - // service control policy syntax, see Service Control Policy Syntax (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_scp-syntax.html) - // in the Organizations User Guide. - ErrCodeMalformedPolicyDocumentException = "MalformedPolicyDocumentException" - - // ErrCodeMasterCannotLeaveOrganizationException for service response error code - // "MasterCannotLeaveOrganizationException". - // - // You can't remove a management account from an organization. If you want the - // management account to become a member account in another organization, you - // must first delete the current organization of the management account. - ErrCodeMasterCannotLeaveOrganizationException = "MasterCannotLeaveOrganizationException" - - // ErrCodeOrganizationNotEmptyException for service response error code - // "OrganizationNotEmptyException". - // - // The organization isn't empty. To delete an organization, you must first remove - // all accounts except the management account, delete all OUs, and delete all - // policies. - ErrCodeOrganizationNotEmptyException = "OrganizationNotEmptyException" - - // ErrCodeOrganizationalUnitNotEmptyException for service response error code - // "OrganizationalUnitNotEmptyException". - // - // The specified OU is not empty. Move all accounts to another root or to other - // OUs, remove all child OUs, and try the operation again. - ErrCodeOrganizationalUnitNotEmptyException = "OrganizationalUnitNotEmptyException" - - // ErrCodeOrganizationalUnitNotFoundException for service response error code - // "OrganizationalUnitNotFoundException". - // - // We can't find an OU with the OrganizationalUnitId that you specified. - ErrCodeOrganizationalUnitNotFoundException = "OrganizationalUnitNotFoundException" - - // ErrCodeParentNotFoundException for service response error code - // "ParentNotFoundException". - // - // We can't find a root or OU with the ParentId that you specified. - ErrCodeParentNotFoundException = "ParentNotFoundException" - - // ErrCodePolicyChangesInProgressException for service response error code - // "PolicyChangesInProgressException". - // - // Changes to the effective policy are in progress, and its contents can't be - // returned. Try the operation again later. - ErrCodePolicyChangesInProgressException = "PolicyChangesInProgressException" - - // ErrCodePolicyInUseException for service response error code - // "PolicyInUseException". - // - // The policy is attached to one or more entities. You must detach it from all - // roots, OUs, and accounts before performing this operation. - ErrCodePolicyInUseException = "PolicyInUseException" - - // ErrCodePolicyNotAttachedException for service response error code - // "PolicyNotAttachedException". - // - // The policy isn't attached to the specified target in the specified root. - ErrCodePolicyNotAttachedException = "PolicyNotAttachedException" - - // ErrCodePolicyNotFoundException for service response error code - // "PolicyNotFoundException". - // - // We can't find a policy with the PolicyId that you specified. - ErrCodePolicyNotFoundException = "PolicyNotFoundException" - - // ErrCodePolicyTypeAlreadyEnabledException for service response error code - // "PolicyTypeAlreadyEnabledException". - // - // The specified policy type is already enabled in the specified root. - ErrCodePolicyTypeAlreadyEnabledException = "PolicyTypeAlreadyEnabledException" - - // ErrCodePolicyTypeNotAvailableForOrganizationException for service response error code - // "PolicyTypeNotAvailableForOrganizationException". - // - // You can't use the specified policy type with the feature set currently enabled - // for this organization. For example, you can enable SCPs only after you enable - // all features in the organization. For more information, see Managing Organizations - // Policies (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies.html#enable_policies_on_root)in - // the Organizations User Guide. - ErrCodePolicyTypeNotAvailableForOrganizationException = "PolicyTypeNotAvailableForOrganizationException" - - // ErrCodePolicyTypeNotEnabledException for service response error code - // "PolicyTypeNotEnabledException". - // - // The specified policy type isn't currently enabled in this root. You can't - // attach policies of the specified type to entities in a root until you enable - // that type in the root. For more information, see Enabling All Features in - // Your Organization (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_org_support-all-features.html) - // in the Organizations User Guide. - ErrCodePolicyTypeNotEnabledException = "PolicyTypeNotEnabledException" - - // ErrCodeResourcePolicyNotFoundException for service response error code - // "ResourcePolicyNotFoundException". - // - // We can't find a resource policy request with the parameter that you specified. - ErrCodeResourcePolicyNotFoundException = "ResourcePolicyNotFoundException" - - // ErrCodeRootNotFoundException for service response error code - // "RootNotFoundException". - // - // We can't find a root with the RootId that you specified. - ErrCodeRootNotFoundException = "RootNotFoundException" - - // ErrCodeServiceException for service response error code - // "ServiceException". - // - // Organizations can't complete your request because of an internal service - // error. Try again later. - ErrCodeServiceException = "ServiceException" - - // ErrCodeSourceParentNotFoundException for service response error code - // "SourceParentNotFoundException". - // - // We can't find a source root or OU with the ParentId that you specified. - ErrCodeSourceParentNotFoundException = "SourceParentNotFoundException" - - // ErrCodeTargetNotFoundException for service response error code - // "TargetNotFoundException". - // - // We can't find a root, OU, account, or policy with the TargetId that you specified. - ErrCodeTargetNotFoundException = "TargetNotFoundException" - - // ErrCodeTooManyRequestsException for service response error code - // "TooManyRequestsException". - // - // You have sent too many requests in too short a period of time. The quota - // helps protect against denial-of-service attacks. Try again later. - // - // For information about quotas that affect Organizations, see Quotas for Organizations - // (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_reference_limits.html)in - // the Organizations User Guide. - ErrCodeTooManyRequestsException = "TooManyRequestsException" - - // ErrCodeUnsupportedAPIEndpointException for service response error code - // "UnsupportedAPIEndpointException". - // - // This action isn't available in the current Amazon Web Services Region. - ErrCodeUnsupportedAPIEndpointException = "UnsupportedAPIEndpointException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "AWSOrganizationsNotInUseException": newErrorAWSOrganizationsNotInUseException, - "AccessDeniedException": newErrorAccessDeniedException, - "AccessDeniedForDependencyException": newErrorAccessDeniedForDependencyException, - "AccountAlreadyClosedException": newErrorAccountAlreadyClosedException, - "AccountAlreadyRegisteredException": newErrorAccountAlreadyRegisteredException, - "AccountNotFoundException": newErrorAccountNotFoundException, - "AccountNotRegisteredException": newErrorAccountNotRegisteredException, - "AccountOwnerNotVerifiedException": newErrorAccountOwnerNotVerifiedException, - "AlreadyInOrganizationException": newErrorAlreadyInOrganizationException, - "ChildNotFoundException": newErrorChildNotFoundException, - "ConcurrentModificationException": newErrorConcurrentModificationException, - "ConflictException": newErrorConflictException, - "ConstraintViolationException": newErrorConstraintViolationException, - "CreateAccountStatusNotFoundException": newErrorCreateAccountStatusNotFoundException, - "DestinationParentNotFoundException": newErrorDestinationParentNotFoundException, - "DuplicateAccountException": newErrorDuplicateAccountException, - "DuplicateHandshakeException": newErrorDuplicateHandshakeException, - "DuplicateOrganizationalUnitException": newErrorDuplicateOrganizationalUnitException, - "DuplicatePolicyAttachmentException": newErrorDuplicatePolicyAttachmentException, - "DuplicatePolicyException": newErrorDuplicatePolicyException, - "EffectivePolicyNotFoundException": newErrorEffectivePolicyNotFoundException, - "FinalizingOrganizationException": newErrorFinalizingOrganizationException, - "HandshakeAlreadyInStateException": newErrorHandshakeAlreadyInStateException, - "HandshakeConstraintViolationException": newErrorHandshakeConstraintViolationException, - "HandshakeNotFoundException": newErrorHandshakeNotFoundException, - "InvalidHandshakeTransitionException": newErrorInvalidHandshakeTransitionException, - "InvalidInputException": newErrorInvalidInputException, - "MalformedPolicyDocumentException": newErrorMalformedPolicyDocumentException, - "MasterCannotLeaveOrganizationException": newErrorMasterCannotLeaveOrganizationException, - "OrganizationNotEmptyException": newErrorOrganizationNotEmptyException, - "OrganizationalUnitNotEmptyException": newErrorOrganizationalUnitNotEmptyException, - "OrganizationalUnitNotFoundException": newErrorOrganizationalUnitNotFoundException, - "ParentNotFoundException": newErrorParentNotFoundException, - "PolicyChangesInProgressException": newErrorPolicyChangesInProgressException, - "PolicyInUseException": newErrorPolicyInUseException, - "PolicyNotAttachedException": newErrorPolicyNotAttachedException, - "PolicyNotFoundException": newErrorPolicyNotFoundException, - "PolicyTypeAlreadyEnabledException": newErrorPolicyTypeAlreadyEnabledException, - "PolicyTypeNotAvailableForOrganizationException": newErrorPolicyTypeNotAvailableForOrganizationException, - "PolicyTypeNotEnabledException": newErrorPolicyTypeNotEnabledException, - "ResourcePolicyNotFoundException": newErrorResourcePolicyNotFoundException, - "RootNotFoundException": newErrorRootNotFoundException, - "ServiceException": newErrorServiceException, - "SourceParentNotFoundException": newErrorSourceParentNotFoundException, - "TargetNotFoundException": newErrorTargetNotFoundException, - "TooManyRequestsException": newErrorTooManyRequestsException, - "UnsupportedAPIEndpointException": newErrorUnsupportedAPIEndpointException, -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/organizations/service.go b/vendor/github.com/aws/aws-sdk-go/service/organizations/service.go deleted file mode 100644 index debafce33d..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/organizations/service.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package organizations - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/signer/v4" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -// Organizations provides the API operation methods for making requests to -// AWS Organizations. See this package's package overview docs -// for details on the service. -// -// Organizations methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type Organizations struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "organizations" // Name of service. - EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Organizations" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the Organizations client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a Organizations client from just a session. -// svc := organizations.New(mySession) -// -// // Create a Organizations client with additional configuration -// svc := organizations.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *Organizations { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = EndpointsID - // No Fallback - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *Organizations { - svc := &Organizations{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2016-11-28", - ResolvedRegion: resolvedRegion, - JSONVersion: "1.1", - TargetPrefix: "AWSOrganizationsV20161128", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a Organizations operation and runs any -// custom request initialization. -func (c *Organizations) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/api.go b/vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/api.go deleted file mode 100644 index b9eb411c4a..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/api.go +++ /dev/null @@ -1,3032 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package resourcegroupstaggingapi - -import ( - "fmt" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -const opDescribeReportCreation = "DescribeReportCreation" - -// DescribeReportCreationRequest generates a "aws/request.Request" representing the -// client's request for the DescribeReportCreation operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeReportCreation for more information on using the DescribeReportCreation -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DescribeReportCreationRequest method. -// req, resp := client.DescribeReportCreationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resourcegroupstaggingapi-2017-01-26/DescribeReportCreation -func (c *ResourceGroupsTaggingAPI) DescribeReportCreationRequest(input *DescribeReportCreationInput) (req *request.Request, output *DescribeReportCreationOutput) { - op := &request.Operation{ - Name: opDescribeReportCreation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeReportCreationInput{} - } - - output = &DescribeReportCreationOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeReportCreation API operation for AWS Resource Groups Tagging API. -// -// Describes the status of the StartReportCreation operation. -// -// You can call this operation only from the organization's management account -// and from the us-east-1 Region. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Resource Groups Tagging API's -// API operation DescribeReportCreation for usage and error information. -// -// Returned Error Types: -// -// - ConstraintViolationException -// The request was denied because performing this operation violates a constraint. -// -// Some of the reasons in the following list might not apply to this specific -// operation. -// -// - You must meet the prerequisites for using tag policies. For information, -// see Prerequisites and Permissions for Using Tag Policies (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html) -// in the Organizations User Guide. -// -// - You must enable the tag policies service principal (tagpolicies.tag.amazonaws.com) -// to integrate with Organizations For information, see EnableAWSServiceAccess -// (https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html). -// -// - You must have a tag policy attached to the organization root, an OU, -// or an account. -// -// - InternalServiceException -// The request processing failed because of an unknown error, exception, or -// failure. You can retry the request. -// -// - InvalidParameterException -// This error indicates one of the following: -// -// - A parameter is missing. -// -// - A malformed string was supplied for the request parameter. -// -// - An out-of-range value was supplied for the request parameter. -// -// - The target ID is invalid, unsupported, or doesn't exist. -// -// - You can't access the Amazon S3 bucket for report storage. For more information, -// see Additional Requirements for Organization-wide Tag Compliance Reports -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html#bucket-policies-org-report) -// in the Organizations User Guide. -// -// - ThrottledException -// The request was denied to limit the frequency of submitted requests. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resourcegroupstaggingapi-2017-01-26/DescribeReportCreation -func (c *ResourceGroupsTaggingAPI) DescribeReportCreation(input *DescribeReportCreationInput) (*DescribeReportCreationOutput, error) { - req, out := c.DescribeReportCreationRequest(input) - return out, req.Send() -} - -// DescribeReportCreationWithContext is the same as DescribeReportCreation with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeReportCreation for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ResourceGroupsTaggingAPI) DescribeReportCreationWithContext(ctx aws.Context, input *DescribeReportCreationInput, opts ...request.Option) (*DescribeReportCreationOutput, error) { - req, out := c.DescribeReportCreationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetComplianceSummary = "GetComplianceSummary" - -// GetComplianceSummaryRequest generates a "aws/request.Request" representing the -// client's request for the GetComplianceSummary operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetComplianceSummary for more information on using the GetComplianceSummary -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetComplianceSummaryRequest method. -// req, resp := client.GetComplianceSummaryRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resourcegroupstaggingapi-2017-01-26/GetComplianceSummary -func (c *ResourceGroupsTaggingAPI) GetComplianceSummaryRequest(input *GetComplianceSummaryInput) (req *request.Request, output *GetComplianceSummaryOutput) { - op := &request.Operation{ - Name: opGetComplianceSummary, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"PaginationToken"}, - OutputTokens: []string{"PaginationToken"}, - LimitToken: "MaxResults", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetComplianceSummaryInput{} - } - - output = &GetComplianceSummaryOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetComplianceSummary API operation for AWS Resource Groups Tagging API. -// -// Returns a table that shows counts of resources that are noncompliant with -// their tag policies. -// -// For more information on tag policies, see Tag Policies (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) -// in the Organizations User Guide. -// -// You can call this operation only from the organization's management account -// and from the us-east-1 Region. -// -// This operation supports pagination, where the response can be sent in multiple -// pages. You should check the PaginationToken response parameter to determine -// if there are additional results available to return. Repeat the query, passing -// the PaginationToken response parameter value as an input to the next request -// until you recieve a null value. A null value for PaginationToken indicates -// that there are no more results waiting to be returned. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Resource Groups Tagging API's -// API operation GetComplianceSummary for usage and error information. -// -// Returned Error Types: -// -// - ConstraintViolationException -// The request was denied because performing this operation violates a constraint. -// -// Some of the reasons in the following list might not apply to this specific -// operation. -// -// - You must meet the prerequisites for using tag policies. For information, -// see Prerequisites and Permissions for Using Tag Policies (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html) -// in the Organizations User Guide. -// -// - You must enable the tag policies service principal (tagpolicies.tag.amazonaws.com) -// to integrate with Organizations For information, see EnableAWSServiceAccess -// (https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html). -// -// - You must have a tag policy attached to the organization root, an OU, -// or an account. -// -// - InternalServiceException -// The request processing failed because of an unknown error, exception, or -// failure. You can retry the request. -// -// - InvalidParameterException -// This error indicates one of the following: -// -// - A parameter is missing. -// -// - A malformed string was supplied for the request parameter. -// -// - An out-of-range value was supplied for the request parameter. -// -// - The target ID is invalid, unsupported, or doesn't exist. -// -// - You can't access the Amazon S3 bucket for report storage. For more information, -// see Additional Requirements for Organization-wide Tag Compliance Reports -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html#bucket-policies-org-report) -// in the Organizations User Guide. -// -// - ThrottledException -// The request was denied to limit the frequency of submitted requests. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resourcegroupstaggingapi-2017-01-26/GetComplianceSummary -func (c *ResourceGroupsTaggingAPI) GetComplianceSummary(input *GetComplianceSummaryInput) (*GetComplianceSummaryOutput, error) { - req, out := c.GetComplianceSummaryRequest(input) - return out, req.Send() -} - -// GetComplianceSummaryWithContext is the same as GetComplianceSummary with the addition of -// the ability to pass a context and additional request options. -// -// See GetComplianceSummary for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ResourceGroupsTaggingAPI) GetComplianceSummaryWithContext(ctx aws.Context, input *GetComplianceSummaryInput, opts ...request.Option) (*GetComplianceSummaryOutput, error) { - req, out := c.GetComplianceSummaryRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// GetComplianceSummaryPages iterates over the pages of a GetComplianceSummary operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetComplianceSummary method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a GetComplianceSummary operation. -// pageNum := 0 -// err := client.GetComplianceSummaryPages(params, -// func(page *resourcegroupstaggingapi.GetComplianceSummaryOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ResourceGroupsTaggingAPI) GetComplianceSummaryPages(input *GetComplianceSummaryInput, fn func(*GetComplianceSummaryOutput, bool) bool) error { - return c.GetComplianceSummaryPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetComplianceSummaryPagesWithContext same as GetComplianceSummaryPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ResourceGroupsTaggingAPI) GetComplianceSummaryPagesWithContext(ctx aws.Context, input *GetComplianceSummaryInput, fn func(*GetComplianceSummaryOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetComplianceSummaryInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetComplianceSummaryRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*GetComplianceSummaryOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opGetResources = "GetResources" - -// GetResourcesRequest generates a "aws/request.Request" representing the -// client's request for the GetResources operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetResources for more information on using the GetResources -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetResourcesRequest method. -// req, resp := client.GetResourcesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resourcegroupstaggingapi-2017-01-26/GetResources -func (c *ResourceGroupsTaggingAPI) GetResourcesRequest(input *GetResourcesInput) (req *request.Request, output *GetResourcesOutput) { - op := &request.Operation{ - Name: opGetResources, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"PaginationToken"}, - OutputTokens: []string{"PaginationToken"}, - LimitToken: "ResourcesPerPage", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetResourcesInput{} - } - - output = &GetResourcesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetResources API operation for AWS Resource Groups Tagging API. -// -// Returns all the tagged or previously tagged resources that are located in -// the specified Amazon Web Services Region for the account. -// -// Depending on what information you want returned, you can also specify the -// following: -// -// - Filters that specify what tags and resource types you want returned. -// The response includes all tags that are associated with the requested -// resources. -// -// - Information about compliance with the account's effective tag policy. -// For more information on tag policies, see Tag Policies (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) -// in the Organizations User Guide. -// -// This operation supports pagination, where the response can be sent in multiple -// pages. You should check the PaginationToken response parameter to determine -// if there are additional results available to return. Repeat the query, passing -// the PaginationToken response parameter value as an input to the next request -// until you recieve a null value. A null value for PaginationToken indicates -// that there are no more results waiting to be returned. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Resource Groups Tagging API's -// API operation GetResources for usage and error information. -// -// Returned Error Types: -// -// - InvalidParameterException -// This error indicates one of the following: -// -// - A parameter is missing. -// -// - A malformed string was supplied for the request parameter. -// -// - An out-of-range value was supplied for the request parameter. -// -// - The target ID is invalid, unsupported, or doesn't exist. -// -// - You can't access the Amazon S3 bucket for report storage. For more information, -// see Additional Requirements for Organization-wide Tag Compliance Reports -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html#bucket-policies-org-report) -// in the Organizations User Guide. -// -// - ThrottledException -// The request was denied to limit the frequency of submitted requests. -// -// - InternalServiceException -// The request processing failed because of an unknown error, exception, or -// failure. You can retry the request. -// -// - PaginationTokenExpiredException -// A PaginationToken is valid for a maximum of 15 minutes. Your request was -// denied because the specified PaginationToken has expired. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resourcegroupstaggingapi-2017-01-26/GetResources -func (c *ResourceGroupsTaggingAPI) GetResources(input *GetResourcesInput) (*GetResourcesOutput, error) { - req, out := c.GetResourcesRequest(input) - return out, req.Send() -} - -// GetResourcesWithContext is the same as GetResources with the addition of -// the ability to pass a context and additional request options. -// -// See GetResources for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ResourceGroupsTaggingAPI) GetResourcesWithContext(ctx aws.Context, input *GetResourcesInput, opts ...request.Option) (*GetResourcesOutput, error) { - req, out := c.GetResourcesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// GetResourcesPages iterates over the pages of a GetResources operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetResources method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a GetResources operation. -// pageNum := 0 -// err := client.GetResourcesPages(params, -// func(page *resourcegroupstaggingapi.GetResourcesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ResourceGroupsTaggingAPI) GetResourcesPages(input *GetResourcesInput, fn func(*GetResourcesOutput, bool) bool) error { - return c.GetResourcesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetResourcesPagesWithContext same as GetResourcesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ResourceGroupsTaggingAPI) GetResourcesPagesWithContext(ctx aws.Context, input *GetResourcesInput, fn func(*GetResourcesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetResourcesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetResourcesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*GetResourcesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opGetTagKeys = "GetTagKeys" - -// GetTagKeysRequest generates a "aws/request.Request" representing the -// client's request for the GetTagKeys operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetTagKeys for more information on using the GetTagKeys -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetTagKeysRequest method. -// req, resp := client.GetTagKeysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resourcegroupstaggingapi-2017-01-26/GetTagKeys -func (c *ResourceGroupsTaggingAPI) GetTagKeysRequest(input *GetTagKeysInput) (req *request.Request, output *GetTagKeysOutput) { - op := &request.Operation{ - Name: opGetTagKeys, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"PaginationToken"}, - OutputTokens: []string{"PaginationToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetTagKeysInput{} - } - - output = &GetTagKeysOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTagKeys API operation for AWS Resource Groups Tagging API. -// -// Returns all tag keys currently in use in the specified Amazon Web Services -// Region for the calling account. -// -// This operation supports pagination, where the response can be sent in multiple -// pages. You should check the PaginationToken response parameter to determine -// if there are additional results available to return. Repeat the query, passing -// the PaginationToken response parameter value as an input to the next request -// until you recieve a null value. A null value for PaginationToken indicates -// that there are no more results waiting to be returned. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Resource Groups Tagging API's -// API operation GetTagKeys for usage and error information. -// -// Returned Error Types: -// -// - InvalidParameterException -// This error indicates one of the following: -// -// - A parameter is missing. -// -// - A malformed string was supplied for the request parameter. -// -// - An out-of-range value was supplied for the request parameter. -// -// - The target ID is invalid, unsupported, or doesn't exist. -// -// - You can't access the Amazon S3 bucket for report storage. For more information, -// see Additional Requirements for Organization-wide Tag Compliance Reports -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html#bucket-policies-org-report) -// in the Organizations User Guide. -// -// - ThrottledException -// The request was denied to limit the frequency of submitted requests. -// -// - InternalServiceException -// The request processing failed because of an unknown error, exception, or -// failure. You can retry the request. -// -// - PaginationTokenExpiredException -// A PaginationToken is valid for a maximum of 15 minutes. Your request was -// denied because the specified PaginationToken has expired. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resourcegroupstaggingapi-2017-01-26/GetTagKeys -func (c *ResourceGroupsTaggingAPI) GetTagKeys(input *GetTagKeysInput) (*GetTagKeysOutput, error) { - req, out := c.GetTagKeysRequest(input) - return out, req.Send() -} - -// GetTagKeysWithContext is the same as GetTagKeys with the addition of -// the ability to pass a context and additional request options. -// -// See GetTagKeys for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ResourceGroupsTaggingAPI) GetTagKeysWithContext(ctx aws.Context, input *GetTagKeysInput, opts ...request.Option) (*GetTagKeysOutput, error) { - req, out := c.GetTagKeysRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// GetTagKeysPages iterates over the pages of a GetTagKeys operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetTagKeys method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a GetTagKeys operation. -// pageNum := 0 -// err := client.GetTagKeysPages(params, -// func(page *resourcegroupstaggingapi.GetTagKeysOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ResourceGroupsTaggingAPI) GetTagKeysPages(input *GetTagKeysInput, fn func(*GetTagKeysOutput, bool) bool) error { - return c.GetTagKeysPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetTagKeysPagesWithContext same as GetTagKeysPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ResourceGroupsTaggingAPI) GetTagKeysPagesWithContext(ctx aws.Context, input *GetTagKeysInput, fn func(*GetTagKeysOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetTagKeysInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetTagKeysRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*GetTagKeysOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opGetTagValues = "GetTagValues" - -// GetTagValuesRequest generates a "aws/request.Request" representing the -// client's request for the GetTagValues operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetTagValues for more information on using the GetTagValues -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetTagValuesRequest method. -// req, resp := client.GetTagValuesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resourcegroupstaggingapi-2017-01-26/GetTagValues -func (c *ResourceGroupsTaggingAPI) GetTagValuesRequest(input *GetTagValuesInput) (req *request.Request, output *GetTagValuesOutput) { - op := &request.Operation{ - Name: opGetTagValues, - HTTPMethod: "POST", - HTTPPath: "/", - Paginator: &request.Paginator{ - InputTokens: []string{"PaginationToken"}, - OutputTokens: []string{"PaginationToken"}, - LimitToken: "", - TruncationToken: "", - }, - } - - if input == nil { - input = &GetTagValuesInput{} - } - - output = &GetTagValuesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetTagValues API operation for AWS Resource Groups Tagging API. -// -// Returns all tag values for the specified key that are used in the specified -// Amazon Web Services Region for the calling account. -// -// This operation supports pagination, where the response can be sent in multiple -// pages. You should check the PaginationToken response parameter to determine -// if there are additional results available to return. Repeat the query, passing -// the PaginationToken response parameter value as an input to the next request -// until you recieve a null value. A null value for PaginationToken indicates -// that there are no more results waiting to be returned. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Resource Groups Tagging API's -// API operation GetTagValues for usage and error information. -// -// Returned Error Types: -// -// - InvalidParameterException -// This error indicates one of the following: -// -// - A parameter is missing. -// -// - A malformed string was supplied for the request parameter. -// -// - An out-of-range value was supplied for the request parameter. -// -// - The target ID is invalid, unsupported, or doesn't exist. -// -// - You can't access the Amazon S3 bucket for report storage. For more information, -// see Additional Requirements for Organization-wide Tag Compliance Reports -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html#bucket-policies-org-report) -// in the Organizations User Guide. -// -// - ThrottledException -// The request was denied to limit the frequency of submitted requests. -// -// - InternalServiceException -// The request processing failed because of an unknown error, exception, or -// failure. You can retry the request. -// -// - PaginationTokenExpiredException -// A PaginationToken is valid for a maximum of 15 minutes. Your request was -// denied because the specified PaginationToken has expired. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resourcegroupstaggingapi-2017-01-26/GetTagValues -func (c *ResourceGroupsTaggingAPI) GetTagValues(input *GetTagValuesInput) (*GetTagValuesOutput, error) { - req, out := c.GetTagValuesRequest(input) - return out, req.Send() -} - -// GetTagValuesWithContext is the same as GetTagValues with the addition of -// the ability to pass a context and additional request options. -// -// See GetTagValues for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ResourceGroupsTaggingAPI) GetTagValuesWithContext(ctx aws.Context, input *GetTagValuesInput, opts ...request.Option) (*GetTagValuesOutput, error) { - req, out := c.GetTagValuesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// GetTagValuesPages iterates over the pages of a GetTagValues operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See GetTagValues method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a GetTagValues operation. -// pageNum := 0 -// err := client.GetTagValuesPages(params, -// func(page *resourcegroupstaggingapi.GetTagValuesOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *ResourceGroupsTaggingAPI) GetTagValuesPages(input *GetTagValuesInput, fn func(*GetTagValuesOutput, bool) bool) error { - return c.GetTagValuesPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// GetTagValuesPagesWithContext same as GetTagValuesPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ResourceGroupsTaggingAPI) GetTagValuesPagesWithContext(ctx aws.Context, input *GetTagValuesInput, fn func(*GetTagValuesOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *GetTagValuesInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.GetTagValuesRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*GetTagValuesOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opStartReportCreation = "StartReportCreation" - -// StartReportCreationRequest generates a "aws/request.Request" representing the -// client's request for the StartReportCreation operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See StartReportCreation for more information on using the StartReportCreation -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the StartReportCreationRequest method. -// req, resp := client.StartReportCreationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resourcegroupstaggingapi-2017-01-26/StartReportCreation -func (c *ResourceGroupsTaggingAPI) StartReportCreationRequest(input *StartReportCreationInput) (req *request.Request, output *StartReportCreationOutput) { - op := &request.Operation{ - Name: opStartReportCreation, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &StartReportCreationInput{} - } - - output = &StartReportCreationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// StartReportCreation API operation for AWS Resource Groups Tagging API. -// -// Generates a report that lists all tagged resources in the accounts across -// your organization and tells whether each resource is compliant with the effective -// tag policy. Compliance data is refreshed daily. The report is generated asynchronously. -// -// The generated report is saved to the following location: -// -// s3://example-bucket/AwsTagPolicies/o-exampleorgid/YYYY-MM-ddTHH:mm:ssZ/report.csv -// -// You can call this operation only from the organization's management account -// and from the us-east-1 Region. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Resource Groups Tagging API's -// API operation StartReportCreation for usage and error information. -// -// Returned Error Types: -// -// - ConcurrentModificationException -// The target of the operation is currently being modified by a different request. -// Try again later. -// -// - ConstraintViolationException -// The request was denied because performing this operation violates a constraint. -// -// Some of the reasons in the following list might not apply to this specific -// operation. -// -// - You must meet the prerequisites for using tag policies. For information, -// see Prerequisites and Permissions for Using Tag Policies (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html) -// in the Organizations User Guide. -// -// - You must enable the tag policies service principal (tagpolicies.tag.amazonaws.com) -// to integrate with Organizations For information, see EnableAWSServiceAccess -// (https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html). -// -// - You must have a tag policy attached to the organization root, an OU, -// or an account. -// -// - InternalServiceException -// The request processing failed because of an unknown error, exception, or -// failure. You can retry the request. -// -// - InvalidParameterException -// This error indicates one of the following: -// -// - A parameter is missing. -// -// - A malformed string was supplied for the request parameter. -// -// - An out-of-range value was supplied for the request parameter. -// -// - The target ID is invalid, unsupported, or doesn't exist. -// -// - You can't access the Amazon S3 bucket for report storage. For more information, -// see Additional Requirements for Organization-wide Tag Compliance Reports -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html#bucket-policies-org-report) -// in the Organizations User Guide. -// -// - ThrottledException -// The request was denied to limit the frequency of submitted requests. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resourcegroupstaggingapi-2017-01-26/StartReportCreation -func (c *ResourceGroupsTaggingAPI) StartReportCreation(input *StartReportCreationInput) (*StartReportCreationOutput, error) { - req, out := c.StartReportCreationRequest(input) - return out, req.Send() -} - -// StartReportCreationWithContext is the same as StartReportCreation with the addition of -// the ability to pass a context and additional request options. -// -// See StartReportCreation for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ResourceGroupsTaggingAPI) StartReportCreationWithContext(ctx aws.Context, input *StartReportCreationInput, opts ...request.Option) (*StartReportCreationOutput, error) { - req, out := c.StartReportCreationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResources = "TagResources" - -// TagResourcesRequest generates a "aws/request.Request" representing the -// client's request for the TagResources operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See TagResources for more information on using the TagResources -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the TagResourcesRequest method. -// req, resp := client.TagResourcesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resourcegroupstaggingapi-2017-01-26/TagResources -func (c *ResourceGroupsTaggingAPI) TagResourcesRequest(input *TagResourcesInput) (req *request.Request, output *TagResourcesOutput) { - op := &request.Operation{ - Name: opTagResources, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TagResourcesInput{} - } - - output = &TagResourcesOutput{} - req = c.newRequest(op, input, output) - return -} - -// TagResources API operation for AWS Resource Groups Tagging API. -// -// Applies one or more tags to the specified resources. Note the following: -// -// - Not all resources can have tags. For a list of services with resources -// that support tagging using this operation, see Services that support the -// Resource Groups Tagging API (https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/supported-services.html). -// If the resource doesn't yet support this operation, the resource's service -// might support tagging using its own API operations. For more information, -// refer to the documentation for that service. -// -// - Each resource can have up to 50 tags. For other limits, see Tag Naming -// and Usage Conventions (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html#tag-conventions) -// in the Amazon Web Services General Reference. -// -// - You can only tag resources that are located in the specified Amazon -// Web Services Region for the Amazon Web Services account. -// -// - To add tags to a resource, you need the necessary permissions for the -// service that the resource belongs to as well as permissions for adding -// tags. For more information, see the documentation for each service. -// -// Do not store personally identifiable information (PII) or other confidential -// or sensitive information in tags. We use tags to provide you with billing -// and administration services. Tags are not intended to be used for private -// or sensitive data. -// -// # Minimum permissions -// -// In addition to the tag:TagResources permission required by this operation, -// you must also have the tagging permission defined by the service that created -// the resource. For example, to tag an Amazon EC2 instance using the TagResources -// operation, you must have both of the following permissions: -// -// - tag:TagResource -// -// - ec2:CreateTags -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Resource Groups Tagging API's -// API operation TagResources for usage and error information. -// -// Returned Error Types: -// -// - InvalidParameterException -// This error indicates one of the following: -// -// - A parameter is missing. -// -// - A malformed string was supplied for the request parameter. -// -// - An out-of-range value was supplied for the request parameter. -// -// - The target ID is invalid, unsupported, or doesn't exist. -// -// - You can't access the Amazon S3 bucket for report storage. For more information, -// see Additional Requirements for Organization-wide Tag Compliance Reports -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html#bucket-policies-org-report) -// in the Organizations User Guide. -// -// - ThrottledException -// The request was denied to limit the frequency of submitted requests. -// -// - InternalServiceException -// The request processing failed because of an unknown error, exception, or -// failure. You can retry the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resourcegroupstaggingapi-2017-01-26/TagResources -func (c *ResourceGroupsTaggingAPI) TagResources(input *TagResourcesInput) (*TagResourcesOutput, error) { - req, out := c.TagResourcesRequest(input) - return out, req.Send() -} - -// TagResourcesWithContext is the same as TagResources with the addition of -// the ability to pass a context and additional request options. -// -// See TagResources for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ResourceGroupsTaggingAPI) TagResourcesWithContext(ctx aws.Context, input *TagResourcesInput, opts ...request.Option) (*TagResourcesOutput, error) { - req, out := c.TagResourcesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResources = "UntagResources" - -// UntagResourcesRequest generates a "aws/request.Request" representing the -// client's request for the UntagResources operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UntagResources for more information on using the UntagResources -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the UntagResourcesRequest method. -// req, resp := client.UntagResourcesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resourcegroupstaggingapi-2017-01-26/UntagResources -func (c *ResourceGroupsTaggingAPI) UntagResourcesRequest(input *UntagResourcesInput) (req *request.Request, output *UntagResourcesOutput) { - op := &request.Operation{ - Name: opUntagResources, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UntagResourcesInput{} - } - - output = &UntagResourcesOutput{} - req = c.newRequest(op, input, output) - return -} - -// UntagResources API operation for AWS Resource Groups Tagging API. -// -// Removes the specified tags from the specified resources. When you specify -// a tag key, the action removes both that key and its associated value. The -// operation succeeds even if you attempt to remove tags from a resource that -// were already removed. Note the following: -// -// - To remove tags from a resource, you need the necessary permissions for -// the service that the resource belongs to as well as permissions for removing -// tags. For more information, see the documentation for the service whose -// resource you want to untag. -// -// - You can only tag resources that are located in the specified Amazon -// Web Services Region for the calling Amazon Web Services account. -// -// # Minimum permissions -// -// In addition to the tag:UntagResources permission required by this operation, -// you must also have the remove tags permission defined by the service that -// created the resource. For example, to remove the tags from an Amazon EC2 -// instance using the UntagResources operation, you must have both of the following -// permissions: -// -// - tag:UntagResource -// -// - ec2:DeleteTags -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS Resource Groups Tagging API's -// API operation UntagResources for usage and error information. -// -// Returned Error Types: -// -// - InvalidParameterException -// This error indicates one of the following: -// -// - A parameter is missing. -// -// - A malformed string was supplied for the request parameter. -// -// - An out-of-range value was supplied for the request parameter. -// -// - The target ID is invalid, unsupported, or doesn't exist. -// -// - You can't access the Amazon S3 bucket for report storage. For more information, -// see Additional Requirements for Organization-wide Tag Compliance Reports -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html#bucket-policies-org-report) -// in the Organizations User Guide. -// -// - ThrottledException -// The request was denied to limit the frequency of submitted requests. -// -// - InternalServiceException -// The request processing failed because of an unknown error, exception, or -// failure. You can retry the request. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/resourcegroupstaggingapi-2017-01-26/UntagResources -func (c *ResourceGroupsTaggingAPI) UntagResources(input *UntagResourcesInput) (*UntagResourcesOutput, error) { - req, out := c.UntagResourcesRequest(input) - return out, req.Send() -} - -// UntagResourcesWithContext is the same as UntagResources with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResources for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *ResourceGroupsTaggingAPI) UntagResourcesWithContext(ctx aws.Context, input *UntagResourcesInput, opts ...request.Option) (*UntagResourcesOutput, error) { - req, out := c.UntagResourcesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Information that shows whether a resource is compliant with the effective -// tag policy, including details on any noncompliant tag keys. -type ComplianceDetails struct { - _ struct{} `type:"structure"` - - // Whether a resource is compliant with the effective tag policy. - ComplianceStatus *bool `type:"boolean"` - - // These are keys defined in the effective policy that are on the resource with - // either incorrect case treatment or noncompliant values. - KeysWithNoncompliantValues []*string `type:"list"` - - // These tag keys on the resource are noncompliant with the effective tag policy. - NoncompliantKeys []*string `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ComplianceDetails) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ComplianceDetails) GoString() string { - return s.String() -} - -// SetComplianceStatus sets the ComplianceStatus field's value. -func (s *ComplianceDetails) SetComplianceStatus(v bool) *ComplianceDetails { - s.ComplianceStatus = &v - return s -} - -// SetKeysWithNoncompliantValues sets the KeysWithNoncompliantValues field's value. -func (s *ComplianceDetails) SetKeysWithNoncompliantValues(v []*string) *ComplianceDetails { - s.KeysWithNoncompliantValues = v - return s -} - -// SetNoncompliantKeys sets the NoncompliantKeys field's value. -func (s *ComplianceDetails) SetNoncompliantKeys(v []*string) *ComplianceDetails { - s.NoncompliantKeys = v - return s -} - -// The target of the operation is currently being modified by a different request. -// Try again later. -type ConcurrentModificationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ConcurrentModificationException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ConcurrentModificationException) GoString() string { - return s.String() -} - -func newErrorConcurrentModificationException(v protocol.ResponseMetadata) error { - return &ConcurrentModificationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConcurrentModificationException) Code() string { - return "ConcurrentModificationException" -} - -// Message returns the exception's message. -func (s *ConcurrentModificationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConcurrentModificationException) OrigErr() error { - return nil -} - -func (s *ConcurrentModificationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConcurrentModificationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConcurrentModificationException) RequestID() string { - return s.RespMetadata.RequestID -} - -// The request was denied because performing this operation violates a constraint. -// -// Some of the reasons in the following list might not apply to this specific -// operation. -// -// - You must meet the prerequisites for using tag policies. For information, -// see Prerequisites and Permissions for Using Tag Policies (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html) -// in the Organizations User Guide. -// -// - You must enable the tag policies service principal (tagpolicies.tag.amazonaws.com) -// to integrate with Organizations For information, see EnableAWSServiceAccess -// (https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html). -// -// - You must have a tag policy attached to the organization root, an OU, -// or an account. -type ConstraintViolationException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ConstraintViolationException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ConstraintViolationException) GoString() string { - return s.String() -} - -func newErrorConstraintViolationException(v protocol.ResponseMetadata) error { - return &ConstraintViolationException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ConstraintViolationException) Code() string { - return "ConstraintViolationException" -} - -// Message returns the exception's message. -func (s *ConstraintViolationException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ConstraintViolationException) OrigErr() error { - return nil -} - -func (s *ConstraintViolationException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ConstraintViolationException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ConstraintViolationException) RequestID() string { - return s.RespMetadata.RequestID -} - -type DescribeReportCreationInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeReportCreationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeReportCreationInput) GoString() string { - return s.String() -} - -type DescribeReportCreationOutput struct { - _ struct{} `type:"structure"` - - // Details of the common errors that all operations return. - ErrorMessage *string `type:"string"` - - // The path to the Amazon S3 bucket where the report was stored on creation. - S3Location *string `type:"string"` - - // Reports the status of the operation. - // - // The operation status can be one of the following: - // - // * RUNNING - Report creation is in progress. - // - // * SUCCEEDED - Report creation is complete. You can open the report from - // the Amazon S3 bucket that you specified when you ran StartReportCreation. - // - // * FAILED - Report creation timed out or the Amazon S3 bucket is not accessible. - // - // * NO REPORT - No report was generated in the last 90 days. - Status *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeReportCreationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeReportCreationOutput) GoString() string { - return s.String() -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *DescribeReportCreationOutput) SetErrorMessage(v string) *DescribeReportCreationOutput { - s.ErrorMessage = &v - return s -} - -// SetS3Location sets the S3Location field's value. -func (s *DescribeReportCreationOutput) SetS3Location(v string) *DescribeReportCreationOutput { - s.S3Location = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *DescribeReportCreationOutput) SetStatus(v string) *DescribeReportCreationOutput { - s.Status = &v - return s -} - -// Information about the errors that are returned for each failed resource. -// This information can include InternalServiceException and InvalidParameterException -// errors. It can also include any valid error code returned by the Amazon Web -// Services service that hosts the resource that the ARN key represents. -// -// The following are common error codes that you might receive from other Amazon -// Web Services services: -// -// - InternalServiceException – This can mean that the Resource Groups -// Tagging API didn't receive a response from another Amazon Web Services -// service. It can also mean that the resource type in the request is not -// supported by the Resource Groups Tagging API. In these cases, it's safe -// to retry the request and then call GetResources (https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_GetResources.html) -// to verify the changes. -// -// - AccessDeniedException – This can mean that you need permission to -// call the tagging operations in the Amazon Web Services service that contains -// the resource. For example, to use the Resource Groups Tagging API to tag -// a Amazon CloudWatch alarm resource, you need permission to call both TagResources -// (https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/API_TagResources.html) -// and TagResource (https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_TagResource.html) -// in the CloudWatch API. -// -// For more information on errors that are generated from other Amazon Web Services -// services, see the documentation for that service. -type FailureInfo struct { - _ struct{} `type:"structure"` - - // The code of the common error. Valid values include InternalServiceException, - // InvalidParameterException, and any valid error code returned by the Amazon - // Web Services service that hosts the resource that you want to tag. - ErrorCode *string `type:"string" enum:"ErrorCode"` - - // The message of the common error. - ErrorMessage *string `type:"string"` - - // The HTTP status code of the common error. - StatusCode *int64 `type:"integer"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s FailureInfo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s FailureInfo) GoString() string { - return s.String() -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *FailureInfo) SetErrorCode(v string) *FailureInfo { - s.ErrorCode = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *FailureInfo) SetErrorMessage(v string) *FailureInfo { - s.ErrorMessage = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *FailureInfo) SetStatusCode(v int64) *FailureInfo { - s.StatusCode = &v - return s -} - -type GetComplianceSummaryInput struct { - _ struct{} `type:"structure"` - - // Specifies a list of attributes to group the counts of noncompliant resources - // by. If supplied, the counts are sorted by those attributes. - GroupBy []*string `type:"list" enum:"GroupByAttribute"` - - // Specifies the maximum number of results to be returned in each page. A query - // can return fewer than this maximum, even if there are more results still - // to return. You should always check the PaginationToken response value to - // see if there are more results. You can specify a minimum of 1 and a maximum - // value of 100. - MaxResults *int64 `min:"1" type:"integer"` - - // Specifies a PaginationToken response value from a previous request to indicate - // that you want the next page of results. Leave this parameter empty in your - // initial request. - PaginationToken *string `type:"string"` - - // Specifies a list of Amazon Web Services Regions to limit the output to. If - // you use this parameter, the count of returned noncompliant resources includes - // only resources in the specified Regions. - RegionFilters []*string `min:"1" type:"list"` - - // Specifies that you want the response to include information for only resources - // of the specified types. The format of each resource type is service[:resourceType]. - // For example, specifying a resource type of ec2 returns all Amazon EC2 resources - // (which includes EC2 instances). Specifying a resource type of ec2:instance - // returns only EC2 instances. - // - // The string for each service name and resource type is the same as that embedded - // in a resource's Amazon Resource Name (ARN). Consult the Amazon Web Services - // General Reference (https://docs.aws.amazon.com/general/latest/gr/) for the - // following: - // - // * For a list of service name strings, see Amazon Web Services Service - // Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#genref-aws-service-namespaces). - // - // * For resource type strings, see Example ARNs (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arns-syntax). - // - // * For more information about ARNs, see Amazon Resource Names (ARNs) and - // Amazon Web Services Service Namespaces (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html). - // - // You can specify multiple resource types by using a comma separated array. - // The array can include up to 100 items. Note that the length constraint requirement - // applies to each resource type filter. - ResourceTypeFilters []*string `type:"list"` - - // Specifies that you want the response to include information for only resources - // that have tags with the specified tag keys. If you use this parameter, the - // count of returned noncompliant resources includes only resources that have - // the specified tag keys. - TagKeyFilters []*string `min:"1" type:"list"` - - // Specifies target identifiers (usually, specific account IDs) to limit the - // output by. If you use this parameter, the count of returned noncompliant - // resources includes only resources with the specified target IDs. - TargetIdFilters []*string `min:"1" type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetComplianceSummaryInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetComplianceSummaryInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetComplianceSummaryInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetComplianceSummaryInput"} - if s.MaxResults != nil && *s.MaxResults < 1 { - invalidParams.Add(request.NewErrParamMinValue("MaxResults", 1)) - } - if s.RegionFilters != nil && len(s.RegionFilters) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RegionFilters", 1)) - } - if s.TagKeyFilters != nil && len(s.TagKeyFilters) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TagKeyFilters", 1)) - } - if s.TargetIdFilters != nil && len(s.TargetIdFilters) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TargetIdFilters", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGroupBy sets the GroupBy field's value. -func (s *GetComplianceSummaryInput) SetGroupBy(v []*string) *GetComplianceSummaryInput { - s.GroupBy = v - return s -} - -// SetMaxResults sets the MaxResults field's value. -func (s *GetComplianceSummaryInput) SetMaxResults(v int64) *GetComplianceSummaryInput { - s.MaxResults = &v - return s -} - -// SetPaginationToken sets the PaginationToken field's value. -func (s *GetComplianceSummaryInput) SetPaginationToken(v string) *GetComplianceSummaryInput { - s.PaginationToken = &v - return s -} - -// SetRegionFilters sets the RegionFilters field's value. -func (s *GetComplianceSummaryInput) SetRegionFilters(v []*string) *GetComplianceSummaryInput { - s.RegionFilters = v - return s -} - -// SetResourceTypeFilters sets the ResourceTypeFilters field's value. -func (s *GetComplianceSummaryInput) SetResourceTypeFilters(v []*string) *GetComplianceSummaryInput { - s.ResourceTypeFilters = v - return s -} - -// SetTagKeyFilters sets the TagKeyFilters field's value. -func (s *GetComplianceSummaryInput) SetTagKeyFilters(v []*string) *GetComplianceSummaryInput { - s.TagKeyFilters = v - return s -} - -// SetTargetIdFilters sets the TargetIdFilters field's value. -func (s *GetComplianceSummaryInput) SetTargetIdFilters(v []*string) *GetComplianceSummaryInput { - s.TargetIdFilters = v - return s -} - -type GetComplianceSummaryOutput struct { - _ struct{} `type:"structure"` - - // A string that indicates that there is more data available than this response - // contains. To receive the next part of the response, specify this response - // value as the PaginationToken value in the request for the next page. - PaginationToken *string `type:"string"` - - // A table that shows counts of noncompliant resources. - SummaryList []*Summary `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetComplianceSummaryOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetComplianceSummaryOutput) GoString() string { - return s.String() -} - -// SetPaginationToken sets the PaginationToken field's value. -func (s *GetComplianceSummaryOutput) SetPaginationToken(v string) *GetComplianceSummaryOutput { - s.PaginationToken = &v - return s -} - -// SetSummaryList sets the SummaryList field's value. -func (s *GetComplianceSummaryOutput) SetSummaryList(v []*Summary) *GetComplianceSummaryOutput { - s.SummaryList = v - return s -} - -type GetResourcesInput struct { - _ struct{} `type:"structure"` - - // Specifies whether to exclude resources that are compliant with the tag policy. - // Set this to true if you are interested in retrieving information on noncompliant - // resources only. - // - // You can use this parameter only if the IncludeComplianceDetails parameter - // is also set to true. - ExcludeCompliantResources *bool `type:"boolean"` - - // Specifies whether to include details regarding the compliance with the effective - // tag policy. Set this to true to determine whether resources are compliant - // with the tag policy and to get details. - IncludeComplianceDetails *bool `type:"boolean"` - - // Specifies a PaginationToken response value from a previous request to indicate - // that you want the next page of results. Leave this parameter empty in your - // initial request. - PaginationToken *string `type:"string"` - - // Specifies a list of ARNs of resources for which you want to retrieve tag - // data. You can't specify both this parameter and any of the pagination parameters - // (ResourcesPerPage, TagsPerPage, PaginationToken) in the same request. If - // you specify both, you get an Invalid Parameter exception. - // - // If a resource specified by this parameter doesn't exist, it doesn't generate - // an error; it simply isn't included in the response. - // - // An ARN (Amazon Resource Name) uniquely identifies a resource. For more information, - // see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces - // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the Amazon Web Services General Reference. - ResourceARNList []*string `min:"1" type:"list"` - - // Specifies the resource types that you want included in the response. The - // format of each resource type is service[:resourceType]. For example, specifying - // a resource type of ec2 returns all Amazon EC2 resources (which includes EC2 - // instances). Specifying a resource type of ec2:instance returns only EC2 instances. - // - // The string for each service name and resource type is the same as that embedded - // in a resource's Amazon Resource Name (ARN). For the list of services whose - // resources you can use in this parameter, see Services that support the Resource - // Groups Tagging API (https://docs.aws.amazon.com/resourcegroupstagging/latest/APIReference/supported-services.html). - // - // You can specify multiple resource types by using an array. The array can - // include up to 100 items. Note that the length constraint requirement applies - // to each resource type filter. For example, the following string would limit - // the response to only Amazon EC2 instances, Amazon S3 buckets, or any Audit - // Manager resource: - // - // ec2:instance,s3:bucket,auditmanager - ResourceTypeFilters []*string `type:"list"` - - // Specifies the maximum number of results to be returned in each page. A query - // can return fewer than this maximum, even if there are more results still - // to return. You should always check the PaginationToken response value to - // see if there are more results. You can specify a minimum of 1 and a maximum - // value of 100. - ResourcesPerPage *int64 `type:"integer"` - - // Specifies a list of TagFilters (keys and values) to restrict the output to - // only those resources that have tags with the specified keys and, if included, - // the specified values. Each TagFilter must contain a key with values optional. - // A request can include up to 50 keys, and each key can include up to 20 values. - // - // Note the following when deciding how to use TagFilters: - // - // * If you don't specify a TagFilter, the response includes all resources - // that are currently tagged or ever had a tag. Resources that currently - // don't have tags are shown with an empty tag set, like this: "Tags": []. - // - // * If you specify more than one filter in a single request, the response - // returns only those resources that satisfy all filters. - // - // * If you specify a filter that contains more than one value for a key, - // the response returns resources that match any of the specified values - // for that key. - // - // * If you don't specify a value for a key, the response returns all resources - // that are tagged with that key, with any or no value. For example, for - // the following filters: filter1= {keyA,{value1}}, filter2={keyB,{value2,value3,value4}}, - // filter3= {keyC}: GetResources({filter1}) returns resources tagged with - // key1=value1 GetResources({filter2}) returns resources tagged with key2=value2 - // or key2=value3 or key2=value4 GetResources({filter3}) returns resources - // tagged with any tag with the key key3, and with any or no value GetResources({filter1,filter2,filter3}) - // returns resources tagged with (key1=value1) and (key2=value2 or key2=value3 - // or key2=value4) and (key3, any or no value) - TagFilters []*TagFilter `type:"list"` - - // Amazon Web Services recommends using ResourcesPerPage instead of this parameter. - // - // A limit that restricts the number of tags (key and value pairs) returned - // by GetResources in paginated output. A resource with no tags is counted as - // having one tag (one key and value pair). - // - // GetResources does not split a resource and its associated tags across pages. - // If the specified TagsPerPage would cause such a break, a PaginationToken - // is returned in place of the affected resource and its tags. Use that token - // in another request to get the remaining data. For example, if you specify - // a TagsPerPage of 100 and the account has 22 resources with 10 tags each (meaning - // that each resource has 10 key and value pairs), the output will consist of - // three pages. The first page displays the first 10 resources, each with its - // 10 tags. The second page displays the next 10 resources, each with its 10 - // tags. The third page displays the remaining 2 resources, each with its 10 - // tags. - // - // You can set TagsPerPage to a minimum of 100 items up to a maximum of 500 - // items. - TagsPerPage *int64 `type:"integer"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetResourcesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetResourcesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetResourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetResourcesInput"} - if s.ResourceARNList != nil && len(s.ResourceARNList) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARNList", 1)) - } - if s.TagFilters != nil { - for i, v := range s.TagFilters { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagFilters", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExcludeCompliantResources sets the ExcludeCompliantResources field's value. -func (s *GetResourcesInput) SetExcludeCompliantResources(v bool) *GetResourcesInput { - s.ExcludeCompliantResources = &v - return s -} - -// SetIncludeComplianceDetails sets the IncludeComplianceDetails field's value. -func (s *GetResourcesInput) SetIncludeComplianceDetails(v bool) *GetResourcesInput { - s.IncludeComplianceDetails = &v - return s -} - -// SetPaginationToken sets the PaginationToken field's value. -func (s *GetResourcesInput) SetPaginationToken(v string) *GetResourcesInput { - s.PaginationToken = &v - return s -} - -// SetResourceARNList sets the ResourceARNList field's value. -func (s *GetResourcesInput) SetResourceARNList(v []*string) *GetResourcesInput { - s.ResourceARNList = v - return s -} - -// SetResourceTypeFilters sets the ResourceTypeFilters field's value. -func (s *GetResourcesInput) SetResourceTypeFilters(v []*string) *GetResourcesInput { - s.ResourceTypeFilters = v - return s -} - -// SetResourcesPerPage sets the ResourcesPerPage field's value. -func (s *GetResourcesInput) SetResourcesPerPage(v int64) *GetResourcesInput { - s.ResourcesPerPage = &v - return s -} - -// SetTagFilters sets the TagFilters field's value. -func (s *GetResourcesInput) SetTagFilters(v []*TagFilter) *GetResourcesInput { - s.TagFilters = v - return s -} - -// SetTagsPerPage sets the TagsPerPage field's value. -func (s *GetResourcesInput) SetTagsPerPage(v int64) *GetResourcesInput { - s.TagsPerPage = &v - return s -} - -type GetResourcesOutput struct { - _ struct{} `type:"structure"` - - // A string that indicates that there is more data available than this response - // contains. To receive the next part of the response, specify this response - // value as the PaginationToken value in the request for the next page. - PaginationToken *string `type:"string"` - - // A list of resource ARNs and the tags (keys and values) associated with each. - ResourceTagMappingList []*ResourceTagMapping `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetResourcesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetResourcesOutput) GoString() string { - return s.String() -} - -// SetPaginationToken sets the PaginationToken field's value. -func (s *GetResourcesOutput) SetPaginationToken(v string) *GetResourcesOutput { - s.PaginationToken = &v - return s -} - -// SetResourceTagMappingList sets the ResourceTagMappingList field's value. -func (s *GetResourcesOutput) SetResourceTagMappingList(v []*ResourceTagMapping) *GetResourcesOutput { - s.ResourceTagMappingList = v - return s -} - -type GetTagKeysInput struct { - _ struct{} `type:"structure"` - - // Specifies a PaginationToken response value from a previous request to indicate - // that you want the next page of results. Leave this parameter empty in your - // initial request. - PaginationToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetTagKeysInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetTagKeysInput) GoString() string { - return s.String() -} - -// SetPaginationToken sets the PaginationToken field's value. -func (s *GetTagKeysInput) SetPaginationToken(v string) *GetTagKeysInput { - s.PaginationToken = &v - return s -} - -type GetTagKeysOutput struct { - _ struct{} `type:"structure"` - - // A string that indicates that there is more data available than this response - // contains. To receive the next part of the response, specify this response - // value as the PaginationToken value in the request for the next page. - PaginationToken *string `type:"string"` - - // A list of all tag keys in the Amazon Web Services account. - TagKeys []*string `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetTagKeysOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetTagKeysOutput) GoString() string { - return s.String() -} - -// SetPaginationToken sets the PaginationToken field's value. -func (s *GetTagKeysOutput) SetPaginationToken(v string) *GetTagKeysOutput { - s.PaginationToken = &v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *GetTagKeysOutput) SetTagKeys(v []*string) *GetTagKeysOutput { - s.TagKeys = v - return s -} - -type GetTagValuesInput struct { - _ struct{} `type:"structure"` - - // Specifies the tag key for which you want to list all existing values that - // are currently used in the specified Amazon Web Services Region for the calling - // account. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // Specifies a PaginationToken response value from a previous request to indicate - // that you want the next page of results. Leave this parameter empty in your - // initial request. - PaginationToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetTagValuesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetTagValuesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetTagValuesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetTagValuesInput"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *GetTagValuesInput) SetKey(v string) *GetTagValuesInput { - s.Key = &v - return s -} - -// SetPaginationToken sets the PaginationToken field's value. -func (s *GetTagValuesInput) SetPaginationToken(v string) *GetTagValuesInput { - s.PaginationToken = &v - return s -} - -type GetTagValuesOutput struct { - _ struct{} `type:"structure"` - - // A string that indicates that there is more data available than this response - // contains. To receive the next part of the response, specify this response - // value as the PaginationToken value in the request for the next page. - PaginationToken *string `type:"string"` - - // A list of all tag values for the specified key currently used in the specified - // Amazon Web Services Region for the calling account. - TagValues []*string `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetTagValuesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetTagValuesOutput) GoString() string { - return s.String() -} - -// SetPaginationToken sets the PaginationToken field's value. -func (s *GetTagValuesOutput) SetPaginationToken(v string) *GetTagValuesOutput { - s.PaginationToken = &v - return s -} - -// SetTagValues sets the TagValues field's value. -func (s *GetTagValuesOutput) SetTagValues(v []*string) *GetTagValuesOutput { - s.TagValues = v - return s -} - -// The request processing failed because of an unknown error, exception, or -// failure. You can retry the request. -type InternalServiceException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InternalServiceException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InternalServiceException) GoString() string { - return s.String() -} - -func newErrorInternalServiceException(v protocol.ResponseMetadata) error { - return &InternalServiceException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InternalServiceException) Code() string { - return "InternalServiceException" -} - -// Message returns the exception's message. -func (s *InternalServiceException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InternalServiceException) OrigErr() error { - return nil -} - -func (s *InternalServiceException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InternalServiceException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InternalServiceException) RequestID() string { - return s.RespMetadata.RequestID -} - -// This error indicates one of the following: -// -// - A parameter is missing. -// -// - A malformed string was supplied for the request parameter. -// -// - An out-of-range value was supplied for the request parameter. -// -// - The target ID is invalid, unsupported, or doesn't exist. -// -// - You can't access the Amazon S3 bucket for report storage. For more information, -// see Additional Requirements for Organization-wide Tag Compliance Reports -// (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html#bucket-policies-org-report) -// in the Organizations User Guide. -type InvalidParameterException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidParameterException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InvalidParameterException) GoString() string { - return s.String() -} - -func newErrorInvalidParameterException(v protocol.ResponseMetadata) error { - return &InvalidParameterException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *InvalidParameterException) Code() string { - return "InvalidParameterException" -} - -// Message returns the exception's message. -func (s *InvalidParameterException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *InvalidParameterException) OrigErr() error { - return nil -} - -func (s *InvalidParameterException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *InvalidParameterException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *InvalidParameterException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A PaginationToken is valid for a maximum of 15 minutes. Your request was -// denied because the specified PaginationToken has expired. -type PaginationTokenExpiredException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PaginationTokenExpiredException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PaginationTokenExpiredException) GoString() string { - return s.String() -} - -func newErrorPaginationTokenExpiredException(v protocol.ResponseMetadata) error { - return &PaginationTokenExpiredException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *PaginationTokenExpiredException) Code() string { - return "PaginationTokenExpiredException" -} - -// Message returns the exception's message. -func (s *PaginationTokenExpiredException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *PaginationTokenExpiredException) OrigErr() error { - return nil -} - -func (s *PaginationTokenExpiredException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *PaginationTokenExpiredException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *PaginationTokenExpiredException) RequestID() string { - return s.RespMetadata.RequestID -} - -// A list of resource ARNs and the tags (keys and values) that are associated -// with each. -type ResourceTagMapping struct { - _ struct{} `type:"structure"` - - // Information that shows whether a resource is compliant with the effective - // tag policy, including details on any noncompliant tag keys. - ComplianceDetails *ComplianceDetails `type:"structure"` - - // The ARN of the resource. - ResourceARN *string `min:"1" type:"string"` - - // The tags that have been applied to one or more Amazon Web Services resources. - Tags []*Tag `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ResourceTagMapping) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ResourceTagMapping) GoString() string { - return s.String() -} - -// SetComplianceDetails sets the ComplianceDetails field's value. -func (s *ResourceTagMapping) SetComplianceDetails(v *ComplianceDetails) *ResourceTagMapping { - s.ComplianceDetails = v - return s -} - -// SetResourceARN sets the ResourceARN field's value. -func (s *ResourceTagMapping) SetResourceARN(v string) *ResourceTagMapping { - s.ResourceARN = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ResourceTagMapping) SetTags(v []*Tag) *ResourceTagMapping { - s.Tags = v - return s -} - -type StartReportCreationInput struct { - _ struct{} `type:"structure"` - - // The name of the Amazon S3 bucket where the report will be stored; for example: - // - // awsexamplebucket - // - // For more information on S3 bucket requirements, including an example bucket - // policy, see the example S3 bucket policy on this page. - // - // S3Bucket is a required field - S3Bucket *string `min:"3" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StartReportCreationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StartReportCreationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StartReportCreationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StartReportCreationInput"} - if s.S3Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("S3Bucket")) - } - if s.S3Bucket != nil && len(*s.S3Bucket) < 3 { - invalidParams.Add(request.NewErrParamMinLen("S3Bucket", 3)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3Bucket sets the S3Bucket field's value. -func (s *StartReportCreationInput) SetS3Bucket(v string) *StartReportCreationInput { - s.S3Bucket = &v - return s -} - -type StartReportCreationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StartReportCreationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StartReportCreationOutput) GoString() string { - return s.String() -} - -// A count of noncompliant resources. -type Summary struct { - _ struct{} `type:"structure"` - - // The timestamp that shows when this summary was generated in this Region. - LastUpdated *string `type:"string"` - - // The count of noncompliant resources. - NonCompliantResources *int64 `type:"long"` - - // The Amazon Web Services Region that the summary applies to. - Region *string `min:"1" type:"string"` - - // The Amazon Web Services resource type. - ResourceType *string `type:"string"` - - // The account identifier or the root identifier of the organization. If you - // don't know the root ID, you can call the Organizations ListRoots (https://docs.aws.amazon.com/organizations/latest/APIReference/API_ListRoots.html) - // API. - TargetId *string `min:"6" type:"string"` - - // Whether the target is an account, an OU, or the organization root. - TargetIdType *string `type:"string" enum:"TargetIdType"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Summary) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Summary) GoString() string { - return s.String() -} - -// SetLastUpdated sets the LastUpdated field's value. -func (s *Summary) SetLastUpdated(v string) *Summary { - s.LastUpdated = &v - return s -} - -// SetNonCompliantResources sets the NonCompliantResources field's value. -func (s *Summary) SetNonCompliantResources(v int64) *Summary { - s.NonCompliantResources = &v - return s -} - -// SetRegion sets the Region field's value. -func (s *Summary) SetRegion(v string) *Summary { - s.Region = &v - return s -} - -// SetResourceType sets the ResourceType field's value. -func (s *Summary) SetResourceType(v string) *Summary { - s.ResourceType = &v - return s -} - -// SetTargetId sets the TargetId field's value. -func (s *Summary) SetTargetId(v string) *Summary { - s.TargetId = &v - return s -} - -// SetTargetIdType sets the TargetIdType field's value. -func (s *Summary) SetTargetIdType(v string) *Summary { - s.TargetIdType = &v - return s -} - -// The metadata that you apply to Amazon Web Services resources to help you -// categorize and organize them. Each tag consists of a key and a value, both -// of which you define. For more information, see Tagging Amazon Web Services -// Resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) -// in the Amazon Web Services General Reference. -type Tag struct { - _ struct{} `type:"structure"` - - // One part of a key-value pair that makes up a tag. A key is a general label - // that acts like a category for more specific tag values. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // One part of a key-value pair that make up a tag. A value acts as a descriptor - // within a tag category (key). The value can be empty or null. - // - // Value is a required field - Value *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Tag) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Tag) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -// A list of tags (keys and values) that are used to specify the associated -// resources. -type TagFilter struct { - _ struct{} `type:"structure"` - - // One part of a key-value pair that makes up a tag. A key is a general label - // that acts like a category for more specific tag values. - Key *string `min:"1" type:"string"` - - // One part of a key-value pair that make up a tag. A value acts as a descriptor - // within a tag category (key). The value can be empty or null. - Values []*string `type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TagFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TagFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagFilter"} - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *TagFilter) SetKey(v string) *TagFilter { - s.Key = &v - return s -} - -// SetValues sets the Values field's value. -func (s *TagFilter) SetValues(v []*string) *TagFilter { - s.Values = v - return s -} - -type TagResourcesInput struct { - _ struct{} `type:"structure"` - - // Specifies the list of ARNs of the resources that you want to apply tags to. - // - // An ARN (Amazon Resource Name) uniquely identifies a resource. For more information, - // see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces - // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the Amazon Web Services General Reference. - // - // ResourceARNList is a required field - ResourceARNList []*string `min:"1" type:"list" required:"true"` - - // Specifies a list of tags that you want to add to the specified resources. - // A tag consists of a key and a value that you define. - // - // Tags is a required field - Tags map[string]*string `min:"1" type:"map" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TagResourcesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TagResourcesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TagResourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TagResourcesInput"} - if s.ResourceARNList == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARNList")) - } - if s.ResourceARNList != nil && len(s.ResourceARNList) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARNList", 1)) - } - if s.Tags == nil { - invalidParams.Add(request.NewErrParamRequired("Tags")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceARNList sets the ResourceARNList field's value. -func (s *TagResourcesInput) SetResourceARNList(v []*string) *TagResourcesInput { - s.ResourceARNList = v - return s -} - -// SetTags sets the Tags field's value. -func (s *TagResourcesInput) SetTags(v map[string]*string) *TagResourcesInput { - s.Tags = v - return s -} - -type TagResourcesOutput struct { - _ struct{} `type:"structure"` - - // A map containing a key-value pair for each failed item that couldn't be tagged. - // The key is the ARN of the failed resource. The value is a FailureInfo object - // that contains an error code, a status code, and an error message. If there - // are no errors, the FailedResourcesMap is empty. - FailedResourcesMap map[string]*FailureInfo `type:"map"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TagResourcesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TagResourcesOutput) GoString() string { - return s.String() -} - -// SetFailedResourcesMap sets the FailedResourcesMap field's value. -func (s *TagResourcesOutput) SetFailedResourcesMap(v map[string]*FailureInfo) *TagResourcesOutput { - s.FailedResourcesMap = v - return s -} - -// The request was denied to limit the frequency of submitted requests. -type ThrottledException struct { - _ struct{} `type:"structure"` - RespMetadata protocol.ResponseMetadata `json:"-" xml:"-"` - - Message_ *string `locationName:"Message" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ThrottledException) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ThrottledException) GoString() string { - return s.String() -} - -func newErrorThrottledException(v protocol.ResponseMetadata) error { - return &ThrottledException{ - RespMetadata: v, - } -} - -// Code returns the exception type name. -func (s *ThrottledException) Code() string { - return "ThrottledException" -} - -// Message returns the exception's message. -func (s *ThrottledException) Message() string { - if s.Message_ != nil { - return *s.Message_ - } - return "" -} - -// OrigErr always returns nil, satisfies awserr.Error interface. -func (s *ThrottledException) OrigErr() error { - return nil -} - -func (s *ThrottledException) Error() string { - return fmt.Sprintf("%s: %s", s.Code(), s.Message()) -} - -// Status code returns the HTTP status code for the request's response error. -func (s *ThrottledException) StatusCode() int { - return s.RespMetadata.StatusCode -} - -// RequestID returns the service's response RequestID for request. -func (s *ThrottledException) RequestID() string { - return s.RespMetadata.RequestID -} - -type UntagResourcesInput struct { - _ struct{} `type:"structure"` - - // Specifies a list of ARNs of the resources that you want to remove tags from. - // - // An ARN (Amazon Resource Name) uniquely identifies a resource. For more information, - // see Amazon Resource Names (ARNs) and Amazon Web Services Service Namespaces - // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) - // in the Amazon Web Services General Reference. - // - // ResourceARNList is a required field - ResourceARNList []*string `min:"1" type:"list" required:"true"` - - // Specifies a list of tag keys that you want to remove from the specified resources. - // - // TagKeys is a required field - TagKeys []*string `min:"1" type:"list" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UntagResourcesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UntagResourcesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UntagResourcesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UntagResourcesInput"} - if s.ResourceARNList == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceARNList")) - } - if s.ResourceARNList != nil && len(s.ResourceARNList) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResourceARNList", 1)) - } - if s.TagKeys == nil { - invalidParams.Add(request.NewErrParamRequired("TagKeys")) - } - if s.TagKeys != nil && len(s.TagKeys) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TagKeys", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceARNList sets the ResourceARNList field's value. -func (s *UntagResourcesInput) SetResourceARNList(v []*string) *UntagResourcesInput { - s.ResourceARNList = v - return s -} - -// SetTagKeys sets the TagKeys field's value. -func (s *UntagResourcesInput) SetTagKeys(v []*string) *UntagResourcesInput { - s.TagKeys = v - return s -} - -type UntagResourcesOutput struct { - _ struct{} `type:"structure"` - - // A map containing a key-value pair for each failed item that couldn't be untagged. - // The key is the ARN of the failed resource. The value is a FailureInfo object - // that contains an error code, a status code, and an error message. If there - // are no errors, the FailedResourcesMap is empty. - FailedResourcesMap map[string]*FailureInfo `type:"map"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UntagResourcesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UntagResourcesOutput) GoString() string { - return s.String() -} - -// SetFailedResourcesMap sets the FailedResourcesMap field's value. -func (s *UntagResourcesOutput) SetFailedResourcesMap(v map[string]*FailureInfo) *UntagResourcesOutput { - s.FailedResourcesMap = v - return s -} - -const ( - // ErrorCodeInternalServiceException is a ErrorCode enum value - ErrorCodeInternalServiceException = "InternalServiceException" - - // ErrorCodeInvalidParameterException is a ErrorCode enum value - ErrorCodeInvalidParameterException = "InvalidParameterException" -) - -// ErrorCode_Values returns all elements of the ErrorCode enum -func ErrorCode_Values() []string { - return []string{ - ErrorCodeInternalServiceException, - ErrorCodeInvalidParameterException, - } -} - -const ( - // GroupByAttributeTargetId is a GroupByAttribute enum value - GroupByAttributeTargetId = "TARGET_ID" - - // GroupByAttributeRegion is a GroupByAttribute enum value - GroupByAttributeRegion = "REGION" - - // GroupByAttributeResourceType is a GroupByAttribute enum value - GroupByAttributeResourceType = "RESOURCE_TYPE" -) - -// GroupByAttribute_Values returns all elements of the GroupByAttribute enum -func GroupByAttribute_Values() []string { - return []string{ - GroupByAttributeTargetId, - GroupByAttributeRegion, - GroupByAttributeResourceType, - } -} - -const ( - // TargetIdTypeAccount is a TargetIdType enum value - TargetIdTypeAccount = "ACCOUNT" - - // TargetIdTypeOu is a TargetIdType enum value - TargetIdTypeOu = "OU" - - // TargetIdTypeRoot is a TargetIdType enum value - TargetIdTypeRoot = "ROOT" -) - -// TargetIdType_Values returns all elements of the TargetIdType enum -func TargetIdType_Values() []string { - return []string{ - TargetIdTypeAccount, - TargetIdTypeOu, - TargetIdTypeRoot, - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/doc.go b/vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/doc.go deleted file mode 100644 index fad73571ce..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/doc.go +++ /dev/null @@ -1,28 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package resourcegroupstaggingapi provides the client and types for making API -// requests to AWS Resource Groups Tagging API. -// -// # Resource Groups Tagging API -// -// See https://docs.aws.amazon.com/goto/WebAPI/resourcegroupstaggingapi-2017-01-26 for more information on this service. -// -// See resourcegroupstaggingapi package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/resourcegroupstaggingapi/ -// -// # Using the Client -// -// To contact AWS Resource Groups Tagging API with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the AWS Resource Groups Tagging API client ResourceGroupsTaggingAPI for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/resourcegroupstaggingapi/#New -package resourcegroupstaggingapi diff --git a/vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/errors.go b/vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/errors.go deleted file mode 100644 index d7ccece232..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/errors.go +++ /dev/null @@ -1,85 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package resourcegroupstaggingapi - -import ( - "github.com/aws/aws-sdk-go/private/protocol" -) - -const ( - - // ErrCodeConcurrentModificationException for service response error code - // "ConcurrentModificationException". - // - // The target of the operation is currently being modified by a different request. - // Try again later. - ErrCodeConcurrentModificationException = "ConcurrentModificationException" - - // ErrCodeConstraintViolationException for service response error code - // "ConstraintViolationException". - // - // The request was denied because performing this operation violates a constraint. - // - // Some of the reasons in the following list might not apply to this specific - // operation. - // - // * You must meet the prerequisites for using tag policies. For information, - // see Prerequisites and Permissions for Using Tag Policies (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html) - // in the Organizations User Guide. - // - // * You must enable the tag policies service principal (tagpolicies.tag.amazonaws.com) - // to integrate with Organizations For information, see EnableAWSServiceAccess - // (https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAWSServiceAccess.html). - // - // * You must have a tag policy attached to the organization root, an OU, - // or an account. - ErrCodeConstraintViolationException = "ConstraintViolationException" - - // ErrCodeInternalServiceException for service response error code - // "InternalServiceException". - // - // The request processing failed because of an unknown error, exception, or - // failure. You can retry the request. - ErrCodeInternalServiceException = "InternalServiceException" - - // ErrCodeInvalidParameterException for service response error code - // "InvalidParameterException". - // - // This error indicates one of the following: - // - // * A parameter is missing. - // - // * A malformed string was supplied for the request parameter. - // - // * An out-of-range value was supplied for the request parameter. - // - // * The target ID is invalid, unsupported, or doesn't exist. - // - // * You can't access the Amazon S3 bucket for report storage. For more information, - // see Additional Requirements for Organization-wide Tag Compliance Reports - // (https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies-prereqs.html#bucket-policies-org-report) - // in the Organizations User Guide. - ErrCodeInvalidParameterException = "InvalidParameterException" - - // ErrCodePaginationTokenExpiredException for service response error code - // "PaginationTokenExpiredException". - // - // A PaginationToken is valid for a maximum of 15 minutes. Your request was - // denied because the specified PaginationToken has expired. - ErrCodePaginationTokenExpiredException = "PaginationTokenExpiredException" - - // ErrCodeThrottledException for service response error code - // "ThrottledException". - // - // The request was denied to limit the frequency of submitted requests. - ErrCodeThrottledException = "ThrottledException" -) - -var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{ - "ConcurrentModificationException": newErrorConcurrentModificationException, - "ConstraintViolationException": newErrorConstraintViolationException, - "InternalServiceException": newErrorInternalServiceException, - "InvalidParameterException": newErrorInvalidParameterException, - "PaginationTokenExpiredException": newErrorPaginationTokenExpiredException, - "ThrottledException": newErrorThrottledException, -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/service.go b/vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/service.go deleted file mode 100644 index 275689370a..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi/service.go +++ /dev/null @@ -1,109 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package resourcegroupstaggingapi - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/signer/v4" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -// ResourceGroupsTaggingAPI provides the API operation methods for making requests to -// AWS Resource Groups Tagging API. See this package's package overview docs -// for details on the service. -// -// ResourceGroupsTaggingAPI methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type ResourceGroupsTaggingAPI struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "tagging" // Name of service. - EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "Resource Groups Tagging API" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the ResourceGroupsTaggingAPI client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a ResourceGroupsTaggingAPI client from just a session. -// svc := resourcegroupstaggingapi.New(mySession) -// -// // Create a ResourceGroupsTaggingAPI client with additional configuration -// svc := resourcegroupstaggingapi.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *ResourceGroupsTaggingAPI { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = EndpointsID - // No Fallback - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *ResourceGroupsTaggingAPI { - svc := &ResourceGroupsTaggingAPI{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2017-01-26", - ResolvedRegion: resolvedRegion, - JSONVersion: "1.1", - TargetPrefix: "ResourceGroupsTaggingAPI_20170126", - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.SignRequestHandler) - svc.Handlers.Build.PushBackNamed(jsonrpc.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(jsonrpc.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(jsonrpc.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed( - protocol.NewUnmarshalErrorHandler(jsonrpc.NewUnmarshalTypedError(exceptionFromCode)).NamedHandler(), - ) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a ResourceGroupsTaggingAPI operation and runs any -// custom request initialization. -func (c *ResourceGroupsTaggingAPI) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go b/vendor/github.com/aws/aws-sdk-go/service/s3/api.go deleted file mode 100644 index a9c653a00d..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/api.go +++ /dev/null @@ -1,42113 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package s3 - -import ( - "bytes" - "fmt" - "io" - "sync" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/signer/v4" - "github.com/aws/aws-sdk-go/internal/s3shared/arn" - "github.com/aws/aws-sdk-go/private/checksum" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/eventstream" - "github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamapi" - "github.com/aws/aws-sdk-go/private/protocol/rest" - "github.com/aws/aws-sdk-go/private/protocol/restxml" -) - -const opAbortMultipartUpload = "AbortMultipartUpload" - -// AbortMultipartUploadRequest generates a "aws/request.Request" representing the -// client's request for the AbortMultipartUpload operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AbortMultipartUpload for more information on using the AbortMultipartUpload -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the AbortMultipartUploadRequest method. -// req, resp := client.AbortMultipartUploadRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AbortMultipartUpload -func (c *S3) AbortMultipartUploadRequest(input *AbortMultipartUploadInput) (req *request.Request, output *AbortMultipartUploadOutput) { - op := &request.Operation{ - Name: opAbortMultipartUpload, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}/{Key+}", - } - - if input == nil { - input = &AbortMultipartUploadInput{} - } - - output = &AbortMultipartUploadOutput{} - req = c.newRequest(op, input, output) - return -} - -// AbortMultipartUpload API operation for Amazon Simple Storage Service. -// -// This action aborts a multipart upload. After a multipart upload is aborted, -// no additional parts can be uploaded using that upload ID. The storage consumed -// by any previously uploaded parts will be freed. However, if any part uploads -// are currently in progress, those part uploads might or might not succeed. -// As a result, it might be necessary to abort a given multipart upload multiple -// times in order to completely free all storage consumed by all parts. -// -// To verify that all parts have been removed, so you don't get charged for -// the part storage, you should call the ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) -// action and ensure that the parts list is empty. -// -// For information about permissions required to use the multipart upload, see -// Multipart Upload and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). -// -// The following operations are related to AbortMultipartUpload: -// -// - CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) -// -// - UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// -// - CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) -// -// - ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) -// -// - ListMultipartUploads (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation AbortMultipartUpload for usage and error information. -// -// Returned Error Codes: -// - ErrCodeNoSuchUpload "NoSuchUpload" -// The specified multipart upload does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/AbortMultipartUpload -func (c *S3) AbortMultipartUpload(input *AbortMultipartUploadInput) (*AbortMultipartUploadOutput, error) { - req, out := c.AbortMultipartUploadRequest(input) - return out, req.Send() -} - -// AbortMultipartUploadWithContext is the same as AbortMultipartUpload with the addition of -// the ability to pass a context and additional request options. -// -// See AbortMultipartUpload for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) AbortMultipartUploadWithContext(ctx aws.Context, input *AbortMultipartUploadInput, opts ...request.Option) (*AbortMultipartUploadOutput, error) { - req, out := c.AbortMultipartUploadRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCompleteMultipartUpload = "CompleteMultipartUpload" - -// CompleteMultipartUploadRequest generates a "aws/request.Request" representing the -// client's request for the CompleteMultipartUpload operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CompleteMultipartUpload for more information on using the CompleteMultipartUpload -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the CompleteMultipartUploadRequest method. -// req, resp := client.CompleteMultipartUploadRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompleteMultipartUpload -func (c *S3) CompleteMultipartUploadRequest(input *CompleteMultipartUploadInput) (req *request.Request, output *CompleteMultipartUploadOutput) { - op := &request.Operation{ - Name: opCompleteMultipartUpload, - HTTPMethod: "POST", - HTTPPath: "/{Bucket}/{Key+}", - } - - if input == nil { - input = &CompleteMultipartUploadInput{} - } - - output = &CompleteMultipartUploadOutput{} - req = c.newRequest(op, input, output) - return -} - -// CompleteMultipartUpload API operation for Amazon Simple Storage Service. -// -// Completes a multipart upload by assembling previously uploaded parts. -// -// You first initiate the multipart upload and then upload all parts using the -// UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// operation. After successfully uploading all relevant parts of an upload, -// you call this action to complete the upload. Upon receiving this request, -// Amazon S3 concatenates all the parts in ascending order by part number to -// create a new object. In the Complete Multipart Upload request, you must provide -// the parts list. You must ensure that the parts list is complete. This action -// concatenates the parts that you provide in the list. For each part in the -// list, you must provide the part number and the ETag value, returned after -// that part was uploaded. -// -// Processing of a Complete Multipart Upload request could take several minutes -// to complete. After Amazon S3 begins processing the request, it sends an HTTP -// response header that specifies a 200 OK response. While processing is in -// progress, Amazon S3 periodically sends white space characters to keep the -// connection from timing out. Because a request could fail after the initial -// 200 OK response has been sent, it is important that you check the response -// body to determine whether the request succeeded. -// -// Note that if CompleteMultipartUpload fails, applications should be prepared -// to retry the failed requests. For more information, see Amazon S3 Error Best -// Practices (https://docs.aws.amazon.com/AmazonS3/latest/dev/ErrorBestPractices.html). -// -// You cannot use Content-Type: application/x-www-form-urlencoded with Complete -// Multipart Upload requests. Also, if you do not provide a Content-Type header, -// CompleteMultipartUpload returns a 200 OK response. -// -// For more information about multipart uploads, see Uploading Objects Using -// Multipart Upload (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html). -// -// For information about permissions required to use the multipart upload API, -// see Multipart Upload and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). -// -// CompleteMultipartUpload has the following special errors: -// -// - Error code: EntityTooSmall Description: Your proposed upload is smaller -// than the minimum allowed object size. Each part must be at least 5 MB -// in size, except the last part. 400 Bad Request -// -// - Error code: InvalidPart Description: One or more of the specified parts -// could not be found. The part might not have been uploaded, or the specified -// entity tag might not have matched the part's entity tag. 400 Bad Request -// -// - Error code: InvalidPartOrder Description: The list of parts was not -// in ascending order. The parts list must be specified in order by part -// number. 400 Bad Request -// -// - Error code: NoSuchUpload Description: The specified multipart upload -// does not exist. The upload ID might be invalid, or the multipart upload -// might have been aborted or completed. 404 Not Found -// -// The following operations are related to CompleteMultipartUpload: -// -// - CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) -// -// - UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// -// - AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) -// -// - ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) -// -// - ListMultipartUploads (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation CompleteMultipartUpload for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CompleteMultipartUpload -func (c *S3) CompleteMultipartUpload(input *CompleteMultipartUploadInput) (*CompleteMultipartUploadOutput, error) { - req, out := c.CompleteMultipartUploadRequest(input) - return out, req.Send() -} - -// CompleteMultipartUploadWithContext is the same as CompleteMultipartUpload with the addition of -// the ability to pass a context and additional request options. -// -// See CompleteMultipartUpload for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) CompleteMultipartUploadWithContext(ctx aws.Context, input *CompleteMultipartUploadInput, opts ...request.Option) (*CompleteMultipartUploadOutput, error) { - req, out := c.CompleteMultipartUploadRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCopyObject = "CopyObject" - -// CopyObjectRequest generates a "aws/request.Request" representing the -// client's request for the CopyObject operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CopyObject for more information on using the CopyObject -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the CopyObjectRequest method. -// req, resp := client.CopyObjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObject -func (c *S3) CopyObjectRequest(input *CopyObjectInput) (req *request.Request, output *CopyObjectOutput) { - op := &request.Operation{ - Name: opCopyObject, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}/{Key+}", - } - - if input == nil { - input = &CopyObjectInput{} - } - - output = &CopyObjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// CopyObject API operation for Amazon Simple Storage Service. -// -// Creates a copy of an object that is already stored in Amazon S3. -// -// You can store individual objects of up to 5 TB in Amazon S3. You create a -// copy of your object up to 5 GB in size in a single atomic action using this -// API. However, to copy an object greater than 5 GB, you must use the multipart -// upload Upload Part - Copy (UploadPartCopy) API. For more information, see -// Copy Object Using the REST Multipart Upload API (https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjctsUsingRESTMPUapi.html). -// -// All copy requests must be authenticated. Additionally, you must have read -// access to the source object and write access to the destination bucket. For -// more information, see REST Authentication (https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html). -// Both the Region that you want to copy the object from and the Region that -// you want to copy the object to must be enabled for your account. -// -// A copy request might return an error when Amazon S3 receives the copy request -// or while Amazon S3 is copying the files. If the error occurs before the copy -// action starts, you receive a standard Amazon S3 error. If the error occurs -// during the copy operation, the error response is embedded in the 200 OK response. -// This means that a 200 OK response can contain either a success or an error. -// Design your application to parse the contents of the response and handle -// it appropriately. -// -// If the copy is successful, you receive a response with information about -// the copied object. -// -// If the request is an HTTP 1.1 request, the response is chunk encoded. If -// it were not, it would not contain the content-length, and you would need -// to read the entire body. -// -// The copy request charge is based on the storage class and Region that you -// specify for the destination object. For pricing information, see Amazon S3 -// pricing (http://aws.amazon.com/s3/pricing/). -// -// Amazon S3 transfer acceleration does not support cross-Region copies. If -// you request a cross-Region copy using a transfer acceleration endpoint, you -// get a 400 Bad Request error. For more information, see Transfer Acceleration -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html). -// -// # Metadata -// -// When copying an object, you can preserve all metadata (default) or specify -// new metadata. However, the ACL is not preserved and is set to private for -// the user making the request. To override the default ACL setting, specify -// a new ACL when generating a copy request. For more information, see Using -// ACLs (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html). -// -// To specify whether you want the object metadata copied from the source object -// or replaced with metadata provided in the request, you can optionally add -// the x-amz-metadata-directive header. When you grant permissions, you can -// use the s3:x-amz-metadata-directive condition key to enforce certain metadata -// behavior when objects are uploaded. For more information, see Specifying -// Conditions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/amazon-s3-policy-keys.html) -// in the Amazon S3 User Guide. For a complete list of Amazon S3-specific condition -// keys, see Actions, Resources, and Condition Keys for Amazon S3 (https://docs.aws.amazon.com/AmazonS3/latest/dev/list_amazons3.html). -// -// x-amz-copy-source-if Headers -// -// To only copy an object under certain conditions, such as whether the Etag -// matches or whether the object was modified before or after a specified date, -// use the following request parameters: -// -// - x-amz-copy-source-if-match -// -// - x-amz-copy-source-if-none-match -// -// - x-amz-copy-source-if-unmodified-since -// -// - x-amz-copy-source-if-modified-since -// -// If both the x-amz-copy-source-if-match and x-amz-copy-source-if-unmodified-since -// headers are present in the request and evaluate as follows, Amazon S3 returns -// 200 OK and copies the data: -// -// - x-amz-copy-source-if-match condition evaluates to true -// -// - x-amz-copy-source-if-unmodified-since condition evaluates to false -// -// If both the x-amz-copy-source-if-none-match and x-amz-copy-source-if-modified-since -// headers are present in the request and evaluate as follows, Amazon S3 returns -// the 412 Precondition Failed response code: -// -// - x-amz-copy-source-if-none-match condition evaluates to false -// -// - x-amz-copy-source-if-modified-since condition evaluates to true -// -// All headers with the x-amz- prefix, including x-amz-copy-source, must be -// signed. -// -// # Server-side encryption -// -// When you perform a CopyObject operation, you can optionally use the appropriate -// encryption-related headers to encrypt the object using server-side encryption -// with Amazon Web Services managed encryption keys (SSE-S3 or SSE-KMS) or a -// customer-provided encryption key. With server-side encryption, Amazon S3 -// encrypts your data as it writes it to disks in its data centers and decrypts -// the data when you access it. For more information about server-side encryption, -// see Using Server-Side Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html). -// -// If a target object uses SSE-KMS, you can enable an S3 Bucket Key for the -// object. For more information, see Amazon S3 Bucket Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) -// in the Amazon S3 User Guide. -// -// # Access Control List (ACL)-Specific Request Headers -// -// When copying an object, you can optionally use headers to grant ACL-based -// permissions. By default, all objects are private. Only the owner has full -// access control. When adding a new object, you can grant permissions to individual -// Amazon Web Services accounts or to predefined groups defined by Amazon S3. -// These permissions are then added to the ACL on the object. For more information, -// see Access Control List (ACL) Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html) -// and Managing ACLs Using the REST API (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-using-rest-api.html). -// -// If the bucket that you're copying objects to uses the bucket owner enforced -// setting for S3 Object Ownership, ACLs are disabled and no longer affect permissions. -// Buckets that use this setting only accept PUT requests that don't specify -// an ACL or PUT requests that specify bucket owner full control ACLs, such -// as the bucket-owner-full-control canned ACL or an equivalent form of this -// ACL expressed in the XML format. -// -// For more information, see Controlling ownership of objects and disabling -// ACLs (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) -// in the Amazon S3 User Guide. -// -// If your bucket uses the bucket owner enforced setting for Object Ownership, -// all objects written to the bucket by any account will be owned by the bucket -// owner. -// -// # Checksums -// -// When copying an object, if it has a checksum, that checksum will be copied -// to the new object by default. When you copy the object over, you may optionally -// specify a different checksum algorithm to use with the x-amz-checksum-algorithm -// header. -// -// # Storage Class Options -// -// You can use the CopyObject action to change the storage class of an object -// that is already stored in Amazon S3 using the StorageClass parameter. For -// more information, see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) -// in the Amazon S3 User Guide. -// -// # Versioning -// -// By default, x-amz-copy-source identifies the current version of an object -// to copy. If the current version is a delete marker, Amazon S3 behaves as -// if the object was deleted. To copy a different version, use the versionId -// subresource. -// -// If you enable versioning on the target bucket, Amazon S3 generates a unique -// version ID for the object being copied. This version ID is different from -// the version ID of the source object. Amazon S3 returns the version ID of -// the copied object in the x-amz-version-id response header in the response. -// -// If you do not enable versioning or suspend it on the target bucket, the version -// ID that Amazon S3 generates is always null. -// -// If the source object's storage class is GLACIER, you must restore a copy -// of this object before you can use it as a source object for the copy operation. -// For more information, see RestoreObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html). -// -// The following operations are related to CopyObject: -// -// - PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) -// -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// -// For more information, see Copying Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjectsExamples.html). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation CopyObject for usage and error information. -// -// Returned Error Codes: -// - ErrCodeObjectNotInActiveTierError "ObjectNotInActiveTierError" -// The source object of the COPY action is not in the active tier and is only -// stored in Amazon S3 Glacier. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CopyObject -func (c *S3) CopyObject(input *CopyObjectInput) (*CopyObjectOutput, error) { - req, out := c.CopyObjectRequest(input) - return out, req.Send() -} - -// CopyObjectWithContext is the same as CopyObject with the addition of -// the ability to pass a context and additional request options. -// -// See CopyObject for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) CopyObjectWithContext(ctx aws.Context, input *CopyObjectInput, opts ...request.Option) (*CopyObjectOutput, error) { - req, out := c.CopyObjectRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateBucket = "CreateBucket" - -// CreateBucketRequest generates a "aws/request.Request" representing the -// client's request for the CreateBucket operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateBucket for more information on using the CreateBucket -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the CreateBucketRequest method. -// req, resp := client.CreateBucketRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucket -func (c *S3) CreateBucketRequest(input *CreateBucketInput) (req *request.Request, output *CreateBucketOutput) { - op := &request.Operation{ - Name: opCreateBucket, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}", - } - - if input == nil { - input = &CreateBucketInput{} - } - - output = &CreateBucketOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateBucket API operation for Amazon Simple Storage Service. -// -// Creates a new S3 bucket. To create a bucket, you must register with Amazon -// S3 and have a valid Amazon Web Services Access Key ID to authenticate requests. -// Anonymous requests are never allowed to create buckets. By creating the bucket, -// you become the bucket owner. -// -// Not every string is an acceptable bucket name. For information about bucket -// naming restrictions, see Bucket naming rules (https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html). -// -// If you want to create an Amazon S3 on Outposts bucket, see Create Bucket -// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateBucket.html). -// -// By default, the bucket is created in the US East (N. Virginia) Region. You -// can optionally specify a Region in the request body. You might choose a Region -// to optimize latency, minimize costs, or address regulatory requirements. -// For example, if you reside in Europe, you will probably find it advantageous -// to create buckets in the Europe (Ireland) Region. For more information, see -// Accessing a bucket (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro). -// -// If you send your create bucket request to the s3.amazonaws.com endpoint, -// the request goes to the us-east-1 Region. Accordingly, the signature calculations -// in Signature Version 4 must use us-east-1 as the Region, even if the location -// constraint in the request specifies another Region where the bucket is to -// be created. If you create a bucket in a Region other than US East (N. Virginia), -// your application must be able to handle 307 redirect. For more information, -// see Virtual hosting of buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html). -// -// Access control lists (ACLs) -// -// When creating a bucket using this operation, you can optionally configure -// the bucket ACL to specify the accounts or groups that should be granted specific -// permissions on the bucket. -// -// If your CreateBucket request sets bucket owner enforced for S3 Object Ownership -// and specifies a bucket ACL that provides access to an external Amazon Web -// Services account, your request fails with a 400 error and returns the InvalidBucketAclWithObjectOwnership -// error code. For more information, see Controlling object ownership (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) -// in the Amazon S3 User Guide. -// -// There are two ways to grant the appropriate permissions using the request -// headers. -// -// - Specify a canned ACL using the x-amz-acl request header. Amazon S3 supports -// a set of predefined ACLs, known as canned ACLs. Each canned ACL has a -// predefined set of grantees and permissions. For more information, see -// Canned ACL (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL). -// -// - Specify access permissions explicitly using the x-amz-grant-read, x-amz-grant-write, -// x-amz-grant-read-acp, x-amz-grant-write-acp, and x-amz-grant-full-control -// headers. These headers map to the set of permissions Amazon S3 supports -// in an ACL. For more information, see Access control list (ACL) overview -// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html). -// You specify each grantee as a type=value pair, where the type is one of -// the following: id – if the value specified is the canonical user ID -// of an Amazon Web Services account uri – if you are granting permissions -// to a predefined group emailAddress – if the value specified is the email -// address of an Amazon Web Services account Using email addresses to specify -// a grantee is only supported in the following Amazon Web Services Regions: -// US East (N. Virginia) US West (N. California) US West (Oregon) Asia Pacific -// (Singapore) Asia Pacific (Sydney) Asia Pacific (Tokyo) Europe (Ireland) -// South America (São Paulo) For a list of all the Amazon S3 supported Regions -// and endpoints, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) -// in the Amazon Web Services General Reference. For example, the following -// x-amz-grant-read header grants the Amazon Web Services accounts identified -// by account IDs permissions to read object data and its metadata: x-amz-grant-read: -// id="11112222333", id="444455556666" -// -// You can use either a canned ACL or specify access permissions explicitly. -// You cannot do both. -// -// # Permissions -// -// In addition to s3:CreateBucket, the following permissions are required when -// your CreateBucket includes specific headers: -// -// - ACLs - If your CreateBucket request specifies ACL permissions and the -// ACL is public-read, public-read-write, authenticated-read, or if you specify -// access permissions explicitly through any other ACL, both s3:CreateBucket -// and s3:PutBucketAcl permissions are needed. If the ACL the CreateBucket -// request is private or doesn't specify any ACLs, only s3:CreateBucket permission -// is needed. -// -// - Object Lock - If ObjectLockEnabledForBucket is set to true in your CreateBucket -// request, s3:PutBucketObjectLockConfiguration and s3:PutBucketVersioning -// permissions are required. -// -// - S3 Object Ownership - If your CreateBucket request includes the the -// x-amz-object-ownership header, s3:PutBucketOwnershipControls permission -// is required. -// -// The following operations are related to CreateBucket: -// -// - PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) -// -// - DeleteBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation CreateBucket for usage and error information. -// -// Returned Error Codes: -// -// - ErrCodeBucketAlreadyExists "BucketAlreadyExists" -// The requested bucket name is not available. The bucket namespace is shared -// by all users of the system. Select a different name and try again. -// -// - ErrCodeBucketAlreadyOwnedByYou "BucketAlreadyOwnedByYou" -// The bucket you tried to create already exists, and you own it. Amazon S3 -// returns this error in all Amazon Web Services Regions except in the North -// Virginia Region. For legacy compatibility, if you re-create an existing bucket -// that you already own in the North Virginia Region, Amazon S3 returns 200 -// OK and resets the bucket access control lists (ACLs). -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateBucket -func (c *S3) CreateBucket(input *CreateBucketInput) (*CreateBucketOutput, error) { - req, out := c.CreateBucketRequest(input) - return out, req.Send() -} - -// CreateBucketWithContext is the same as CreateBucket with the addition of -// the ability to pass a context and additional request options. -// -// See CreateBucket for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) CreateBucketWithContext(ctx aws.Context, input *CreateBucketInput, opts ...request.Option) (*CreateBucketOutput, error) { - req, out := c.CreateBucketRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateMultipartUpload = "CreateMultipartUpload" - -// CreateMultipartUploadRequest generates a "aws/request.Request" representing the -// client's request for the CreateMultipartUpload operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateMultipartUpload for more information on using the CreateMultipartUpload -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the CreateMultipartUploadRequest method. -// req, resp := client.CreateMultipartUploadRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateMultipartUpload -func (c *S3) CreateMultipartUploadRequest(input *CreateMultipartUploadInput) (req *request.Request, output *CreateMultipartUploadOutput) { - op := &request.Operation{ - Name: opCreateMultipartUpload, - HTTPMethod: "POST", - HTTPPath: "/{Bucket}/{Key+}?uploads", - } - - if input == nil { - input = &CreateMultipartUploadInput{} - } - - output = &CreateMultipartUploadOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateMultipartUpload API operation for Amazon Simple Storage Service. -// -// This action initiates a multipart upload and returns an upload ID. This upload -// ID is used to associate all of the parts in the specific multipart upload. -// You specify this upload ID in each of your subsequent upload part requests -// (see UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html)). -// You also include this upload ID in the final request to either complete or -// abort the multipart upload request. -// -// For more information about multipart uploads, see Multipart Upload Overview -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html). -// -// If you have configured a lifecycle rule to abort incomplete multipart uploads, -// the upload must complete within the number of days specified in the bucket -// lifecycle configuration. Otherwise, the incomplete multipart upload becomes -// eligible for an abort action and Amazon S3 aborts the multipart upload. For -// more information, see Aborting Incomplete Multipart Uploads Using a Bucket -// Lifecycle Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config). -// -// For information about the permissions required to use the multipart upload -// API, see Multipart Upload and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). -// -// For request signing, multipart upload is just a series of regular requests. -// You initiate a multipart upload, send one or more requests to upload parts, -// and then complete the multipart upload process. You sign each request individually. -// There is nothing special about signing multipart upload requests. For more -// information about signing, see Authenticating Requests (Amazon Web Services -// Signature Version 4) (https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html). -// -// After you initiate a multipart upload and upload one or more parts, to stop -// being charged for storing the uploaded parts, you must either complete or -// abort the multipart upload. Amazon S3 frees up the space used to store the -// parts and stop charging you for storing them only after you either complete -// or abort a multipart upload. -// -// You can optionally request server-side encryption. For server-side encryption, -// Amazon S3 encrypts your data as it writes it to disks in its data centers -// and decrypts it when you access it. You can provide your own encryption key, -// or use Amazon Web Services KMS keys or Amazon S3-managed encryption keys. -// If you choose to provide your own encryption key, the request headers you -// provide in UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// and UploadPartCopy (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html) -// requests must match the headers you used in the request to initiate the upload -// by using CreateMultipartUpload. -// -// To perform a multipart upload with encryption using an Amazon Web Services -// KMS key, the requester must have permission to the kms:Decrypt and kms:GenerateDataKey* -// actions on the key. These permissions are required because Amazon S3 must -// decrypt and read data from the encrypted file parts before it completes the -// multipart upload. For more information, see Multipart upload API and permissions -// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html#mpuAndPermissions) -// in the Amazon S3 User Guide. -// -// If your Identity and Access Management (IAM) user or role is in the same -// Amazon Web Services account as the KMS key, then you must have these permissions -// on the key policy. If your IAM user or role belongs to a different account -// than the key, then you must have the permissions on both the key policy and -// your IAM user or role. -// -// For more information, see Protecting Data Using Server-Side Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html). -// -// # Access Permissions -// -// When copying an object, you can optionally specify the accounts or groups -// that should be granted specific permissions on the new object. There are -// two ways to grant the permissions using the request headers: -// -// - Specify a canned ACL with the x-amz-acl request header. For more information, -// see Canned ACL (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL). -// -// - Specify access permissions explicitly with the x-amz-grant-read, x-amz-grant-read-acp, -// x-amz-grant-write-acp, and x-amz-grant-full-control headers. These parameters -// map to the set of permissions that Amazon S3 supports in an ACL. For more -// information, see Access Control List (ACL) Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html). -// -// You can use either a canned ACL or specify access permissions explicitly. -// You cannot do both. -// -// # Server-Side- Encryption-Specific Request Headers -// -// You can optionally tell Amazon S3 to encrypt data at rest using server-side -// encryption. Server-side encryption is for data encryption at rest. Amazon -// S3 encrypts your data as it writes it to disks in its data centers and decrypts -// it when you access it. The option you use depends on whether you want to -// use Amazon Web Services managed encryption keys or provide your own encryption -// key. -// -// - Use encryption keys managed by Amazon S3 or customer managed key stored -// in Amazon Web Services Key Management Service (Amazon Web Services KMS) -// – If you want Amazon Web Services to manage the keys used to encrypt -// data, specify the following headers in the request. x-amz-server-side-encryption -// x-amz-server-side-encryption-aws-kms-key-id x-amz-server-side-encryption-context -// If you specify x-amz-server-side-encryption:aws:kms, but don't provide -// x-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses the Amazon -// Web Services managed key in Amazon Web Services KMS to protect the data. -// All GET and PUT requests for an object protected by Amazon Web Services -// KMS fail if you don't make them with SSL or by using SigV4. For more information -// about server-side encryption with KMS key (SSE-KMS), see Protecting Data -// Using Server-Side Encryption with KMS keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html). -// -// - Use customer-provided encryption keys – If you want to manage your -// own encryption keys, provide all the following headers in the request. -// x-amz-server-side-encryption-customer-algorithm x-amz-server-side-encryption-customer-key -// x-amz-server-side-encryption-customer-key-MD5 For more information about -// server-side encryption with KMS keys (SSE-KMS), see Protecting Data Using -// Server-Side Encryption with KMS keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingKMSEncryption.html). -// -// # Access-Control-List (ACL)-Specific Request Headers -// -// You also can use the following access control–related headers with this -// operation. By default, all objects are private. Only the owner has full access -// control. When adding a new object, you can grant permissions to individual -// Amazon Web Services accounts or to predefined groups defined by Amazon S3. -// These permissions are then added to the access control list (ACL) on the -// object. For more information, see Using ACLs (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html). -// With this operation, you can grant access permissions using one of the following -// two methods: -// -// - Specify a canned ACL (x-amz-acl) — Amazon S3 supports a set of predefined -// ACLs, known as canned ACLs. Each canned ACL has a predefined set of grantees -// and permissions. For more information, see Canned ACL (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL). -// -// - Specify access permissions explicitly — To explicitly grant access -// permissions to specific Amazon Web Services accounts or groups, use the -// following headers. Each header maps to specific permissions that Amazon -// S3 supports in an ACL. For more information, see Access Control List (ACL) -// Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html). -// In the header, you specify a list of grantees who get the specific permission. -// To grant permissions explicitly, use: x-amz-grant-read x-amz-grant-write -// x-amz-grant-read-acp x-amz-grant-write-acp x-amz-grant-full-control You -// specify each grantee as a type=value pair, where the type is one of the -// following: id – if the value specified is the canonical user ID of an -// Amazon Web Services account uri – if you are granting permissions to -// a predefined group emailAddress – if the value specified is the email -// address of an Amazon Web Services account Using email addresses to specify -// a grantee is only supported in the following Amazon Web Services Regions: -// US East (N. Virginia) US West (N. California) US West (Oregon) Asia Pacific -// (Singapore) Asia Pacific (Sydney) Asia Pacific (Tokyo) Europe (Ireland) -// South America (São Paulo) For a list of all the Amazon S3 supported Regions -// and endpoints, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) -// in the Amazon Web Services General Reference. For example, the following -// x-amz-grant-read header grants the Amazon Web Services accounts identified -// by account IDs permissions to read object data and its metadata: x-amz-grant-read: -// id="11112222333", id="444455556666" -// -// The following operations are related to CreateMultipartUpload: -// -// - UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// -// - CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) -// -// - AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) -// -// - ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) -// -// - ListMultipartUploads (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation CreateMultipartUpload for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/CreateMultipartUpload -func (c *S3) CreateMultipartUpload(input *CreateMultipartUploadInput) (*CreateMultipartUploadOutput, error) { - req, out := c.CreateMultipartUploadRequest(input) - return out, req.Send() -} - -// CreateMultipartUploadWithContext is the same as CreateMultipartUpload with the addition of -// the ability to pass a context and additional request options. -// -// See CreateMultipartUpload for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) CreateMultipartUploadWithContext(ctx aws.Context, input *CreateMultipartUploadInput, opts ...request.Option) (*CreateMultipartUploadOutput, error) { - req, out := c.CreateMultipartUploadRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucket = "DeleteBucket" - -// DeleteBucketRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucket operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteBucket for more information on using the DeleteBucket -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteBucketRequest method. -// req, resp := client.DeleteBucketRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucket -func (c *S3) DeleteBucketRequest(input *DeleteBucketInput) (req *request.Request, output *DeleteBucketOutput) { - op := &request.Operation{ - Name: opDeleteBucket, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}", - } - - if input == nil { - input = &DeleteBucketInput{} - } - - output = &DeleteBucketOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucket API operation for Amazon Simple Storage Service. -// -// Deletes the S3 bucket. All objects (including all object versions and delete -// markers) in the bucket must be deleted before the bucket itself can be deleted. -// -// Related Resources -// -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// -// - DeleteObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation DeleteBucket for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucket -func (c *S3) DeleteBucket(input *DeleteBucketInput) (*DeleteBucketOutput, error) { - req, out := c.DeleteBucketRequest(input) - return out, req.Send() -} - -// DeleteBucketWithContext is the same as DeleteBucket with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucket for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) DeleteBucketWithContext(ctx aws.Context, input *DeleteBucketInput, opts ...request.Option) (*DeleteBucketOutput, error) { - req, out := c.DeleteBucketRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketAnalyticsConfiguration = "DeleteBucketAnalyticsConfiguration" - -// DeleteBucketAnalyticsConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketAnalyticsConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteBucketAnalyticsConfiguration for more information on using the DeleteBucketAnalyticsConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteBucketAnalyticsConfigurationRequest method. -// req, resp := client.DeleteBucketAnalyticsConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketAnalyticsConfiguration -func (c *S3) DeleteBucketAnalyticsConfigurationRequest(input *DeleteBucketAnalyticsConfigurationInput) (req *request.Request, output *DeleteBucketAnalyticsConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteBucketAnalyticsConfiguration, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?analytics", - } - - if input == nil { - input = &DeleteBucketAnalyticsConfigurationInput{} - } - - output = &DeleteBucketAnalyticsConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketAnalyticsConfiguration API operation for Amazon Simple Storage Service. -// -// Deletes an analytics configuration for the bucket (specified by the analytics -// configuration ID). -// -// To use this operation, you must have permissions to perform the s3:PutAnalyticsConfiguration -// action. The bucket owner has this permission by default. The bucket owner -// can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// For information about the Amazon S3 analytics feature, see Amazon S3 Analytics -// – Storage Class Analysis (https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html). -// -// The following operations are related to DeleteBucketAnalyticsConfiguration: -// -// - GetBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html) -// -// - ListBucketAnalyticsConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html) -// -// - PutBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation DeleteBucketAnalyticsConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketAnalyticsConfiguration -func (c *S3) DeleteBucketAnalyticsConfiguration(input *DeleteBucketAnalyticsConfigurationInput) (*DeleteBucketAnalyticsConfigurationOutput, error) { - req, out := c.DeleteBucketAnalyticsConfigurationRequest(input) - return out, req.Send() -} - -// DeleteBucketAnalyticsConfigurationWithContext is the same as DeleteBucketAnalyticsConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketAnalyticsConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) DeleteBucketAnalyticsConfigurationWithContext(ctx aws.Context, input *DeleteBucketAnalyticsConfigurationInput, opts ...request.Option) (*DeleteBucketAnalyticsConfigurationOutput, error) { - req, out := c.DeleteBucketAnalyticsConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketCors = "DeleteBucketCors" - -// DeleteBucketCorsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketCors operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteBucketCors for more information on using the DeleteBucketCors -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteBucketCorsRequest method. -// req, resp := client.DeleteBucketCorsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketCors -func (c *S3) DeleteBucketCorsRequest(input *DeleteBucketCorsInput) (req *request.Request, output *DeleteBucketCorsOutput) { - op := &request.Operation{ - Name: opDeleteBucketCors, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?cors", - } - - if input == nil { - input = &DeleteBucketCorsInput{} - } - - output = &DeleteBucketCorsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketCors API operation for Amazon Simple Storage Service. -// -// Deletes the cors configuration information set for the bucket. -// -// To use this operation, you must have permission to perform the s3:PutBucketCORS -// action. The bucket owner has this permission by default and can grant this -// permission to others. -// -// For information about cors, see Enabling Cross-Origin Resource Sharing (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) -// in the Amazon S3 User Guide. -// -// Related Resources: -// -// - PutBucketCors (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html) -// -// - RESTOPTIONSobject (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTOPTIONSobject.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation DeleteBucketCors for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketCors -func (c *S3) DeleteBucketCors(input *DeleteBucketCorsInput) (*DeleteBucketCorsOutput, error) { - req, out := c.DeleteBucketCorsRequest(input) - return out, req.Send() -} - -// DeleteBucketCorsWithContext is the same as DeleteBucketCors with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketCors for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) DeleteBucketCorsWithContext(ctx aws.Context, input *DeleteBucketCorsInput, opts ...request.Option) (*DeleteBucketCorsOutput, error) { - req, out := c.DeleteBucketCorsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketEncryption = "DeleteBucketEncryption" - -// DeleteBucketEncryptionRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketEncryption operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteBucketEncryption for more information on using the DeleteBucketEncryption -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteBucketEncryptionRequest method. -// req, resp := client.DeleteBucketEncryptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketEncryption -func (c *S3) DeleteBucketEncryptionRequest(input *DeleteBucketEncryptionInput) (req *request.Request, output *DeleteBucketEncryptionOutput) { - op := &request.Operation{ - Name: opDeleteBucketEncryption, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?encryption", - } - - if input == nil { - input = &DeleteBucketEncryptionInput{} - } - - output = &DeleteBucketEncryptionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketEncryption API operation for Amazon Simple Storage Service. -// -// This implementation of the DELETE action removes default encryption from -// the bucket. For information about the Amazon S3 default encryption feature, -// see Amazon S3 Default Bucket Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) -// in the Amazon S3 User Guide. -// -// To use this operation, you must have permissions to perform the s3:PutEncryptionConfiguration -// action. The bucket owner has this permission by default. The bucket owner -// can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// in the Amazon S3 User Guide. -// -// Related Resources -// -// - PutBucketEncryption (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html) -// -// - GetBucketEncryption (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation DeleteBucketEncryption for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketEncryption -func (c *S3) DeleteBucketEncryption(input *DeleteBucketEncryptionInput) (*DeleteBucketEncryptionOutput, error) { - req, out := c.DeleteBucketEncryptionRequest(input) - return out, req.Send() -} - -// DeleteBucketEncryptionWithContext is the same as DeleteBucketEncryption with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketEncryption for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) DeleteBucketEncryptionWithContext(ctx aws.Context, input *DeleteBucketEncryptionInput, opts ...request.Option) (*DeleteBucketEncryptionOutput, error) { - req, out := c.DeleteBucketEncryptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketIntelligentTieringConfiguration = "DeleteBucketIntelligentTieringConfiguration" - -// DeleteBucketIntelligentTieringConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketIntelligentTieringConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteBucketIntelligentTieringConfiguration for more information on using the DeleteBucketIntelligentTieringConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteBucketIntelligentTieringConfigurationRequest method. -// req, resp := client.DeleteBucketIntelligentTieringConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketIntelligentTieringConfiguration -func (c *S3) DeleteBucketIntelligentTieringConfigurationRequest(input *DeleteBucketIntelligentTieringConfigurationInput) (req *request.Request, output *DeleteBucketIntelligentTieringConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteBucketIntelligentTieringConfiguration, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?intelligent-tiering", - } - - if input == nil { - input = &DeleteBucketIntelligentTieringConfigurationInput{} - } - - output = &DeleteBucketIntelligentTieringConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketIntelligentTieringConfiguration API operation for Amazon Simple Storage Service. -// -// Deletes the S3 Intelligent-Tiering configuration from the specified bucket. -// -// The S3 Intelligent-Tiering storage class is designed to optimize storage -// costs by automatically moving data to the most cost-effective storage access -// tier, without performance impact or operational overhead. S3 Intelligent-Tiering -// delivers automatic cost savings in three low latency and high throughput -// access tiers. To get the lowest storage cost on data that can be accessed -// in minutes to hours, you can choose to activate additional archiving capabilities. -// -// The S3 Intelligent-Tiering storage class is the ideal storage class for data -// with unknown, changing, or unpredictable access patterns, independent of -// object size or retention period. If the size of an object is less than 128 -// KB, it is not monitored and not eligible for auto-tiering. Smaller objects -// can be stored, but they are always charged at the Frequent Access tier rates -// in the S3 Intelligent-Tiering storage class. -// -// For more information, see Storage class for automatically optimizing frequently -// and infrequently accessed objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access). -// -// Operations related to DeleteBucketIntelligentTieringConfiguration include: -// -// - GetBucketIntelligentTieringConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html) -// -// - PutBucketIntelligentTieringConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html) -// -// - ListBucketIntelligentTieringConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation DeleteBucketIntelligentTieringConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketIntelligentTieringConfiguration -func (c *S3) DeleteBucketIntelligentTieringConfiguration(input *DeleteBucketIntelligentTieringConfigurationInput) (*DeleteBucketIntelligentTieringConfigurationOutput, error) { - req, out := c.DeleteBucketIntelligentTieringConfigurationRequest(input) - return out, req.Send() -} - -// DeleteBucketIntelligentTieringConfigurationWithContext is the same as DeleteBucketIntelligentTieringConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketIntelligentTieringConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) DeleteBucketIntelligentTieringConfigurationWithContext(ctx aws.Context, input *DeleteBucketIntelligentTieringConfigurationInput, opts ...request.Option) (*DeleteBucketIntelligentTieringConfigurationOutput, error) { - req, out := c.DeleteBucketIntelligentTieringConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketInventoryConfiguration = "DeleteBucketInventoryConfiguration" - -// DeleteBucketInventoryConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketInventoryConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteBucketInventoryConfiguration for more information on using the DeleteBucketInventoryConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteBucketInventoryConfigurationRequest method. -// req, resp := client.DeleteBucketInventoryConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketInventoryConfiguration -func (c *S3) DeleteBucketInventoryConfigurationRequest(input *DeleteBucketInventoryConfigurationInput) (req *request.Request, output *DeleteBucketInventoryConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteBucketInventoryConfiguration, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?inventory", - } - - if input == nil { - input = &DeleteBucketInventoryConfigurationInput{} - } - - output = &DeleteBucketInventoryConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketInventoryConfiguration API operation for Amazon Simple Storage Service. -// -// Deletes an inventory configuration (identified by the inventory ID) from -// the bucket. -// -// To use this operation, you must have permissions to perform the s3:PutInventoryConfiguration -// action. The bucket owner has this permission by default. The bucket owner -// can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// For information about the Amazon S3 inventory feature, see Amazon S3 Inventory -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html). -// -// Operations related to DeleteBucketInventoryConfiguration include: -// -// - GetBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html) -// -// - PutBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html) -// -// - ListBucketInventoryConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation DeleteBucketInventoryConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketInventoryConfiguration -func (c *S3) DeleteBucketInventoryConfiguration(input *DeleteBucketInventoryConfigurationInput) (*DeleteBucketInventoryConfigurationOutput, error) { - req, out := c.DeleteBucketInventoryConfigurationRequest(input) - return out, req.Send() -} - -// DeleteBucketInventoryConfigurationWithContext is the same as DeleteBucketInventoryConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketInventoryConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) DeleteBucketInventoryConfigurationWithContext(ctx aws.Context, input *DeleteBucketInventoryConfigurationInput, opts ...request.Option) (*DeleteBucketInventoryConfigurationOutput, error) { - req, out := c.DeleteBucketInventoryConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketLifecycle = "DeleteBucketLifecycle" - -// DeleteBucketLifecycleRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketLifecycle operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteBucketLifecycle for more information on using the DeleteBucketLifecycle -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteBucketLifecycleRequest method. -// req, resp := client.DeleteBucketLifecycleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketLifecycle -func (c *S3) DeleteBucketLifecycleRequest(input *DeleteBucketLifecycleInput) (req *request.Request, output *DeleteBucketLifecycleOutput) { - op := &request.Operation{ - Name: opDeleteBucketLifecycle, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?lifecycle", - } - - if input == nil { - input = &DeleteBucketLifecycleInput{} - } - - output = &DeleteBucketLifecycleOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketLifecycle API operation for Amazon Simple Storage Service. -// -// Deletes the lifecycle configuration from the specified bucket. Amazon S3 -// removes all the lifecycle configuration rules in the lifecycle subresource -// associated with the bucket. Your objects never expire, and Amazon S3 no longer -// automatically deletes any objects on the basis of rules contained in the -// deleted lifecycle configuration. -// -// To use this operation, you must have permission to perform the s3:PutLifecycleConfiguration -// action. By default, the bucket owner has this permission and the bucket owner -// can grant this permission to others. -// -// There is usually some time lag before lifecycle configuration deletion is -// fully propagated to all the Amazon S3 systems. -// -// For more information about the object expiration, see Elements to Describe -// Lifecycle Actions (https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#intro-lifecycle-rules-actions). -// -// Related actions include: -// -// - PutBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html) -// -// - GetBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation DeleteBucketLifecycle for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketLifecycle -func (c *S3) DeleteBucketLifecycle(input *DeleteBucketLifecycleInput) (*DeleteBucketLifecycleOutput, error) { - req, out := c.DeleteBucketLifecycleRequest(input) - return out, req.Send() -} - -// DeleteBucketLifecycleWithContext is the same as DeleteBucketLifecycle with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketLifecycle for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) DeleteBucketLifecycleWithContext(ctx aws.Context, input *DeleteBucketLifecycleInput, opts ...request.Option) (*DeleteBucketLifecycleOutput, error) { - req, out := c.DeleteBucketLifecycleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketMetricsConfiguration = "DeleteBucketMetricsConfiguration" - -// DeleteBucketMetricsConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketMetricsConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteBucketMetricsConfiguration for more information on using the DeleteBucketMetricsConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteBucketMetricsConfigurationRequest method. -// req, resp := client.DeleteBucketMetricsConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketMetricsConfiguration -func (c *S3) DeleteBucketMetricsConfigurationRequest(input *DeleteBucketMetricsConfigurationInput) (req *request.Request, output *DeleteBucketMetricsConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteBucketMetricsConfiguration, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?metrics", - } - - if input == nil { - input = &DeleteBucketMetricsConfigurationInput{} - } - - output = &DeleteBucketMetricsConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketMetricsConfiguration API operation for Amazon Simple Storage Service. -// -// Deletes a metrics configuration for the Amazon CloudWatch request metrics -// (specified by the metrics configuration ID) from the bucket. Note that this -// doesn't include the daily storage metrics. -// -// To use this operation, you must have permissions to perform the s3:PutMetricsConfiguration -// action. The bucket owner has this permission by default. The bucket owner -// can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// For information about CloudWatch request metrics for Amazon S3, see Monitoring -// Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html). -// -// The following operations are related to DeleteBucketMetricsConfiguration: -// -// - GetBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html) -// -// - PutBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html) -// -// - ListBucketMetricsConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html) -// -// - Monitoring Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation DeleteBucketMetricsConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketMetricsConfiguration -func (c *S3) DeleteBucketMetricsConfiguration(input *DeleteBucketMetricsConfigurationInput) (*DeleteBucketMetricsConfigurationOutput, error) { - req, out := c.DeleteBucketMetricsConfigurationRequest(input) - return out, req.Send() -} - -// DeleteBucketMetricsConfigurationWithContext is the same as DeleteBucketMetricsConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketMetricsConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) DeleteBucketMetricsConfigurationWithContext(ctx aws.Context, input *DeleteBucketMetricsConfigurationInput, opts ...request.Option) (*DeleteBucketMetricsConfigurationOutput, error) { - req, out := c.DeleteBucketMetricsConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketOwnershipControls = "DeleteBucketOwnershipControls" - -// DeleteBucketOwnershipControlsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketOwnershipControls operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteBucketOwnershipControls for more information on using the DeleteBucketOwnershipControls -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteBucketOwnershipControlsRequest method. -// req, resp := client.DeleteBucketOwnershipControlsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketOwnershipControls -func (c *S3) DeleteBucketOwnershipControlsRequest(input *DeleteBucketOwnershipControlsInput) (req *request.Request, output *DeleteBucketOwnershipControlsOutput) { - op := &request.Operation{ - Name: opDeleteBucketOwnershipControls, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?ownershipControls", - } - - if input == nil { - input = &DeleteBucketOwnershipControlsInput{} - } - - output = &DeleteBucketOwnershipControlsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketOwnershipControls API operation for Amazon Simple Storage Service. -// -// Removes OwnershipControls for an Amazon S3 bucket. To use this operation, -// you must have the s3:PutBucketOwnershipControls permission. For more information -// about Amazon S3 permissions, see Specifying Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html). -// -// For information about Amazon S3 Object Ownership, see Using Object Ownership -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/about-object-ownership.html). -// -// The following operations are related to DeleteBucketOwnershipControls: -// -// - GetBucketOwnershipControls -// -// - PutBucketOwnershipControls -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation DeleteBucketOwnershipControls for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketOwnershipControls -func (c *S3) DeleteBucketOwnershipControls(input *DeleteBucketOwnershipControlsInput) (*DeleteBucketOwnershipControlsOutput, error) { - req, out := c.DeleteBucketOwnershipControlsRequest(input) - return out, req.Send() -} - -// DeleteBucketOwnershipControlsWithContext is the same as DeleteBucketOwnershipControls with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketOwnershipControls for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) DeleteBucketOwnershipControlsWithContext(ctx aws.Context, input *DeleteBucketOwnershipControlsInput, opts ...request.Option) (*DeleteBucketOwnershipControlsOutput, error) { - req, out := c.DeleteBucketOwnershipControlsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketPolicy = "DeleteBucketPolicy" - -// DeleteBucketPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketPolicy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteBucketPolicy for more information on using the DeleteBucketPolicy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteBucketPolicyRequest method. -// req, resp := client.DeleteBucketPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketPolicy -func (c *S3) DeleteBucketPolicyRequest(input *DeleteBucketPolicyInput) (req *request.Request, output *DeleteBucketPolicyOutput) { - op := &request.Operation{ - Name: opDeleteBucketPolicy, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?policy", - } - - if input == nil { - input = &DeleteBucketPolicyInput{} - } - - output = &DeleteBucketPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketPolicy API operation for Amazon Simple Storage Service. -// -// This implementation of the DELETE action uses the policy subresource to delete -// the policy of a specified bucket. If you are using an identity other than -// the root user of the Amazon Web Services account that owns the bucket, the -// calling identity must have the DeleteBucketPolicy permissions on the specified -// bucket and belong to the bucket owner's account to use this operation. -// -// If you don't have DeleteBucketPolicy permissions, Amazon S3 returns a 403 -// Access Denied error. If you have the correct permissions, but you're not -// using an identity that belongs to the bucket owner's account, Amazon S3 returns -// a 405 Method Not Allowed error. -// -// As a security precaution, the root user of the Amazon Web Services account -// that owns a bucket can always use this operation, even if the policy explicitly -// denies the root user the ability to perform this action. -// -// For more information about bucket policies, see Using Bucket Policies and -// UserPolicies (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html). -// -// The following operations are related to DeleteBucketPolicy -// -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// -// - DeleteObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation DeleteBucketPolicy for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketPolicy -func (c *S3) DeleteBucketPolicy(input *DeleteBucketPolicyInput) (*DeleteBucketPolicyOutput, error) { - req, out := c.DeleteBucketPolicyRequest(input) - return out, req.Send() -} - -// DeleteBucketPolicyWithContext is the same as DeleteBucketPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketPolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) DeleteBucketPolicyWithContext(ctx aws.Context, input *DeleteBucketPolicyInput, opts ...request.Option) (*DeleteBucketPolicyOutput, error) { - req, out := c.DeleteBucketPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketReplication = "DeleteBucketReplication" - -// DeleteBucketReplicationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketReplication operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteBucketReplication for more information on using the DeleteBucketReplication -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteBucketReplicationRequest method. -// req, resp := client.DeleteBucketReplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketReplication -func (c *S3) DeleteBucketReplicationRequest(input *DeleteBucketReplicationInput) (req *request.Request, output *DeleteBucketReplicationOutput) { - op := &request.Operation{ - Name: opDeleteBucketReplication, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?replication", - } - - if input == nil { - input = &DeleteBucketReplicationInput{} - } - - output = &DeleteBucketReplicationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketReplication API operation for Amazon Simple Storage Service. -// -// Deletes the replication configuration from the bucket. -// -// To use this operation, you must have permissions to perform the s3:PutReplicationConfiguration -// action. The bucket owner has these permissions by default and can grant it -// to others. For more information about permissions, see Permissions Related -// to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// It can take a while for the deletion of a replication configuration to fully -// propagate. -// -// For information about replication configuration, see Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html) -// in the Amazon S3 User Guide. -// -// The following operations are related to DeleteBucketReplication: -// -// - PutBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html) -// -// - GetBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketReplication.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation DeleteBucketReplication for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketReplication -func (c *S3) DeleteBucketReplication(input *DeleteBucketReplicationInput) (*DeleteBucketReplicationOutput, error) { - req, out := c.DeleteBucketReplicationRequest(input) - return out, req.Send() -} - -// DeleteBucketReplicationWithContext is the same as DeleteBucketReplication with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketReplication for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) DeleteBucketReplicationWithContext(ctx aws.Context, input *DeleteBucketReplicationInput, opts ...request.Option) (*DeleteBucketReplicationOutput, error) { - req, out := c.DeleteBucketReplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketTagging = "DeleteBucketTagging" - -// DeleteBucketTaggingRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketTagging operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteBucketTagging for more information on using the DeleteBucketTagging -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteBucketTaggingRequest method. -// req, resp := client.DeleteBucketTaggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketTagging -func (c *S3) DeleteBucketTaggingRequest(input *DeleteBucketTaggingInput) (req *request.Request, output *DeleteBucketTaggingOutput) { - op := &request.Operation{ - Name: opDeleteBucketTagging, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?tagging", - } - - if input == nil { - input = &DeleteBucketTaggingInput{} - } - - output = &DeleteBucketTaggingOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketTagging API operation for Amazon Simple Storage Service. -// -// Deletes the tags from the bucket. -// -// To use this operation, you must have permission to perform the s3:PutBucketTagging -// action. By default, the bucket owner has this permission and can grant this -// permission to others. -// -// The following operations are related to DeleteBucketTagging: -// -// - GetBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html) -// -// - PutBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation DeleteBucketTagging for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketTagging -func (c *S3) DeleteBucketTagging(input *DeleteBucketTaggingInput) (*DeleteBucketTaggingOutput, error) { - req, out := c.DeleteBucketTaggingRequest(input) - return out, req.Send() -} - -// DeleteBucketTaggingWithContext is the same as DeleteBucketTagging with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketTagging for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) DeleteBucketTaggingWithContext(ctx aws.Context, input *DeleteBucketTaggingInput, opts ...request.Option) (*DeleteBucketTaggingOutput, error) { - req, out := c.DeleteBucketTaggingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteBucketWebsite = "DeleteBucketWebsite" - -// DeleteBucketWebsiteRequest generates a "aws/request.Request" representing the -// client's request for the DeleteBucketWebsite operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteBucketWebsite for more information on using the DeleteBucketWebsite -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteBucketWebsiteRequest method. -// req, resp := client.DeleteBucketWebsiteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketWebsite -func (c *S3) DeleteBucketWebsiteRequest(input *DeleteBucketWebsiteInput) (req *request.Request, output *DeleteBucketWebsiteOutput) { - op := &request.Operation{ - Name: opDeleteBucketWebsite, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?website", - } - - if input == nil { - input = &DeleteBucketWebsiteInput{} - } - - output = &DeleteBucketWebsiteOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteBucketWebsite API operation for Amazon Simple Storage Service. -// -// This action removes the website configuration for a bucket. Amazon S3 returns -// a 200 OK response upon successfully deleting a website configuration on the -// specified bucket. You will get a 200 OK response if the website configuration -// you are trying to delete does not exist on the bucket. Amazon S3 returns -// a 404 response if the bucket specified in the request does not exist. -// -// This DELETE action requires the S3:DeleteBucketWebsite permission. By default, -// only the bucket owner can delete the website configuration attached to a -// bucket. However, bucket owners can grant other users permission to delete -// the website configuration by writing a bucket policy granting them the S3:DeleteBucketWebsite -// permission. -// -// For more information about hosting websites, see Hosting Websites on Amazon -// S3 (https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html). -// -// The following operations are related to DeleteBucketWebsite: -// -// - GetBucketWebsite (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketWebsite.html) -// -// - PutBucketWebsite (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation DeleteBucketWebsite for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteBucketWebsite -func (c *S3) DeleteBucketWebsite(input *DeleteBucketWebsiteInput) (*DeleteBucketWebsiteOutput, error) { - req, out := c.DeleteBucketWebsiteRequest(input) - return out, req.Send() -} - -// DeleteBucketWebsiteWithContext is the same as DeleteBucketWebsite with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteBucketWebsite for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) DeleteBucketWebsiteWithContext(ctx aws.Context, input *DeleteBucketWebsiteInput, opts ...request.Option) (*DeleteBucketWebsiteOutput, error) { - req, out := c.DeleteBucketWebsiteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteObject = "DeleteObject" - -// DeleteObjectRequest generates a "aws/request.Request" representing the -// client's request for the DeleteObject operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteObject for more information on using the DeleteObject -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteObjectRequest method. -// req, resp := client.DeleteObjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObject -func (c *S3) DeleteObjectRequest(input *DeleteObjectInput) (req *request.Request, output *DeleteObjectOutput) { - op := &request.Operation{ - Name: opDeleteObject, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}/{Key+}", - } - - if input == nil { - input = &DeleteObjectInput{} - } - - output = &DeleteObjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteObject API operation for Amazon Simple Storage Service. -// -// Removes the null version (if there is one) of an object and inserts a delete -// marker, which becomes the latest version of the object. If there isn't a -// null version, Amazon S3 does not remove any objects but will still respond -// that the command was successful. -// -// To remove a specific version, you must be the bucket owner and you must use -// the version Id subresource. Using this subresource permanently deletes the -// version. If the object deleted is a delete marker, Amazon S3 sets the response -// header, x-amz-delete-marker, to true. -// -// If the object you want to delete is in a bucket where the bucket versioning -// configuration is MFA Delete enabled, you must include the x-amz-mfa request -// header in the DELETE versionId request. Requests that include x-amz-mfa must -// use HTTPS. -// -// For more information about MFA Delete, see Using MFA Delete (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMFADelete.html). -// To see sample requests that use versioning, see Sample Request (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html#ExampleVersionObjectDelete). -// -// You can delete objects by explicitly calling DELETE Object or configure its -// lifecycle (PutBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html)) -// to enable Amazon S3 to remove them for you. If you want to block users or -// accounts from removing or deleting objects from your bucket, you must deny -// them the s3:DeleteObject, s3:DeleteObjectVersion, and s3:PutLifeCycleConfiguration -// actions. -// -// The following action is related to DeleteObject: -// -// - PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation DeleteObject for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObject -func (c *S3) DeleteObject(input *DeleteObjectInput) (*DeleteObjectOutput, error) { - req, out := c.DeleteObjectRequest(input) - return out, req.Send() -} - -// DeleteObjectWithContext is the same as DeleteObject with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteObject for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) DeleteObjectWithContext(ctx aws.Context, input *DeleteObjectInput, opts ...request.Option) (*DeleteObjectOutput, error) { - req, out := c.DeleteObjectRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteObjectTagging = "DeleteObjectTagging" - -// DeleteObjectTaggingRequest generates a "aws/request.Request" representing the -// client's request for the DeleteObjectTagging operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteObjectTagging for more information on using the DeleteObjectTagging -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteObjectTaggingRequest method. -// req, resp := client.DeleteObjectTaggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectTagging -func (c *S3) DeleteObjectTaggingRequest(input *DeleteObjectTaggingInput) (req *request.Request, output *DeleteObjectTaggingOutput) { - op := &request.Operation{ - Name: opDeleteObjectTagging, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}/{Key+}?tagging", - } - - if input == nil { - input = &DeleteObjectTaggingInput{} - } - - output = &DeleteObjectTaggingOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteObjectTagging API operation for Amazon Simple Storage Service. -// -// Removes the entire tag set from the specified object. For more information -// about managing object tags, see Object Tagging (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html). -// -// To use this operation, you must have permission to perform the s3:DeleteObjectTagging -// action. -// -// To delete tags of a specific object version, add the versionId query parameter -// in the request. You will need permission for the s3:DeleteObjectVersionTagging -// action. -// -// The following operations are related to DeleteBucketMetricsConfiguration: -// -// - PutObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html) -// -// - GetObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation DeleteObjectTagging for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjectTagging -func (c *S3) DeleteObjectTagging(input *DeleteObjectTaggingInput) (*DeleteObjectTaggingOutput, error) { - req, out := c.DeleteObjectTaggingRequest(input) - return out, req.Send() -} - -// DeleteObjectTaggingWithContext is the same as DeleteObjectTagging with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteObjectTagging for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) DeleteObjectTaggingWithContext(ctx aws.Context, input *DeleteObjectTaggingInput, opts ...request.Option) (*DeleteObjectTaggingOutput, error) { - req, out := c.DeleteObjectTaggingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteObjects = "DeleteObjects" - -// DeleteObjectsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteObjects operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteObjects for more information on using the DeleteObjects -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteObjectsRequest method. -// req, resp := client.DeleteObjectsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjects -func (c *S3) DeleteObjectsRequest(input *DeleteObjectsInput) (req *request.Request, output *DeleteObjectsOutput) { - op := &request.Operation{ - Name: opDeleteObjects, - HTTPMethod: "POST", - HTTPPath: "/{Bucket}?delete", - } - - if input == nil { - input = &DeleteObjectsInput{} - } - - output = &DeleteObjectsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// DeleteObjects API operation for Amazon Simple Storage Service. -// -// This action enables you to delete multiple objects from a bucket using a -// single HTTP request. If you know the object keys that you want to delete, -// then this action provides a suitable alternative to sending individual delete -// requests, reducing per-request overhead. -// -// The request contains a list of up to 1000 keys that you want to delete. In -// the XML, you provide the object key names, and optionally, version IDs if -// you want to delete a specific version of the object from a versioning-enabled -// bucket. For each key, Amazon S3 performs a delete action and returns the -// result of that delete, success, or failure, in the response. Note that if -// the object specified in the request is not found, Amazon S3 returns the result -// as deleted. -// -// The action supports two modes for the response: verbose and quiet. By default, -// the action uses verbose mode in which the response includes the result of -// deletion of each key in your request. In quiet mode the response includes -// only keys where the delete action encountered an error. For a successful -// deletion, the action does not return any information about the delete in -// the response body. -// -// When performing this action on an MFA Delete enabled bucket, that attempts -// to delete any versioned objects, you must include an MFA token. If you do -// not provide one, the entire request will fail, even if there are non-versioned -// objects you are trying to delete. If you provide an invalid token, whether -// there are versioned keys in the request or not, the entire Multi-Object Delete -// request will fail. For information about MFA Delete, see MFA Delete (https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html#MultiFactorAuthenticationDelete). -// -// Finally, the Content-MD5 header is required for all Multi-Object Delete requests. -// Amazon S3 uses the header value to ensure that your request body has not -// been altered in transit. -// -// The following operations are related to DeleteObjects: -// -// - CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) -// -// - UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// -// - CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) -// -// - ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) -// -// - AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation DeleteObjects for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeleteObjects -func (c *S3) DeleteObjects(input *DeleteObjectsInput) (*DeleteObjectsOutput, error) { - req, out := c.DeleteObjectsRequest(input) - return out, req.Send() -} - -// DeleteObjectsWithContext is the same as DeleteObjects with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteObjects for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) DeleteObjectsWithContext(ctx aws.Context, input *DeleteObjectsInput, opts ...request.Option) (*DeleteObjectsOutput, error) { - req, out := c.DeleteObjectsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeletePublicAccessBlock = "DeletePublicAccessBlock" - -// DeletePublicAccessBlockRequest generates a "aws/request.Request" representing the -// client's request for the DeletePublicAccessBlock operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeletePublicAccessBlock for more information on using the DeletePublicAccessBlock -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeletePublicAccessBlockRequest method. -// req, resp := client.DeletePublicAccessBlockRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeletePublicAccessBlock -func (c *S3) DeletePublicAccessBlockRequest(input *DeletePublicAccessBlockInput) (req *request.Request, output *DeletePublicAccessBlockOutput) { - op := &request.Operation{ - Name: opDeletePublicAccessBlock, - HTTPMethod: "DELETE", - HTTPPath: "/{Bucket}?publicAccessBlock", - } - - if input == nil { - input = &DeletePublicAccessBlockInput{} - } - - output = &DeletePublicAccessBlockOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeletePublicAccessBlock API operation for Amazon Simple Storage Service. -// -// Removes the PublicAccessBlock configuration for an Amazon S3 bucket. To use -// this operation, you must have the s3:PutBucketPublicAccessBlock permission. -// For more information about permissions, see Permissions Related to Bucket -// Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// The following operations are related to DeletePublicAccessBlock: -// -// - Using Amazon S3 Block Public Access (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html) -// -// - GetPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html) -// -// - PutPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html) -// -// - GetBucketPolicyStatus (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation DeletePublicAccessBlock for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/DeletePublicAccessBlock -func (c *S3) DeletePublicAccessBlock(input *DeletePublicAccessBlockInput) (*DeletePublicAccessBlockOutput, error) { - req, out := c.DeletePublicAccessBlockRequest(input) - return out, req.Send() -} - -// DeletePublicAccessBlockWithContext is the same as DeletePublicAccessBlock with the addition of -// the ability to pass a context and additional request options. -// -// See DeletePublicAccessBlock for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) DeletePublicAccessBlockWithContext(ctx aws.Context, input *DeletePublicAccessBlockInput, opts ...request.Option) (*DeletePublicAccessBlockOutput, error) { - req, out := c.DeletePublicAccessBlockRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketAccelerateConfiguration = "GetBucketAccelerateConfiguration" - -// GetBucketAccelerateConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketAccelerateConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketAccelerateConfiguration for more information on using the GetBucketAccelerateConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketAccelerateConfigurationRequest method. -// req, resp := client.GetBucketAccelerateConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAccelerateConfiguration -func (c *S3) GetBucketAccelerateConfigurationRequest(input *GetBucketAccelerateConfigurationInput) (req *request.Request, output *GetBucketAccelerateConfigurationOutput) { - op := &request.Operation{ - Name: opGetBucketAccelerateConfiguration, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?accelerate", - } - - if input == nil { - input = &GetBucketAccelerateConfigurationInput{} - } - - output = &GetBucketAccelerateConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketAccelerateConfiguration API operation for Amazon Simple Storage Service. -// -// This implementation of the GET action uses the accelerate subresource to -// return the Transfer Acceleration state of a bucket, which is either Enabled -// or Suspended. Amazon S3 Transfer Acceleration is a bucket-level feature that -// enables you to perform faster data transfers to and from Amazon S3. -// -// To use this operation, you must have permission to perform the s3:GetAccelerateConfiguration -// action. The bucket owner has this permission by default. The bucket owner -// can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// in the Amazon S3 User Guide. -// -// You set the Transfer Acceleration state of an existing bucket to Enabled -// or Suspended by using the PutBucketAccelerateConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAccelerateConfiguration.html) -// operation. -// -// A GET accelerate request does not return a state value for a bucket that -// has no transfer acceleration state. A bucket has no Transfer Acceleration -// state if a state has never been set on the bucket. -// -// For more information about transfer acceleration, see Transfer Acceleration -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html) -// in the Amazon S3 User Guide. -// -// Related Resources -// -// - PutBucketAccelerateConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAccelerateConfiguration.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketAccelerateConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAccelerateConfiguration -func (c *S3) GetBucketAccelerateConfiguration(input *GetBucketAccelerateConfigurationInput) (*GetBucketAccelerateConfigurationOutput, error) { - req, out := c.GetBucketAccelerateConfigurationRequest(input) - return out, req.Send() -} - -// GetBucketAccelerateConfigurationWithContext is the same as GetBucketAccelerateConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketAccelerateConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetBucketAccelerateConfigurationWithContext(ctx aws.Context, input *GetBucketAccelerateConfigurationInput, opts ...request.Option) (*GetBucketAccelerateConfigurationOutput, error) { - req, out := c.GetBucketAccelerateConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketAcl = "GetBucketAcl" - -// GetBucketAclRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketAcl operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketAcl for more information on using the GetBucketAcl -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketAclRequest method. -// req, resp := client.GetBucketAclRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAcl -func (c *S3) GetBucketAclRequest(input *GetBucketAclInput) (req *request.Request, output *GetBucketAclOutput) { - op := &request.Operation{ - Name: opGetBucketAcl, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?acl", - } - - if input == nil { - input = &GetBucketAclInput{} - } - - output = &GetBucketAclOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketAcl API operation for Amazon Simple Storage Service. -// -// This implementation of the GET action uses the acl subresource to return -// the access control list (ACL) of a bucket. To use GET to return the ACL of -// the bucket, you must have READ_ACP access to the bucket. If READ_ACP permission -// is granted to the anonymous user, you can return the ACL of the bucket without -// using an authorization header. -// -// If your bucket uses the bucket owner enforced setting for S3 Object Ownership, -// requests to read ACLs are still supported and return the bucket-owner-full-control -// ACL with the owner being the account that created the bucket. For more information, -// see Controlling object ownership and disabling ACLs (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) -// in the Amazon S3 User Guide. -// -// Related Resources -// -// - ListObjects (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketAcl for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAcl -func (c *S3) GetBucketAcl(input *GetBucketAclInput) (*GetBucketAclOutput, error) { - req, out := c.GetBucketAclRequest(input) - return out, req.Send() -} - -// GetBucketAclWithContext is the same as GetBucketAcl with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketAcl for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetBucketAclWithContext(ctx aws.Context, input *GetBucketAclInput, opts ...request.Option) (*GetBucketAclOutput, error) { - req, out := c.GetBucketAclRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketAnalyticsConfiguration = "GetBucketAnalyticsConfiguration" - -// GetBucketAnalyticsConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketAnalyticsConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketAnalyticsConfiguration for more information on using the GetBucketAnalyticsConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketAnalyticsConfigurationRequest method. -// req, resp := client.GetBucketAnalyticsConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAnalyticsConfiguration -func (c *S3) GetBucketAnalyticsConfigurationRequest(input *GetBucketAnalyticsConfigurationInput) (req *request.Request, output *GetBucketAnalyticsConfigurationOutput) { - op := &request.Operation{ - Name: opGetBucketAnalyticsConfiguration, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?analytics", - } - - if input == nil { - input = &GetBucketAnalyticsConfigurationInput{} - } - - output = &GetBucketAnalyticsConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketAnalyticsConfiguration API operation for Amazon Simple Storage Service. -// -// This implementation of the GET action returns an analytics configuration -// (identified by the analytics configuration ID) from the bucket. -// -// To use this operation, you must have permissions to perform the s3:GetAnalyticsConfiguration -// action. The bucket owner has this permission by default. The bucket owner -// can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// in the Amazon S3 User Guide. -// -// For information about Amazon S3 analytics feature, see Amazon S3 Analytics -// – Storage Class Analysis (https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html) -// in the Amazon S3 User Guide. -// -// Related Resources -// -// - DeleteBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html) -// -// - ListBucketAnalyticsConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html) -// -// - PutBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketAnalyticsConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketAnalyticsConfiguration -func (c *S3) GetBucketAnalyticsConfiguration(input *GetBucketAnalyticsConfigurationInput) (*GetBucketAnalyticsConfigurationOutput, error) { - req, out := c.GetBucketAnalyticsConfigurationRequest(input) - return out, req.Send() -} - -// GetBucketAnalyticsConfigurationWithContext is the same as GetBucketAnalyticsConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketAnalyticsConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetBucketAnalyticsConfigurationWithContext(ctx aws.Context, input *GetBucketAnalyticsConfigurationInput, opts ...request.Option) (*GetBucketAnalyticsConfigurationOutput, error) { - req, out := c.GetBucketAnalyticsConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketCors = "GetBucketCors" - -// GetBucketCorsRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketCors operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketCors for more information on using the GetBucketCors -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketCorsRequest method. -// req, resp := client.GetBucketCorsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketCors -func (c *S3) GetBucketCorsRequest(input *GetBucketCorsInput) (req *request.Request, output *GetBucketCorsOutput) { - op := &request.Operation{ - Name: opGetBucketCors, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?cors", - } - - if input == nil { - input = &GetBucketCorsInput{} - } - - output = &GetBucketCorsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketCors API operation for Amazon Simple Storage Service. -// -// Returns the Cross-Origin Resource Sharing (CORS) configuration information -// set for the bucket. -// -// To use this operation, you must have permission to perform the s3:GetBucketCORS -// action. By default, the bucket owner has this permission and can grant it -// to others. -// -// For more information about CORS, see Enabling Cross-Origin Resource Sharing -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html). -// -// The following operations are related to GetBucketCors: -// -// - PutBucketCors (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketCors.html) -// -// - DeleteBucketCors (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketCors for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketCors -func (c *S3) GetBucketCors(input *GetBucketCorsInput) (*GetBucketCorsOutput, error) { - req, out := c.GetBucketCorsRequest(input) - return out, req.Send() -} - -// GetBucketCorsWithContext is the same as GetBucketCors with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketCors for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetBucketCorsWithContext(ctx aws.Context, input *GetBucketCorsInput, opts ...request.Option) (*GetBucketCorsOutput, error) { - req, out := c.GetBucketCorsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketEncryption = "GetBucketEncryption" - -// GetBucketEncryptionRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketEncryption operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketEncryption for more information on using the GetBucketEncryption -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketEncryptionRequest method. -// req, resp := client.GetBucketEncryptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketEncryption -func (c *S3) GetBucketEncryptionRequest(input *GetBucketEncryptionInput) (req *request.Request, output *GetBucketEncryptionOutput) { - op := &request.Operation{ - Name: opGetBucketEncryption, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?encryption", - } - - if input == nil { - input = &GetBucketEncryptionInput{} - } - - output = &GetBucketEncryptionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketEncryption API operation for Amazon Simple Storage Service. -// -// Returns the default encryption configuration for an Amazon S3 bucket. If -// the bucket does not have a default encryption configuration, GetBucketEncryption -// returns ServerSideEncryptionConfigurationNotFoundError. -// -// For information about the Amazon S3 default encryption feature, see Amazon -// S3 Default Bucket Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html). -// -// To use this operation, you must have permission to perform the s3:GetEncryptionConfiguration -// action. The bucket owner has this permission by default. The bucket owner -// can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// The following operations are related to GetBucketEncryption: -// -// - PutBucketEncryption (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketEncryption.html) -// -// - DeleteBucketEncryption (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketEncryption for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketEncryption -func (c *S3) GetBucketEncryption(input *GetBucketEncryptionInput) (*GetBucketEncryptionOutput, error) { - req, out := c.GetBucketEncryptionRequest(input) - return out, req.Send() -} - -// GetBucketEncryptionWithContext is the same as GetBucketEncryption with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketEncryption for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetBucketEncryptionWithContext(ctx aws.Context, input *GetBucketEncryptionInput, opts ...request.Option) (*GetBucketEncryptionOutput, error) { - req, out := c.GetBucketEncryptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketIntelligentTieringConfiguration = "GetBucketIntelligentTieringConfiguration" - -// GetBucketIntelligentTieringConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketIntelligentTieringConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketIntelligentTieringConfiguration for more information on using the GetBucketIntelligentTieringConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketIntelligentTieringConfigurationRequest method. -// req, resp := client.GetBucketIntelligentTieringConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketIntelligentTieringConfiguration -func (c *S3) GetBucketIntelligentTieringConfigurationRequest(input *GetBucketIntelligentTieringConfigurationInput) (req *request.Request, output *GetBucketIntelligentTieringConfigurationOutput) { - op := &request.Operation{ - Name: opGetBucketIntelligentTieringConfiguration, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?intelligent-tiering", - } - - if input == nil { - input = &GetBucketIntelligentTieringConfigurationInput{} - } - - output = &GetBucketIntelligentTieringConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketIntelligentTieringConfiguration API operation for Amazon Simple Storage Service. -// -// Gets the S3 Intelligent-Tiering configuration from the specified bucket. -// -// The S3 Intelligent-Tiering storage class is designed to optimize storage -// costs by automatically moving data to the most cost-effective storage access -// tier, without performance impact or operational overhead. S3 Intelligent-Tiering -// delivers automatic cost savings in three low latency and high throughput -// access tiers. To get the lowest storage cost on data that can be accessed -// in minutes to hours, you can choose to activate additional archiving capabilities. -// -// The S3 Intelligent-Tiering storage class is the ideal storage class for data -// with unknown, changing, or unpredictable access patterns, independent of -// object size or retention period. If the size of an object is less than 128 -// KB, it is not monitored and not eligible for auto-tiering. Smaller objects -// can be stored, but they are always charged at the Frequent Access tier rates -// in the S3 Intelligent-Tiering storage class. -// -// For more information, see Storage class for automatically optimizing frequently -// and infrequently accessed objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access). -// -// Operations related to GetBucketIntelligentTieringConfiguration include: -// -// - DeleteBucketIntelligentTieringConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTieringConfiguration.html) -// -// - PutBucketIntelligentTieringConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html) -// -// - ListBucketIntelligentTieringConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketIntelligentTieringConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketIntelligentTieringConfiguration -func (c *S3) GetBucketIntelligentTieringConfiguration(input *GetBucketIntelligentTieringConfigurationInput) (*GetBucketIntelligentTieringConfigurationOutput, error) { - req, out := c.GetBucketIntelligentTieringConfigurationRequest(input) - return out, req.Send() -} - -// GetBucketIntelligentTieringConfigurationWithContext is the same as GetBucketIntelligentTieringConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketIntelligentTieringConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetBucketIntelligentTieringConfigurationWithContext(ctx aws.Context, input *GetBucketIntelligentTieringConfigurationInput, opts ...request.Option) (*GetBucketIntelligentTieringConfigurationOutput, error) { - req, out := c.GetBucketIntelligentTieringConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketInventoryConfiguration = "GetBucketInventoryConfiguration" - -// GetBucketInventoryConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketInventoryConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketInventoryConfiguration for more information on using the GetBucketInventoryConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketInventoryConfigurationRequest method. -// req, resp := client.GetBucketInventoryConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketInventoryConfiguration -func (c *S3) GetBucketInventoryConfigurationRequest(input *GetBucketInventoryConfigurationInput) (req *request.Request, output *GetBucketInventoryConfigurationOutput) { - op := &request.Operation{ - Name: opGetBucketInventoryConfiguration, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?inventory", - } - - if input == nil { - input = &GetBucketInventoryConfigurationInput{} - } - - output = &GetBucketInventoryConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketInventoryConfiguration API operation for Amazon Simple Storage Service. -// -// Returns an inventory configuration (identified by the inventory configuration -// ID) from the bucket. -// -// To use this operation, you must have permissions to perform the s3:GetInventoryConfiguration -// action. The bucket owner has this permission by default and can grant this -// permission to others. For more information about permissions, see Permissions -// Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// For information about the Amazon S3 inventory feature, see Amazon S3 Inventory -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html). -// -// The following operations are related to GetBucketInventoryConfiguration: -// -// - DeleteBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html) -// -// - ListBucketInventoryConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html) -// -// - PutBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketInventoryConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketInventoryConfiguration -func (c *S3) GetBucketInventoryConfiguration(input *GetBucketInventoryConfigurationInput) (*GetBucketInventoryConfigurationOutput, error) { - req, out := c.GetBucketInventoryConfigurationRequest(input) - return out, req.Send() -} - -// GetBucketInventoryConfigurationWithContext is the same as GetBucketInventoryConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketInventoryConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetBucketInventoryConfigurationWithContext(ctx aws.Context, input *GetBucketInventoryConfigurationInput, opts ...request.Option) (*GetBucketInventoryConfigurationOutput, error) { - req, out := c.GetBucketInventoryConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketLifecycle = "GetBucketLifecycle" - -// GetBucketLifecycleRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketLifecycle operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketLifecycle for more information on using the GetBucketLifecycle -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketLifecycleRequest method. -// req, resp := client.GetBucketLifecycleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycle -// -// Deprecated: GetBucketLifecycle has been deprecated -func (c *S3) GetBucketLifecycleRequest(input *GetBucketLifecycleInput) (req *request.Request, output *GetBucketLifecycleOutput) { - if c.Client.Config.Logger != nil { - c.Client.Config.Logger.Log("This operation, GetBucketLifecycle, has been deprecated") - } - op := &request.Operation{ - Name: opGetBucketLifecycle, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?lifecycle", - } - - if input == nil { - input = &GetBucketLifecycleInput{} - } - - output = &GetBucketLifecycleOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketLifecycle API operation for Amazon Simple Storage Service. -// -// For an updated version of this API, see GetBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html). -// If you configured a bucket lifecycle using the filter element, you should -// see the updated version of this topic. This topic is provided for backward -// compatibility. -// -// Returns the lifecycle configuration information set on the bucket. For information -// about lifecycle configuration, see Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html). -// -// To use this operation, you must have permission to perform the s3:GetLifecycleConfiguration -// action. The bucket owner has this permission by default. The bucket owner -// can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// GetBucketLifecycle has the following special error: -// -// - Error code: NoSuchLifecycleConfiguration Description: The lifecycle -// configuration does not exist. HTTP Status Code: 404 Not Found SOAP Fault -// Code Prefix: Client -// -// The following operations are related to GetBucketLifecycle: -// -// - GetBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html) -// -// - PutBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html) -// -// - DeleteBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketLifecycle for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycle -// -// Deprecated: GetBucketLifecycle has been deprecated -func (c *S3) GetBucketLifecycle(input *GetBucketLifecycleInput) (*GetBucketLifecycleOutput, error) { - req, out := c.GetBucketLifecycleRequest(input) - return out, req.Send() -} - -// GetBucketLifecycleWithContext is the same as GetBucketLifecycle with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketLifecycle for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -// -// Deprecated: GetBucketLifecycleWithContext has been deprecated -func (c *S3) GetBucketLifecycleWithContext(ctx aws.Context, input *GetBucketLifecycleInput, opts ...request.Option) (*GetBucketLifecycleOutput, error) { - req, out := c.GetBucketLifecycleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketLifecycleConfiguration = "GetBucketLifecycleConfiguration" - -// GetBucketLifecycleConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketLifecycleConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketLifecycleConfiguration for more information on using the GetBucketLifecycleConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketLifecycleConfigurationRequest method. -// req, resp := client.GetBucketLifecycleConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleConfiguration -func (c *S3) GetBucketLifecycleConfigurationRequest(input *GetBucketLifecycleConfigurationInput) (req *request.Request, output *GetBucketLifecycleConfigurationOutput) { - op := &request.Operation{ - Name: opGetBucketLifecycleConfiguration, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?lifecycle", - } - - if input == nil { - input = &GetBucketLifecycleConfigurationInput{} - } - - output = &GetBucketLifecycleConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketLifecycleConfiguration API operation for Amazon Simple Storage Service. -// -// Bucket lifecycle configuration now supports specifying a lifecycle rule using -// an object key name prefix, one or more object tags, or a combination of both. -// Accordingly, this section describes the latest API. The response describes -// the new filter element that you can use to specify a filter to select a subset -// of objects to which the rule applies. If you are using a previous version -// of the lifecycle configuration, it still works. For the earlier action, see -// GetBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html). -// -// Returns the lifecycle configuration information set on the bucket. For information -// about lifecycle configuration, see Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html). -// -// To use this operation, you must have permission to perform the s3:GetLifecycleConfiguration -// action. The bucket owner has this permission, by default. The bucket owner -// can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// GetBucketLifecycleConfiguration has the following special error: -// -// - Error code: NoSuchLifecycleConfiguration Description: The lifecycle -// configuration does not exist. HTTP Status Code: 404 Not Found SOAP Fault -// Code Prefix: Client -// -// The following operations are related to GetBucketLifecycleConfiguration: -// -// - GetBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html) -// -// - PutBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html) -// -// - DeleteBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketLifecycleConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLifecycleConfiguration -func (c *S3) GetBucketLifecycleConfiguration(input *GetBucketLifecycleConfigurationInput) (*GetBucketLifecycleConfigurationOutput, error) { - req, out := c.GetBucketLifecycleConfigurationRequest(input) - return out, req.Send() -} - -// GetBucketLifecycleConfigurationWithContext is the same as GetBucketLifecycleConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketLifecycleConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetBucketLifecycleConfigurationWithContext(ctx aws.Context, input *GetBucketLifecycleConfigurationInput, opts ...request.Option) (*GetBucketLifecycleConfigurationOutput, error) { - req, out := c.GetBucketLifecycleConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketLocation = "GetBucketLocation" - -// GetBucketLocationRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketLocation operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketLocation for more information on using the GetBucketLocation -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketLocationRequest method. -// req, resp := client.GetBucketLocationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLocation -func (c *S3) GetBucketLocationRequest(input *GetBucketLocationInput) (req *request.Request, output *GetBucketLocationOutput) { - op := &request.Operation{ - Name: opGetBucketLocation, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?location", - } - - if input == nil { - input = &GetBucketLocationInput{} - } - - output = &GetBucketLocationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketLocation API operation for Amazon Simple Storage Service. -// -// Returns the Region the bucket resides in. You set the bucket's Region using -// the LocationConstraint request parameter in a CreateBucket request. For more -// information, see CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html). -// -// To use this implementation of the operation, you must be the bucket owner. -// -// To use this API against an access point, provide the alias of the access -// point in place of the bucket name. -// -// The following operations are related to GetBucketLocation: -// -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketLocation for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLocation -func (c *S3) GetBucketLocation(input *GetBucketLocationInput) (*GetBucketLocationOutput, error) { - req, out := c.GetBucketLocationRequest(input) - return out, req.Send() -} - -// GetBucketLocationWithContext is the same as GetBucketLocation with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketLocation for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetBucketLocationWithContext(ctx aws.Context, input *GetBucketLocationInput, opts ...request.Option) (*GetBucketLocationOutput, error) { - req, out := c.GetBucketLocationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketLogging = "GetBucketLogging" - -// GetBucketLoggingRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketLogging operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketLogging for more information on using the GetBucketLogging -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketLoggingRequest method. -// req, resp := client.GetBucketLoggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLogging -func (c *S3) GetBucketLoggingRequest(input *GetBucketLoggingInput) (req *request.Request, output *GetBucketLoggingOutput) { - op := &request.Operation{ - Name: opGetBucketLogging, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?logging", - } - - if input == nil { - input = &GetBucketLoggingInput{} - } - - output = &GetBucketLoggingOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketLogging API operation for Amazon Simple Storage Service. -// -// Returns the logging status of a bucket and the permissions users have to -// view and modify that status. To use GET, you must be the bucket owner. -// -// The following operations are related to GetBucketLogging: -// -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// -// - PutBucketLogging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLogging.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketLogging for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketLogging -func (c *S3) GetBucketLogging(input *GetBucketLoggingInput) (*GetBucketLoggingOutput, error) { - req, out := c.GetBucketLoggingRequest(input) - return out, req.Send() -} - -// GetBucketLoggingWithContext is the same as GetBucketLogging with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketLogging for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetBucketLoggingWithContext(ctx aws.Context, input *GetBucketLoggingInput, opts ...request.Option) (*GetBucketLoggingOutput, error) { - req, out := c.GetBucketLoggingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketMetricsConfiguration = "GetBucketMetricsConfiguration" - -// GetBucketMetricsConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketMetricsConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketMetricsConfiguration for more information on using the GetBucketMetricsConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketMetricsConfigurationRequest method. -// req, resp := client.GetBucketMetricsConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketMetricsConfiguration -func (c *S3) GetBucketMetricsConfigurationRequest(input *GetBucketMetricsConfigurationInput) (req *request.Request, output *GetBucketMetricsConfigurationOutput) { - op := &request.Operation{ - Name: opGetBucketMetricsConfiguration, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?metrics", - } - - if input == nil { - input = &GetBucketMetricsConfigurationInput{} - } - - output = &GetBucketMetricsConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketMetricsConfiguration API operation for Amazon Simple Storage Service. -// -// Gets a metrics configuration (specified by the metrics configuration ID) -// from the bucket. Note that this doesn't include the daily storage metrics. -// -// To use this operation, you must have permissions to perform the s3:GetMetricsConfiguration -// action. The bucket owner has this permission by default. The bucket owner -// can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// For information about CloudWatch request metrics for Amazon S3, see Monitoring -// Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html). -// -// The following operations are related to GetBucketMetricsConfiguration: -// -// - PutBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html) -// -// - DeleteBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html) -// -// - ListBucketMetricsConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html) -// -// - Monitoring Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketMetricsConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketMetricsConfiguration -func (c *S3) GetBucketMetricsConfiguration(input *GetBucketMetricsConfigurationInput) (*GetBucketMetricsConfigurationOutput, error) { - req, out := c.GetBucketMetricsConfigurationRequest(input) - return out, req.Send() -} - -// GetBucketMetricsConfigurationWithContext is the same as GetBucketMetricsConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketMetricsConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetBucketMetricsConfigurationWithContext(ctx aws.Context, input *GetBucketMetricsConfigurationInput, opts ...request.Option) (*GetBucketMetricsConfigurationOutput, error) { - req, out := c.GetBucketMetricsConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketNotification = "GetBucketNotification" - -// GetBucketNotificationRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketNotification operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketNotification for more information on using the GetBucketNotification -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketNotificationRequest method. -// req, resp := client.GetBucketNotificationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotification -// -// Deprecated: GetBucketNotification has been deprecated -func (c *S3) GetBucketNotificationRequest(input *GetBucketNotificationConfigurationRequest) (req *request.Request, output *NotificationConfigurationDeprecated) { - if c.Client.Config.Logger != nil { - c.Client.Config.Logger.Log("This operation, GetBucketNotification, has been deprecated") - } - op := &request.Operation{ - Name: opGetBucketNotification, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?notification", - } - - if input == nil { - input = &GetBucketNotificationConfigurationRequest{} - } - - output = &NotificationConfigurationDeprecated{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketNotification API operation for Amazon Simple Storage Service. -// -// No longer used, see GetBucketNotificationConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketNotification for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotification -// -// Deprecated: GetBucketNotification has been deprecated -func (c *S3) GetBucketNotification(input *GetBucketNotificationConfigurationRequest) (*NotificationConfigurationDeprecated, error) { - req, out := c.GetBucketNotificationRequest(input) - return out, req.Send() -} - -// GetBucketNotificationWithContext is the same as GetBucketNotification with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketNotification for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -// -// Deprecated: GetBucketNotificationWithContext has been deprecated -func (c *S3) GetBucketNotificationWithContext(ctx aws.Context, input *GetBucketNotificationConfigurationRequest, opts ...request.Option) (*NotificationConfigurationDeprecated, error) { - req, out := c.GetBucketNotificationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketNotificationConfiguration = "GetBucketNotificationConfiguration" - -// GetBucketNotificationConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketNotificationConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketNotificationConfiguration for more information on using the GetBucketNotificationConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketNotificationConfigurationRequest method. -// req, resp := client.GetBucketNotificationConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotificationConfiguration -func (c *S3) GetBucketNotificationConfigurationRequest(input *GetBucketNotificationConfigurationRequest) (req *request.Request, output *NotificationConfiguration) { - op := &request.Operation{ - Name: opGetBucketNotificationConfiguration, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?notification", - } - - if input == nil { - input = &GetBucketNotificationConfigurationRequest{} - } - - output = &NotificationConfiguration{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketNotificationConfiguration API operation for Amazon Simple Storage Service. -// -// Returns the notification configuration of a bucket. -// -// If notifications are not enabled on the bucket, the action returns an empty -// NotificationConfiguration element. -// -// By default, you must be the bucket owner to read the notification configuration -// of a bucket. However, the bucket owner can use a bucket policy to grant permission -// to other users to read this configuration with the s3:GetBucketNotification -// permission. -// -// For more information about setting and reading the notification configuration -// on a bucket, see Setting Up Notification of Bucket Events (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html). -// For more information about bucket policies, see Using Bucket Policies (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html). -// -// The following action is related to GetBucketNotification: -// -// - PutBucketNotification (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketNotification.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketNotificationConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketNotificationConfiguration -func (c *S3) GetBucketNotificationConfiguration(input *GetBucketNotificationConfigurationRequest) (*NotificationConfiguration, error) { - req, out := c.GetBucketNotificationConfigurationRequest(input) - return out, req.Send() -} - -// GetBucketNotificationConfigurationWithContext is the same as GetBucketNotificationConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketNotificationConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetBucketNotificationConfigurationWithContext(ctx aws.Context, input *GetBucketNotificationConfigurationRequest, opts ...request.Option) (*NotificationConfiguration, error) { - req, out := c.GetBucketNotificationConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketOwnershipControls = "GetBucketOwnershipControls" - -// GetBucketOwnershipControlsRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketOwnershipControls operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketOwnershipControls for more information on using the GetBucketOwnershipControls -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketOwnershipControlsRequest method. -// req, resp := client.GetBucketOwnershipControlsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketOwnershipControls -func (c *S3) GetBucketOwnershipControlsRequest(input *GetBucketOwnershipControlsInput) (req *request.Request, output *GetBucketOwnershipControlsOutput) { - op := &request.Operation{ - Name: opGetBucketOwnershipControls, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?ownershipControls", - } - - if input == nil { - input = &GetBucketOwnershipControlsInput{} - } - - output = &GetBucketOwnershipControlsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketOwnershipControls API operation for Amazon Simple Storage Service. -// -// Retrieves OwnershipControls for an Amazon S3 bucket. To use this operation, -// you must have the s3:GetBucketOwnershipControls permission. For more information -// about Amazon S3 permissions, see Specifying permissions in a policy (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html). -// -// For information about Amazon S3 Object Ownership, see Using Object Ownership -// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html). -// -// The following operations are related to GetBucketOwnershipControls: -// -// - PutBucketOwnershipControls -// -// - DeleteBucketOwnershipControls -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketOwnershipControls for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketOwnershipControls -func (c *S3) GetBucketOwnershipControls(input *GetBucketOwnershipControlsInput) (*GetBucketOwnershipControlsOutput, error) { - req, out := c.GetBucketOwnershipControlsRequest(input) - return out, req.Send() -} - -// GetBucketOwnershipControlsWithContext is the same as GetBucketOwnershipControls with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketOwnershipControls for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetBucketOwnershipControlsWithContext(ctx aws.Context, input *GetBucketOwnershipControlsInput, opts ...request.Option) (*GetBucketOwnershipControlsOutput, error) { - req, out := c.GetBucketOwnershipControlsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketPolicy = "GetBucketPolicy" - -// GetBucketPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketPolicy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketPolicy for more information on using the GetBucketPolicy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketPolicyRequest method. -// req, resp := client.GetBucketPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicy -func (c *S3) GetBucketPolicyRequest(input *GetBucketPolicyInput) (req *request.Request, output *GetBucketPolicyOutput) { - op := &request.Operation{ - Name: opGetBucketPolicy, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?policy", - } - - if input == nil { - input = &GetBucketPolicyInput{} - } - - output = &GetBucketPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketPolicy API operation for Amazon Simple Storage Service. -// -// Returns the policy of a specified bucket. If you are using an identity other -// than the root user of the Amazon Web Services account that owns the bucket, -// the calling identity must have the GetBucketPolicy permissions on the specified -// bucket and belong to the bucket owner's account in order to use this operation. -// -// If you don't have GetBucketPolicy permissions, Amazon S3 returns a 403 Access -// Denied error. If you have the correct permissions, but you're not using an -// identity that belongs to the bucket owner's account, Amazon S3 returns a -// 405 Method Not Allowed error. -// -// As a security precaution, the root user of the Amazon Web Services account -// that owns a bucket can always use this operation, even if the policy explicitly -// denies the root user the ability to perform this action. -// -// For more information about bucket policies, see Using Bucket Policies and -// User Policies (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html). -// -// The following action is related to GetBucketPolicy: -// -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketPolicy for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicy -func (c *S3) GetBucketPolicy(input *GetBucketPolicyInput) (*GetBucketPolicyOutput, error) { - req, out := c.GetBucketPolicyRequest(input) - return out, req.Send() -} - -// GetBucketPolicyWithContext is the same as GetBucketPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketPolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetBucketPolicyWithContext(ctx aws.Context, input *GetBucketPolicyInput, opts ...request.Option) (*GetBucketPolicyOutput, error) { - req, out := c.GetBucketPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketPolicyStatus = "GetBucketPolicyStatus" - -// GetBucketPolicyStatusRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketPolicyStatus operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketPolicyStatus for more information on using the GetBucketPolicyStatus -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketPolicyStatusRequest method. -// req, resp := client.GetBucketPolicyStatusRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicyStatus -func (c *S3) GetBucketPolicyStatusRequest(input *GetBucketPolicyStatusInput) (req *request.Request, output *GetBucketPolicyStatusOutput) { - op := &request.Operation{ - Name: opGetBucketPolicyStatus, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?policyStatus", - } - - if input == nil { - input = &GetBucketPolicyStatusInput{} - } - - output = &GetBucketPolicyStatusOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketPolicyStatus API operation for Amazon Simple Storage Service. -// -// Retrieves the policy status for an Amazon S3 bucket, indicating whether the -// bucket is public. In order to use this operation, you must have the s3:GetBucketPolicyStatus -// permission. For more information about Amazon S3 permissions, see Specifying -// Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html). -// -// For more information about when Amazon S3 considers a bucket public, see -// The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status). -// -// The following operations are related to GetBucketPolicyStatus: -// -// - Using Amazon S3 Block Public Access (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html) -// -// - GetPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html) -// -// - PutPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html) -// -// - DeletePublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketPolicyStatus for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketPolicyStatus -func (c *S3) GetBucketPolicyStatus(input *GetBucketPolicyStatusInput) (*GetBucketPolicyStatusOutput, error) { - req, out := c.GetBucketPolicyStatusRequest(input) - return out, req.Send() -} - -// GetBucketPolicyStatusWithContext is the same as GetBucketPolicyStatus with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketPolicyStatus for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetBucketPolicyStatusWithContext(ctx aws.Context, input *GetBucketPolicyStatusInput, opts ...request.Option) (*GetBucketPolicyStatusOutput, error) { - req, out := c.GetBucketPolicyStatusRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketReplication = "GetBucketReplication" - -// GetBucketReplicationRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketReplication operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketReplication for more information on using the GetBucketReplication -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketReplicationRequest method. -// req, resp := client.GetBucketReplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketReplication -func (c *S3) GetBucketReplicationRequest(input *GetBucketReplicationInput) (req *request.Request, output *GetBucketReplicationOutput) { - op := &request.Operation{ - Name: opGetBucketReplication, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?replication", - } - - if input == nil { - input = &GetBucketReplicationInput{} - } - - output = &GetBucketReplicationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketReplication API operation for Amazon Simple Storage Service. -// -// Returns the replication configuration of a bucket. -// -// It can take a while to propagate the put or delete a replication configuration -// to all Amazon S3 systems. Therefore, a get request soon after put or delete -// can return a wrong result. -// -// For information about replication configuration, see Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html) -// in the Amazon S3 User Guide. -// -// This action requires permissions for the s3:GetReplicationConfiguration action. -// For more information about permissions, see Using Bucket Policies and User -// Policies (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html). -// -// If you include the Filter element in a replication configuration, you must -// also include the DeleteMarkerReplication and Priority elements. The response -// also returns those elements. -// -// For information about GetBucketReplication errors, see List of replication-related -// error codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ReplicationErrorCodeList) -// -// The following operations are related to GetBucketReplication: -// -// - PutBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketReplication.html) -// -// - DeleteBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketReplication for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketReplication -func (c *S3) GetBucketReplication(input *GetBucketReplicationInput) (*GetBucketReplicationOutput, error) { - req, out := c.GetBucketReplicationRequest(input) - return out, req.Send() -} - -// GetBucketReplicationWithContext is the same as GetBucketReplication with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketReplication for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetBucketReplicationWithContext(ctx aws.Context, input *GetBucketReplicationInput, opts ...request.Option) (*GetBucketReplicationOutput, error) { - req, out := c.GetBucketReplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketRequestPayment = "GetBucketRequestPayment" - -// GetBucketRequestPaymentRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketRequestPayment operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketRequestPayment for more information on using the GetBucketRequestPayment -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketRequestPaymentRequest method. -// req, resp := client.GetBucketRequestPaymentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketRequestPayment -func (c *S3) GetBucketRequestPaymentRequest(input *GetBucketRequestPaymentInput) (req *request.Request, output *GetBucketRequestPaymentOutput) { - op := &request.Operation{ - Name: opGetBucketRequestPayment, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?requestPayment", - } - - if input == nil { - input = &GetBucketRequestPaymentInput{} - } - - output = &GetBucketRequestPaymentOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketRequestPayment API operation for Amazon Simple Storage Service. -// -// Returns the request payment configuration of a bucket. To use this version -// of the operation, you must be the bucket owner. For more information, see -// Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html). -// -// The following operations are related to GetBucketRequestPayment: -// -// - ListObjects (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketRequestPayment for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketRequestPayment -func (c *S3) GetBucketRequestPayment(input *GetBucketRequestPaymentInput) (*GetBucketRequestPaymentOutput, error) { - req, out := c.GetBucketRequestPaymentRequest(input) - return out, req.Send() -} - -// GetBucketRequestPaymentWithContext is the same as GetBucketRequestPayment with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketRequestPayment for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetBucketRequestPaymentWithContext(ctx aws.Context, input *GetBucketRequestPaymentInput, opts ...request.Option) (*GetBucketRequestPaymentOutput, error) { - req, out := c.GetBucketRequestPaymentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketTagging = "GetBucketTagging" - -// GetBucketTaggingRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketTagging operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketTagging for more information on using the GetBucketTagging -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketTaggingRequest method. -// req, resp := client.GetBucketTaggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketTagging -func (c *S3) GetBucketTaggingRequest(input *GetBucketTaggingInput) (req *request.Request, output *GetBucketTaggingOutput) { - op := &request.Operation{ - Name: opGetBucketTagging, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?tagging", - } - - if input == nil { - input = &GetBucketTaggingInput{} - } - - output = &GetBucketTaggingOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketTagging API operation for Amazon Simple Storage Service. -// -// Returns the tag set associated with the bucket. -// -// To use this operation, you must have permission to perform the s3:GetBucketTagging -// action. By default, the bucket owner has this permission and can grant this -// permission to others. -// -// GetBucketTagging has the following special error: -// -// - Error code: NoSuchTagSet Description: There is no tag set associated -// with the bucket. -// -// The following operations are related to GetBucketTagging: -// -// - PutBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html) -// -// - DeleteBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketTagging for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketTagging -func (c *S3) GetBucketTagging(input *GetBucketTaggingInput) (*GetBucketTaggingOutput, error) { - req, out := c.GetBucketTaggingRequest(input) - return out, req.Send() -} - -// GetBucketTaggingWithContext is the same as GetBucketTagging with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketTagging for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetBucketTaggingWithContext(ctx aws.Context, input *GetBucketTaggingInput, opts ...request.Option) (*GetBucketTaggingOutput, error) { - req, out := c.GetBucketTaggingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketVersioning = "GetBucketVersioning" - -// GetBucketVersioningRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketVersioning operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketVersioning for more information on using the GetBucketVersioning -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketVersioningRequest method. -// req, resp := client.GetBucketVersioningRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketVersioning -func (c *S3) GetBucketVersioningRequest(input *GetBucketVersioningInput) (req *request.Request, output *GetBucketVersioningOutput) { - op := &request.Operation{ - Name: opGetBucketVersioning, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?versioning", - } - - if input == nil { - input = &GetBucketVersioningInput{} - } - - output = &GetBucketVersioningOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketVersioning API operation for Amazon Simple Storage Service. -// -// Returns the versioning state of a bucket. -// -// To retrieve the versioning state of a bucket, you must be the bucket owner. -// -// This implementation also returns the MFA Delete status of the versioning -// state. If the MFA Delete status is enabled, the bucket owner must use an -// authentication device to change the versioning state of the bucket. -// -// The following operations are related to GetBucketVersioning: -// -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// -// - PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) -// -// - DeleteObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketVersioning for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketVersioning -func (c *S3) GetBucketVersioning(input *GetBucketVersioningInput) (*GetBucketVersioningOutput, error) { - req, out := c.GetBucketVersioningRequest(input) - return out, req.Send() -} - -// GetBucketVersioningWithContext is the same as GetBucketVersioning with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketVersioning for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetBucketVersioningWithContext(ctx aws.Context, input *GetBucketVersioningInput, opts ...request.Option) (*GetBucketVersioningOutput, error) { - req, out := c.GetBucketVersioningRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetBucketWebsite = "GetBucketWebsite" - -// GetBucketWebsiteRequest generates a "aws/request.Request" representing the -// client's request for the GetBucketWebsite operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetBucketWebsite for more information on using the GetBucketWebsite -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetBucketWebsiteRequest method. -// req, resp := client.GetBucketWebsiteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketWebsite -func (c *S3) GetBucketWebsiteRequest(input *GetBucketWebsiteInput) (req *request.Request, output *GetBucketWebsiteOutput) { - op := &request.Operation{ - Name: opGetBucketWebsite, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?website", - } - - if input == nil { - input = &GetBucketWebsiteInput{} - } - - output = &GetBucketWebsiteOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetBucketWebsite API operation for Amazon Simple Storage Service. -// -// Returns the website configuration for a bucket. To host website on Amazon -// S3, you can configure a bucket as website by adding a website configuration. -// For more information about hosting websites, see Hosting Websites on Amazon -// S3 (https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html). -// -// This GET action requires the S3:GetBucketWebsite permission. By default, -// only the bucket owner can read the bucket website configuration. However, -// bucket owners can allow other users to read the website configuration by -// writing a bucket policy granting them the S3:GetBucketWebsite permission. -// -// The following operations are related to DeleteBucketWebsite: -// -// - DeleteBucketWebsite (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketWebsite.html) -// -// - PutBucketWebsite (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketWebsite.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetBucketWebsite for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetBucketWebsite -func (c *S3) GetBucketWebsite(input *GetBucketWebsiteInput) (*GetBucketWebsiteOutput, error) { - req, out := c.GetBucketWebsiteRequest(input) - return out, req.Send() -} - -// GetBucketWebsiteWithContext is the same as GetBucketWebsite with the addition of -// the ability to pass a context and additional request options. -// -// See GetBucketWebsite for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetBucketWebsiteWithContext(ctx aws.Context, input *GetBucketWebsiteInput, opts ...request.Option) (*GetBucketWebsiteOutput, error) { - req, out := c.GetBucketWebsiteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetObject = "GetObject" - -// GetObjectRequest generates a "aws/request.Request" representing the -// client's request for the GetObject operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetObject for more information on using the GetObject -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetObjectRequest method. -// req, resp := client.GetObjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObject -func (c *S3) GetObjectRequest(input *GetObjectInput) (req *request.Request, output *GetObjectOutput) { - op := &request.Operation{ - Name: opGetObject, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}/{Key+}", - } - - if input == nil { - input = &GetObjectInput{} - } - - output = &GetObjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetObject API operation for Amazon Simple Storage Service. -// -// Retrieves objects from Amazon S3. To use GET, you must have READ access to -// the object. If you grant READ access to the anonymous user, you can return -// the object without using an authorization header. -// -// An Amazon S3 bucket has no directory hierarchy such as you would find in -// a typical computer file system. You can, however, create a logical hierarchy -// by using object key names that imply a folder structure. For example, instead -// of naming an object sample.jpg, you can name it photos/2006/February/sample.jpg. -// -// To get an object from such a logical hierarchy, specify the full key name -// for the object in the GET operation. For a virtual hosted-style request example, -// if you have the object photos/2006/February/sample.jpg, specify the resource -// as /photos/2006/February/sample.jpg. For a path-style request example, if -// you have the object photos/2006/February/sample.jpg in the bucket named examplebucket, -// specify the resource as /examplebucket/photos/2006/February/sample.jpg. For -// more information about request types, see HTTP Host Header Bucket Specification -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html#VirtualHostingSpecifyBucket). -// -// For more information about returning the ACL of an object, see GetObjectAcl -// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html). -// -// If the object you are retrieving is stored in the S3 Glacier or S3 Glacier -// Deep Archive storage class, or S3 Intelligent-Tiering Archive or S3 Intelligent-Tiering -// Deep Archive tiers, before you can retrieve the object you must first restore -// a copy using RestoreObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html). -// Otherwise, this action returns an InvalidObjectStateError error. For information -// about restoring archived objects, see Restoring Archived Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html). -// -// Encryption request headers, like x-amz-server-side-encryption, should not -// be sent for GET requests if your object uses server-side encryption with -// KMS keys (SSE-KMS) or server-side encryption with Amazon S3–managed encryption -// keys (SSE-S3). If your object does use these types of keys, you’ll get -// an HTTP 400 BadRequest error. -// -// If you encrypt an object by using server-side encryption with customer-provided -// encryption keys (SSE-C) when you store the object in Amazon S3, then when -// you GET the object, you must use the following headers: -// -// - x-amz-server-side-encryption-customer-algorithm -// -// - x-amz-server-side-encryption-customer-key -// -// - x-amz-server-side-encryption-customer-key-MD5 -// -// For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided -// Encryption Keys) (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html). -// -// Assuming you have the relevant permission to read object tags, the response -// also returns the x-amz-tagging-count header that provides the count of number -// of tags associated with the object. You can use GetObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html) -// to retrieve the tag set associated with an object. -// -// # Permissions -// -// You need the relevant read object (or version) permission for this operation. -// For more information, see Specifying Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html). -// If the object you request does not exist, the error Amazon S3 returns depends -// on whether you also have the s3:ListBucket permission. -// -// - If you have the s3:ListBucket permission on the bucket, Amazon S3 will -// return an HTTP status code 404 ("no such key") error. -// -// - If you don’t have the s3:ListBucket permission, Amazon S3 will return -// an HTTP status code 403 ("access denied") error. -// -// # Versioning -// -// By default, the GET action returns the current version of an object. To return -// a different version, use the versionId subresource. -// -// - If you supply a versionId, you need the s3:GetObjectVersion permission -// to access a specific version of an object. If you request a specific version, -// you do not need to have the s3:GetObject permission. -// -// - If the current version of the object is a delete marker, Amazon S3 behaves -// as if the object was deleted and includes x-amz-delete-marker: true in -// the response. -// -// For more information about versioning, see PutBucketVersioning (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html). -// -// # Overriding Response Header Values -// -// There are times when you want to override certain response header values -// in a GET response. For example, you might override the Content-Disposition -// response header value in your GET request. -// -// You can override values for a set of response headers using the following -// query parameters. These response header values are sent only on a successful -// request, that is, when status code 200 OK is returned. The set of headers -// you can override using these parameters is a subset of the headers that Amazon -// S3 accepts when you create an object. The response headers that you can override -// for the GET response are Content-Type, Content-Language, Expires, Cache-Control, -// Content-Disposition, and Content-Encoding. To override these header values -// in the GET response, you use the following request parameters. -// -// You must sign the request, either using an Authorization header or a presigned -// URL, when using these parameters. They cannot be used with an unsigned (anonymous) -// request. -// -// - response-content-type -// -// - response-content-language -// -// - response-expires -// -// - response-cache-control -// -// - response-content-disposition -// -// - response-content-encoding -// -// # Additional Considerations about Request Headers -// -// If both of the If-Match and If-Unmodified-Since headers are present in the -// request as follows: If-Match condition evaluates to true, and; If-Unmodified-Since -// condition evaluates to false; then, S3 returns 200 OK and the data requested. -// -// If both of the If-None-Match and If-Modified-Since headers are present in -// the request as follows:If-None-Match condition evaluates to false, and; If-Modified-Since -// condition evaluates to true; then, S3 returns 304 Not Modified response code. -// -// For more information about conditional requests, see RFC 7232 (https://tools.ietf.org/html/rfc7232). -// -// The following operations are related to GetObject: -// -// - ListBuckets (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html) -// -// - GetObjectAcl (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetObject for usage and error information. -// -// Returned Error Codes: -// -// - ErrCodeNoSuchKey "NoSuchKey" -// The specified key does not exist. -// -// - ErrCodeInvalidObjectState "InvalidObjectState" -// Object is archived and inaccessible until restored. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObject -func (c *S3) GetObject(input *GetObjectInput) (*GetObjectOutput, error) { - req, out := c.GetObjectRequest(input) - return out, req.Send() -} - -// GetObjectWithContext is the same as GetObject with the addition of -// the ability to pass a context and additional request options. -// -// See GetObject for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetObjectWithContext(ctx aws.Context, input *GetObjectInput, opts ...request.Option) (*GetObjectOutput, error) { - req, out := c.GetObjectRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetObjectAcl = "GetObjectAcl" - -// GetObjectAclRequest generates a "aws/request.Request" representing the -// client's request for the GetObjectAcl operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetObjectAcl for more information on using the GetObjectAcl -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetObjectAclRequest method. -// req, resp := client.GetObjectAclRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectAcl -func (c *S3) GetObjectAclRequest(input *GetObjectAclInput) (req *request.Request, output *GetObjectAclOutput) { - op := &request.Operation{ - Name: opGetObjectAcl, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}/{Key+}?acl", - } - - if input == nil { - input = &GetObjectAclInput{} - } - - output = &GetObjectAclOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetObjectAcl API operation for Amazon Simple Storage Service. -// -// Returns the access control list (ACL) of an object. To use this operation, -// you must have s3:GetObjectAcl permissions or READ_ACP access to the object. -// For more information, see Mapping of ACL permissions and access policy permissions -// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#acl-access-policy-permission-mapping) -// in the Amazon S3 User Guide -// -// This action is not supported by Amazon S3 on Outposts. -// -// # Versioning -// -// By default, GET returns ACL information about the current version of an object. -// To return ACL information about a different version, use the versionId subresource. -// -// If your bucket uses the bucket owner enforced setting for S3 Object Ownership, -// requests to read ACLs are still supported and return the bucket-owner-full-control -// ACL with the owner being the account that created the bucket. For more information, -// see Controlling object ownership and disabling ACLs (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) -// in the Amazon S3 User Guide. -// -// The following operations are related to GetObjectAcl: -// -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// -// - GetObjectAttributes (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html) -// -// - DeleteObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) -// -// - PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetObjectAcl for usage and error information. -// -// Returned Error Codes: -// - ErrCodeNoSuchKey "NoSuchKey" -// The specified key does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectAcl -func (c *S3) GetObjectAcl(input *GetObjectAclInput) (*GetObjectAclOutput, error) { - req, out := c.GetObjectAclRequest(input) - return out, req.Send() -} - -// GetObjectAclWithContext is the same as GetObjectAcl with the addition of -// the ability to pass a context and additional request options. -// -// See GetObjectAcl for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetObjectAclWithContext(ctx aws.Context, input *GetObjectAclInput, opts ...request.Option) (*GetObjectAclOutput, error) { - req, out := c.GetObjectAclRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetObjectAttributes = "GetObjectAttributes" - -// GetObjectAttributesRequest generates a "aws/request.Request" representing the -// client's request for the GetObjectAttributes operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetObjectAttributes for more information on using the GetObjectAttributes -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetObjectAttributesRequest method. -// req, resp := client.GetObjectAttributesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectAttributes -func (c *S3) GetObjectAttributesRequest(input *GetObjectAttributesInput) (req *request.Request, output *GetObjectAttributesOutput) { - op := &request.Operation{ - Name: opGetObjectAttributes, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}/{Key+}?attributes", - } - - if input == nil { - input = &GetObjectAttributesInput{} - } - - output = &GetObjectAttributesOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetObjectAttributes API operation for Amazon Simple Storage Service. -// -// Retrieves all the metadata from an object without returning the object itself. -// This action is useful if you're interested only in an object's metadata. -// To use GetObjectAttributes, you must have READ access to the object. -// -// GetObjectAttributes combines the functionality of GetObjectAcl, GetObjectLegalHold, -// GetObjectLockConfiguration, GetObjectRetention, GetObjectTagging, HeadObject, -// and ListParts. All of the data returned with each of those individual calls -// can be returned with a single call to GetObjectAttributes. -// -// If you encrypt an object by using server-side encryption with customer-provided -// encryption keys (SSE-C) when you store the object in Amazon S3, then when -// you retrieve the metadata from the object, you must use the following headers: -// -// - x-amz-server-side-encryption-customer-algorithm -// -// - x-amz-server-side-encryption-customer-key -// -// - x-amz-server-side-encryption-customer-key-MD5 -// -// For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided -// Encryption Keys) (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) -// in the Amazon S3 User Guide. -// -// - Encryption request headers, such as x-amz-server-side-encryption, should -// not be sent for GET requests if your object uses server-side encryption -// with Amazon Web Services KMS keys stored in Amazon Web Services Key Management -// Service (SSE-KMS) or server-side encryption with Amazon S3 managed encryption -// keys (SSE-S3). If your object does use these types of keys, you'll get -// an HTTP 400 Bad Request error. -// -// - The last modified property in this case is the creation date of the -// object. -// -// Consider the following when using request headers: -// -// - If both of the If-Match and If-Unmodified-Since headers are present -// in the request as follows, then Amazon S3 returns the HTTP status code -// 200 OK and the data requested: If-Match condition evaluates to true. If-Unmodified-Since -// condition evaluates to false. -// -// - If both of the If-None-Match and If-Modified-Since headers are present -// in the request as follows, then Amazon S3 returns the HTTP status code -// 304 Not Modified: If-None-Match condition evaluates to false. If-Modified-Since -// condition evaluates to true. -// -// For more information about conditional requests, see RFC 7232 (https://tools.ietf.org/html/rfc7232). -// -// # Permissions -// -// The permissions that you need to use this operation depend on whether the -// bucket is versioned. If the bucket is versioned, you need both the s3:GetObjectVersion -// and s3:GetObjectVersionAttributes permissions for this operation. If the -// bucket is not versioned, you need the s3:GetObject and s3:GetObjectAttributes -// permissions. For more information, see Specifying Permissions in a Policy -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html) -// in the Amazon S3 User Guide. If the object that you request does not exist, -// the error Amazon S3 returns depends on whether you also have the s3:ListBucket -// permission. -// -// - If you have the s3:ListBucket permission on the bucket, Amazon S3 returns -// an HTTP status code 404 Not Found ("no such key") error. -// -// - If you don't have the s3:ListBucket permission, Amazon S3 returns an -// HTTP status code 403 Forbidden ("access denied") error. -// -// The following actions are related to GetObjectAttributes: -// -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// -// - GetObjectAcl (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html) -// -// - GetObjectLegalHold (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLegalHold.html) -// -// - GetObjectLockConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLockConfiguration.html) -// -// - GetObjectRetention (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectRetention.html) -// -// - GetObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html) -// -// - HeadObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html) -// -// - ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetObjectAttributes for usage and error information. -// -// Returned Error Codes: -// - ErrCodeNoSuchKey "NoSuchKey" -// The specified key does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectAttributes -func (c *S3) GetObjectAttributes(input *GetObjectAttributesInput) (*GetObjectAttributesOutput, error) { - req, out := c.GetObjectAttributesRequest(input) - return out, req.Send() -} - -// GetObjectAttributesWithContext is the same as GetObjectAttributes with the addition of -// the ability to pass a context and additional request options. -// -// See GetObjectAttributes for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetObjectAttributesWithContext(ctx aws.Context, input *GetObjectAttributesInput, opts ...request.Option) (*GetObjectAttributesOutput, error) { - req, out := c.GetObjectAttributesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetObjectLegalHold = "GetObjectLegalHold" - -// GetObjectLegalHoldRequest generates a "aws/request.Request" representing the -// client's request for the GetObjectLegalHold operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetObjectLegalHold for more information on using the GetObjectLegalHold -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetObjectLegalHoldRequest method. -// req, resp := client.GetObjectLegalHoldRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectLegalHold -func (c *S3) GetObjectLegalHoldRequest(input *GetObjectLegalHoldInput) (req *request.Request, output *GetObjectLegalHoldOutput) { - op := &request.Operation{ - Name: opGetObjectLegalHold, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}/{Key+}?legal-hold", - } - - if input == nil { - input = &GetObjectLegalHoldInput{} - } - - output = &GetObjectLegalHoldOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetObjectLegalHold API operation for Amazon Simple Storage Service. -// -// Gets an object's current legal hold status. For more information, see Locking -// Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). -// -// This action is not supported by Amazon S3 on Outposts. -// -// The following action is related to GetObjectLegalHold: -// -// - GetObjectAttributes (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetObjectLegalHold for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectLegalHold -func (c *S3) GetObjectLegalHold(input *GetObjectLegalHoldInput) (*GetObjectLegalHoldOutput, error) { - req, out := c.GetObjectLegalHoldRequest(input) - return out, req.Send() -} - -// GetObjectLegalHoldWithContext is the same as GetObjectLegalHold with the addition of -// the ability to pass a context and additional request options. -// -// See GetObjectLegalHold for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetObjectLegalHoldWithContext(ctx aws.Context, input *GetObjectLegalHoldInput, opts ...request.Option) (*GetObjectLegalHoldOutput, error) { - req, out := c.GetObjectLegalHoldRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetObjectLockConfiguration = "GetObjectLockConfiguration" - -// GetObjectLockConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetObjectLockConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetObjectLockConfiguration for more information on using the GetObjectLockConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetObjectLockConfigurationRequest method. -// req, resp := client.GetObjectLockConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectLockConfiguration -func (c *S3) GetObjectLockConfigurationRequest(input *GetObjectLockConfigurationInput) (req *request.Request, output *GetObjectLockConfigurationOutput) { - op := &request.Operation{ - Name: opGetObjectLockConfiguration, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?object-lock", - } - - if input == nil { - input = &GetObjectLockConfigurationInput{} - } - - output = &GetObjectLockConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetObjectLockConfiguration API operation for Amazon Simple Storage Service. -// -// Gets the Object Lock configuration for a bucket. The rule specified in the -// Object Lock configuration will be applied by default to every new object -// placed in the specified bucket. For more information, see Locking Objects -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). -// -// The following action is related to GetObjectLockConfiguration: -// -// - GetObjectAttributes (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetObjectLockConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectLockConfiguration -func (c *S3) GetObjectLockConfiguration(input *GetObjectLockConfigurationInput) (*GetObjectLockConfigurationOutput, error) { - req, out := c.GetObjectLockConfigurationRequest(input) - return out, req.Send() -} - -// GetObjectLockConfigurationWithContext is the same as GetObjectLockConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetObjectLockConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetObjectLockConfigurationWithContext(ctx aws.Context, input *GetObjectLockConfigurationInput, opts ...request.Option) (*GetObjectLockConfigurationOutput, error) { - req, out := c.GetObjectLockConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetObjectRetention = "GetObjectRetention" - -// GetObjectRetentionRequest generates a "aws/request.Request" representing the -// client's request for the GetObjectRetention operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetObjectRetention for more information on using the GetObjectRetention -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetObjectRetentionRequest method. -// req, resp := client.GetObjectRetentionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectRetention -func (c *S3) GetObjectRetentionRequest(input *GetObjectRetentionInput) (req *request.Request, output *GetObjectRetentionOutput) { - op := &request.Operation{ - Name: opGetObjectRetention, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}/{Key+}?retention", - } - - if input == nil { - input = &GetObjectRetentionInput{} - } - - output = &GetObjectRetentionOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetObjectRetention API operation for Amazon Simple Storage Service. -// -// Retrieves an object's retention settings. For more information, see Locking -// Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). -// -// This action is not supported by Amazon S3 on Outposts. -// -// The following action is related to GetObjectRetention: -// -// - GetObjectAttributes (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetObjectRetention for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectRetention -func (c *S3) GetObjectRetention(input *GetObjectRetentionInput) (*GetObjectRetentionOutput, error) { - req, out := c.GetObjectRetentionRequest(input) - return out, req.Send() -} - -// GetObjectRetentionWithContext is the same as GetObjectRetention with the addition of -// the ability to pass a context and additional request options. -// -// See GetObjectRetention for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetObjectRetentionWithContext(ctx aws.Context, input *GetObjectRetentionInput, opts ...request.Option) (*GetObjectRetentionOutput, error) { - req, out := c.GetObjectRetentionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetObjectTagging = "GetObjectTagging" - -// GetObjectTaggingRequest generates a "aws/request.Request" representing the -// client's request for the GetObjectTagging operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetObjectTagging for more information on using the GetObjectTagging -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetObjectTaggingRequest method. -// req, resp := client.GetObjectTaggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTagging -func (c *S3) GetObjectTaggingRequest(input *GetObjectTaggingInput) (req *request.Request, output *GetObjectTaggingOutput) { - op := &request.Operation{ - Name: opGetObjectTagging, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}/{Key+}?tagging", - } - - if input == nil { - input = &GetObjectTaggingInput{} - } - - output = &GetObjectTaggingOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetObjectTagging API operation for Amazon Simple Storage Service. -// -// Returns the tag-set of an object. You send the GET request against the tagging -// subresource associated with the object. -// -// To use this operation, you must have permission to perform the s3:GetObjectTagging -// action. By default, the GET action returns information about current version -// of an object. For a versioned bucket, you can have multiple versions of an -// object in your bucket. To retrieve tags of any other version, use the versionId -// query parameter. You also need permission for the s3:GetObjectVersionTagging -// action. -// -// By default, the bucket owner has this permission and can grant this permission -// to others. -// -// For information about the Amazon S3 object tagging feature, see Object Tagging -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html). -// -// The following actions are related to GetObjectTagging: -// -// - DeleteObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html) -// -// - GetObjectAttributes (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html) -// -// - PutObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetObjectTagging for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTagging -func (c *S3) GetObjectTagging(input *GetObjectTaggingInput) (*GetObjectTaggingOutput, error) { - req, out := c.GetObjectTaggingRequest(input) - return out, req.Send() -} - -// GetObjectTaggingWithContext is the same as GetObjectTagging with the addition of -// the ability to pass a context and additional request options. -// -// See GetObjectTagging for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetObjectTaggingWithContext(ctx aws.Context, input *GetObjectTaggingInput, opts ...request.Option) (*GetObjectTaggingOutput, error) { - req, out := c.GetObjectTaggingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetObjectTorrent = "GetObjectTorrent" - -// GetObjectTorrentRequest generates a "aws/request.Request" representing the -// client's request for the GetObjectTorrent operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetObjectTorrent for more information on using the GetObjectTorrent -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetObjectTorrentRequest method. -// req, resp := client.GetObjectTorrentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTorrent -func (c *S3) GetObjectTorrentRequest(input *GetObjectTorrentInput) (req *request.Request, output *GetObjectTorrentOutput) { - op := &request.Operation{ - Name: opGetObjectTorrent, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}/{Key+}?torrent", - } - - if input == nil { - input = &GetObjectTorrentInput{} - } - - output = &GetObjectTorrentOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetObjectTorrent API operation for Amazon Simple Storage Service. -// -// Returns torrent files from a bucket. BitTorrent can save you bandwidth when -// you're distributing large files. For more information about BitTorrent, see -// Using BitTorrent with Amazon S3 (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3Torrent.html). -// -// You can get torrent only for objects that are less than 5 GB in size, and -// that are not encrypted using server-side encryption with a customer-provided -// encryption key. -// -// To use GET, you must have READ access to the object. -// -// This action is not supported by Amazon S3 on Outposts. -// -// The following action is related to GetObjectTorrent: -// -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetObjectTorrent for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetObjectTorrent -func (c *S3) GetObjectTorrent(input *GetObjectTorrentInput) (*GetObjectTorrentOutput, error) { - req, out := c.GetObjectTorrentRequest(input) - return out, req.Send() -} - -// GetObjectTorrentWithContext is the same as GetObjectTorrent with the addition of -// the ability to pass a context and additional request options. -// -// See GetObjectTorrent for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetObjectTorrentWithContext(ctx aws.Context, input *GetObjectTorrentInput, opts ...request.Option) (*GetObjectTorrentOutput, error) { - req, out := c.GetObjectTorrentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetPublicAccessBlock = "GetPublicAccessBlock" - -// GetPublicAccessBlockRequest generates a "aws/request.Request" representing the -// client's request for the GetPublicAccessBlock operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetPublicAccessBlock for more information on using the GetPublicAccessBlock -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetPublicAccessBlockRequest method. -// req, resp := client.GetPublicAccessBlockRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetPublicAccessBlock -func (c *S3) GetPublicAccessBlockRequest(input *GetPublicAccessBlockInput) (req *request.Request, output *GetPublicAccessBlockOutput) { - op := &request.Operation{ - Name: opGetPublicAccessBlock, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?publicAccessBlock", - } - - if input == nil { - input = &GetPublicAccessBlockInput{} - } - - output = &GetPublicAccessBlockOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPublicAccessBlock API operation for Amazon Simple Storage Service. -// -// Retrieves the PublicAccessBlock configuration for an Amazon S3 bucket. To -// use this operation, you must have the s3:GetBucketPublicAccessBlock permission. -// For more information about Amazon S3 permissions, see Specifying Permissions -// in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html). -// -// When Amazon S3 evaluates the PublicAccessBlock configuration for a bucket -// or an object, it checks the PublicAccessBlock configuration for both the -// bucket (or the bucket that contains the object) and the bucket owner's account. -// If the PublicAccessBlock settings are different between the bucket and the -// account, Amazon S3 uses the most restrictive combination of the bucket-level -// and account-level settings. -// -// For more information about when Amazon S3 considers a bucket or an object -// public, see The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status). -// -// The following operations are related to GetPublicAccessBlock: -// -// - Using Amazon S3 Block Public Access (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html) -// -// - PutPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutPublicAccessBlock.html) -// -// - GetPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html) -// -// - DeletePublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation GetPublicAccessBlock for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/GetPublicAccessBlock -func (c *S3) GetPublicAccessBlock(input *GetPublicAccessBlockInput) (*GetPublicAccessBlockOutput, error) { - req, out := c.GetPublicAccessBlockRequest(input) - return out, req.Send() -} - -// GetPublicAccessBlockWithContext is the same as GetPublicAccessBlock with the addition of -// the ability to pass a context and additional request options. -// -// See GetPublicAccessBlock for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) GetPublicAccessBlockWithContext(ctx aws.Context, input *GetPublicAccessBlockInput, opts ...request.Option) (*GetPublicAccessBlockOutput, error) { - req, out := c.GetPublicAccessBlockRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opHeadBucket = "HeadBucket" - -// HeadBucketRequest generates a "aws/request.Request" representing the -// client's request for the HeadBucket operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See HeadBucket for more information on using the HeadBucket -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the HeadBucketRequest method. -// req, resp := client.HeadBucketRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadBucket -func (c *S3) HeadBucketRequest(input *HeadBucketInput) (req *request.Request, output *HeadBucketOutput) { - op := &request.Operation{ - Name: opHeadBucket, - HTTPMethod: "HEAD", - HTTPPath: "/{Bucket}", - } - - if input == nil { - input = &HeadBucketInput{} - } - - output = &HeadBucketOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// HeadBucket API operation for Amazon Simple Storage Service. -// -// This action is useful to determine if a bucket exists and you have permission -// to access it. The action returns a 200 OK if the bucket exists and you have -// permission to access it. -// -// If the bucket does not exist or you do not have permission to access it, -// the HEAD request returns a generic 404 Not Found or 403 Forbidden code. A -// message body is not included, so you cannot determine the exception beyond -// these error codes. -// -// To use this operation, you must have permissions to perform the s3:ListBucket -// action. The bucket owner has this permission by default and can grant this -// permission to others. For more information about permissions, see Permissions -// Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// To use this API against an access point, you must provide the alias of the -// access point in place of the bucket name or specify the access point ARN. -// When using the access point ARN, you must direct requests to the access point -// hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. -// When using the Amazon Web Services SDKs, you provide the ARN in place of -// the bucket name. For more information see, Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation HeadBucket for usage and error information. -// -// Returned Error Codes: -// - ErrCodeNoSuchBucket "NoSuchBucket" -// The specified bucket does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadBucket -func (c *S3) HeadBucket(input *HeadBucketInput) (*HeadBucketOutput, error) { - req, out := c.HeadBucketRequest(input) - return out, req.Send() -} - -// HeadBucketWithContext is the same as HeadBucket with the addition of -// the ability to pass a context and additional request options. -// -// See HeadBucket for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) HeadBucketWithContext(ctx aws.Context, input *HeadBucketInput, opts ...request.Option) (*HeadBucketOutput, error) { - req, out := c.HeadBucketRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opHeadObject = "HeadObject" - -// HeadObjectRequest generates a "aws/request.Request" representing the -// client's request for the HeadObject operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See HeadObject for more information on using the HeadObject -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the HeadObjectRequest method. -// req, resp := client.HeadObjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadObject -func (c *S3) HeadObjectRequest(input *HeadObjectInput) (req *request.Request, output *HeadObjectOutput) { - op := &request.Operation{ - Name: opHeadObject, - HTTPMethod: "HEAD", - HTTPPath: "/{Bucket}/{Key+}", - } - - if input == nil { - input = &HeadObjectInput{} - } - - output = &HeadObjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// HeadObject API operation for Amazon Simple Storage Service. -// -// The HEAD action retrieves metadata from an object without returning the object -// itself. This action is useful if you're only interested in an object's metadata. -// To use HEAD, you must have READ access to the object. -// -// A HEAD request has the same options as a GET action on an object. The response -// is identical to the GET response except that there is no response body. Because -// of this, if the HEAD request generates an error, it returns a generic 404 -// Not Found or 403 Forbidden code. It is not possible to retrieve the exact -// exception beyond these error codes. -// -// If you encrypt an object by using server-side encryption with customer-provided -// encryption keys (SSE-C) when you store the object in Amazon S3, then when -// you retrieve the metadata from the object, you must use the following headers: -// -// - x-amz-server-side-encryption-customer-algorithm -// -// - x-amz-server-side-encryption-customer-key -// -// - x-amz-server-side-encryption-customer-key-MD5 -// -// For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided -// Encryption Keys) (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html). -// -// - Encryption request headers, like x-amz-server-side-encryption, should -// not be sent for GET requests if your object uses server-side encryption -// with KMS keys (SSE-KMS) or server-side encryption with Amazon S3–managed -// encryption keys (SSE-S3). If your object does use these types of keys, -// you’ll get an HTTP 400 BadRequest error. -// -// - The last modified property in this case is the creation date of the -// object. -// -// Request headers are limited to 8 KB in size. For more information, see Common -// Request Headers (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonRequestHeaders.html). -// -// Consider the following when using request headers: -// -// - Consideration 1 – If both of the If-Match and If-Unmodified-Since -// headers are present in the request as follows: If-Match condition evaluates -// to true, and; If-Unmodified-Since condition evaluates to false; Then Amazon -// S3 returns 200 OK and the data requested. -// -// - Consideration 2 – If both of the If-None-Match and If-Modified-Since -// headers are present in the request as follows: If-None-Match condition -// evaluates to false, and; If-Modified-Since condition evaluates to true; -// Then Amazon S3 returns the 304 Not Modified response code. -// -// For more information about conditional requests, see RFC 7232 (https://tools.ietf.org/html/rfc7232). -// -// # Permissions -// -// You need the relevant read object (or version) permission for this operation. -// For more information, see Specifying Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html). -// If the object you request does not exist, the error Amazon S3 returns depends -// on whether you also have the s3:ListBucket permission. -// -// - If you have the s3:ListBucket permission on the bucket, Amazon S3 returns -// an HTTP status code 404 ("no such key") error. -// -// - If you don’t have the s3:ListBucket permission, Amazon S3 returns -// an HTTP status code 403 ("access denied") error. -// -// The following actions are related to HeadObject: -// -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// -// - GetObjectAttributes (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html) -// -// See http://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#RESTErrorResponses -// for more information on returned errors. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation HeadObject for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/HeadObject -func (c *S3) HeadObject(input *HeadObjectInput) (*HeadObjectOutput, error) { - req, out := c.HeadObjectRequest(input) - return out, req.Send() -} - -// HeadObjectWithContext is the same as HeadObject with the addition of -// the ability to pass a context and additional request options. -// -// See HeadObject for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) HeadObjectWithContext(ctx aws.Context, input *HeadObjectInput, opts ...request.Option) (*HeadObjectOutput, error) { - req, out := c.HeadObjectRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListBucketAnalyticsConfigurations = "ListBucketAnalyticsConfigurations" - -// ListBucketAnalyticsConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the ListBucketAnalyticsConfigurations operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListBucketAnalyticsConfigurations for more information on using the ListBucketAnalyticsConfigurations -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListBucketAnalyticsConfigurationsRequest method. -// req, resp := client.ListBucketAnalyticsConfigurationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketAnalyticsConfigurations -func (c *S3) ListBucketAnalyticsConfigurationsRequest(input *ListBucketAnalyticsConfigurationsInput) (req *request.Request, output *ListBucketAnalyticsConfigurationsOutput) { - op := &request.Operation{ - Name: opListBucketAnalyticsConfigurations, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?analytics", - } - - if input == nil { - input = &ListBucketAnalyticsConfigurationsInput{} - } - - output = &ListBucketAnalyticsConfigurationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListBucketAnalyticsConfigurations API operation for Amazon Simple Storage Service. -// -// Lists the analytics configurations for the bucket. You can have up to 1,000 -// analytics configurations per bucket. -// -// This action supports list pagination and does not return more than 100 configurations -// at a time. You should always check the IsTruncated element in the response. -// If there are no more configurations to list, IsTruncated is set to false. -// If there are more configurations to list, IsTruncated is set to true, and -// there will be a value in NextContinuationToken. You use the NextContinuationToken -// value to continue the pagination of the list by passing the value in continuation-token -// in the request to GET the next page. -// -// To use this operation, you must have permissions to perform the s3:GetAnalyticsConfiguration -// action. The bucket owner has this permission by default. The bucket owner -// can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// For information about Amazon S3 analytics feature, see Amazon S3 Analytics -// – Storage Class Analysis (https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html). -// -// The following operations are related to ListBucketAnalyticsConfigurations: -// -// - GetBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html) -// -// - DeleteBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html) -// -// - PutBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketAnalyticsConfiguration.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation ListBucketAnalyticsConfigurations for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketAnalyticsConfigurations -func (c *S3) ListBucketAnalyticsConfigurations(input *ListBucketAnalyticsConfigurationsInput) (*ListBucketAnalyticsConfigurationsOutput, error) { - req, out := c.ListBucketAnalyticsConfigurationsRequest(input) - return out, req.Send() -} - -// ListBucketAnalyticsConfigurationsWithContext is the same as ListBucketAnalyticsConfigurations with the addition of -// the ability to pass a context and additional request options. -// -// See ListBucketAnalyticsConfigurations for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) ListBucketAnalyticsConfigurationsWithContext(ctx aws.Context, input *ListBucketAnalyticsConfigurationsInput, opts ...request.Option) (*ListBucketAnalyticsConfigurationsOutput, error) { - req, out := c.ListBucketAnalyticsConfigurationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListBucketIntelligentTieringConfigurations = "ListBucketIntelligentTieringConfigurations" - -// ListBucketIntelligentTieringConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the ListBucketIntelligentTieringConfigurations operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListBucketIntelligentTieringConfigurations for more information on using the ListBucketIntelligentTieringConfigurations -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListBucketIntelligentTieringConfigurationsRequest method. -// req, resp := client.ListBucketIntelligentTieringConfigurationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketIntelligentTieringConfigurations -func (c *S3) ListBucketIntelligentTieringConfigurationsRequest(input *ListBucketIntelligentTieringConfigurationsInput) (req *request.Request, output *ListBucketIntelligentTieringConfigurationsOutput) { - op := &request.Operation{ - Name: opListBucketIntelligentTieringConfigurations, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?intelligent-tiering", - } - - if input == nil { - input = &ListBucketIntelligentTieringConfigurationsInput{} - } - - output = &ListBucketIntelligentTieringConfigurationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListBucketIntelligentTieringConfigurations API operation for Amazon Simple Storage Service. -// -// Lists the S3 Intelligent-Tiering configuration from the specified bucket. -// -// The S3 Intelligent-Tiering storage class is designed to optimize storage -// costs by automatically moving data to the most cost-effective storage access -// tier, without performance impact or operational overhead. S3 Intelligent-Tiering -// delivers automatic cost savings in three low latency and high throughput -// access tiers. To get the lowest storage cost on data that can be accessed -// in minutes to hours, you can choose to activate additional archiving capabilities. -// -// The S3 Intelligent-Tiering storage class is the ideal storage class for data -// with unknown, changing, or unpredictable access patterns, independent of -// object size or retention period. If the size of an object is less than 128 -// KB, it is not monitored and not eligible for auto-tiering. Smaller objects -// can be stored, but they are always charged at the Frequent Access tier rates -// in the S3 Intelligent-Tiering storage class. -// -// For more information, see Storage class for automatically optimizing frequently -// and infrequently accessed objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access). -// -// Operations related to ListBucketIntelligentTieringConfigurations include: -// -// - DeleteBucketIntelligentTieringConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTieringConfiguration.html) -// -// - PutBucketIntelligentTieringConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html) -// -// - GetBucketIntelligentTieringConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation ListBucketIntelligentTieringConfigurations for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketIntelligentTieringConfigurations -func (c *S3) ListBucketIntelligentTieringConfigurations(input *ListBucketIntelligentTieringConfigurationsInput) (*ListBucketIntelligentTieringConfigurationsOutput, error) { - req, out := c.ListBucketIntelligentTieringConfigurationsRequest(input) - return out, req.Send() -} - -// ListBucketIntelligentTieringConfigurationsWithContext is the same as ListBucketIntelligentTieringConfigurations with the addition of -// the ability to pass a context and additional request options. -// -// See ListBucketIntelligentTieringConfigurations for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) ListBucketIntelligentTieringConfigurationsWithContext(ctx aws.Context, input *ListBucketIntelligentTieringConfigurationsInput, opts ...request.Option) (*ListBucketIntelligentTieringConfigurationsOutput, error) { - req, out := c.ListBucketIntelligentTieringConfigurationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListBucketInventoryConfigurations = "ListBucketInventoryConfigurations" - -// ListBucketInventoryConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the ListBucketInventoryConfigurations operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListBucketInventoryConfigurations for more information on using the ListBucketInventoryConfigurations -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListBucketInventoryConfigurationsRequest method. -// req, resp := client.ListBucketInventoryConfigurationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketInventoryConfigurations -func (c *S3) ListBucketInventoryConfigurationsRequest(input *ListBucketInventoryConfigurationsInput) (req *request.Request, output *ListBucketInventoryConfigurationsOutput) { - op := &request.Operation{ - Name: opListBucketInventoryConfigurations, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?inventory", - } - - if input == nil { - input = &ListBucketInventoryConfigurationsInput{} - } - - output = &ListBucketInventoryConfigurationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListBucketInventoryConfigurations API operation for Amazon Simple Storage Service. -// -// Returns a list of inventory configurations for the bucket. You can have up -// to 1,000 analytics configurations per bucket. -// -// This action supports list pagination and does not return more than 100 configurations -// at a time. Always check the IsTruncated element in the response. If there -// are no more configurations to list, IsTruncated is set to false. If there -// are more configurations to list, IsTruncated is set to true, and there is -// a value in NextContinuationToken. You use the NextContinuationToken value -// to continue the pagination of the list by passing the value in continuation-token -// in the request to GET the next page. -// -// To use this operation, you must have permissions to perform the s3:GetInventoryConfiguration -// action. The bucket owner has this permission by default. The bucket owner -// can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// For information about the Amazon S3 inventory feature, see Amazon S3 Inventory -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html) -// -// The following operations are related to ListBucketInventoryConfigurations: -// -// - GetBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html) -// -// - DeleteBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html) -// -// - PutBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketInventoryConfiguration.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation ListBucketInventoryConfigurations for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketInventoryConfigurations -func (c *S3) ListBucketInventoryConfigurations(input *ListBucketInventoryConfigurationsInput) (*ListBucketInventoryConfigurationsOutput, error) { - req, out := c.ListBucketInventoryConfigurationsRequest(input) - return out, req.Send() -} - -// ListBucketInventoryConfigurationsWithContext is the same as ListBucketInventoryConfigurations with the addition of -// the ability to pass a context and additional request options. -// -// See ListBucketInventoryConfigurations for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) ListBucketInventoryConfigurationsWithContext(ctx aws.Context, input *ListBucketInventoryConfigurationsInput, opts ...request.Option) (*ListBucketInventoryConfigurationsOutput, error) { - req, out := c.ListBucketInventoryConfigurationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListBucketMetricsConfigurations = "ListBucketMetricsConfigurations" - -// ListBucketMetricsConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the ListBucketMetricsConfigurations operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListBucketMetricsConfigurations for more information on using the ListBucketMetricsConfigurations -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListBucketMetricsConfigurationsRequest method. -// req, resp := client.ListBucketMetricsConfigurationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketMetricsConfigurations -func (c *S3) ListBucketMetricsConfigurationsRequest(input *ListBucketMetricsConfigurationsInput) (req *request.Request, output *ListBucketMetricsConfigurationsOutput) { - op := &request.Operation{ - Name: opListBucketMetricsConfigurations, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?metrics", - } - - if input == nil { - input = &ListBucketMetricsConfigurationsInput{} - } - - output = &ListBucketMetricsConfigurationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListBucketMetricsConfigurations API operation for Amazon Simple Storage Service. -// -// Lists the metrics configurations for the bucket. The metrics configurations -// are only for the request metrics of the bucket and do not provide information -// on daily storage metrics. You can have up to 1,000 configurations per bucket. -// -// This action supports list pagination and does not return more than 100 configurations -// at a time. Always check the IsTruncated element in the response. If there -// are no more configurations to list, IsTruncated is set to false. If there -// are more configurations to list, IsTruncated is set to true, and there is -// a value in NextContinuationToken. You use the NextContinuationToken value -// to continue the pagination of the list by passing the value in continuation-token -// in the request to GET the next page. -// -// To use this operation, you must have permissions to perform the s3:GetMetricsConfiguration -// action. The bucket owner has this permission by default. The bucket owner -// can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// For more information about metrics configurations and CloudWatch request -// metrics, see Monitoring Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html). -// -// The following operations are related to ListBucketMetricsConfigurations: -// -// - PutBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html) -// -// - GetBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html) -// -// - DeleteBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation ListBucketMetricsConfigurations for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBucketMetricsConfigurations -func (c *S3) ListBucketMetricsConfigurations(input *ListBucketMetricsConfigurationsInput) (*ListBucketMetricsConfigurationsOutput, error) { - req, out := c.ListBucketMetricsConfigurationsRequest(input) - return out, req.Send() -} - -// ListBucketMetricsConfigurationsWithContext is the same as ListBucketMetricsConfigurations with the addition of -// the ability to pass a context and additional request options. -// -// See ListBucketMetricsConfigurations for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) ListBucketMetricsConfigurationsWithContext(ctx aws.Context, input *ListBucketMetricsConfigurationsInput, opts ...request.Option) (*ListBucketMetricsConfigurationsOutput, error) { - req, out := c.ListBucketMetricsConfigurationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListBuckets = "ListBuckets" - -// ListBucketsRequest generates a "aws/request.Request" representing the -// client's request for the ListBuckets operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListBuckets for more information on using the ListBuckets -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListBucketsRequest method. -// req, resp := client.ListBucketsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBuckets -func (c *S3) ListBucketsRequest(input *ListBucketsInput) (req *request.Request, output *ListBucketsOutput) { - op := &request.Operation{ - Name: opListBuckets, - HTTPMethod: "GET", - HTTPPath: "/", - } - - if input == nil { - input = &ListBucketsInput{} - } - - output = &ListBucketsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListBuckets API operation for Amazon Simple Storage Service. -// -// Returns a list of all buckets owned by the authenticated sender of the request. -// To use this operation, you must have the s3:ListAllMyBuckets permission. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation ListBuckets for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListBuckets -func (c *S3) ListBuckets(input *ListBucketsInput) (*ListBucketsOutput, error) { - req, out := c.ListBucketsRequest(input) - return out, req.Send() -} - -// ListBucketsWithContext is the same as ListBuckets with the addition of -// the ability to pass a context and additional request options. -// -// See ListBuckets for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) ListBucketsWithContext(ctx aws.Context, input *ListBucketsInput, opts ...request.Option) (*ListBucketsOutput, error) { - req, out := c.ListBucketsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListMultipartUploads = "ListMultipartUploads" - -// ListMultipartUploadsRequest generates a "aws/request.Request" representing the -// client's request for the ListMultipartUploads operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListMultipartUploads for more information on using the ListMultipartUploads -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListMultipartUploadsRequest method. -// req, resp := client.ListMultipartUploadsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListMultipartUploads -func (c *S3) ListMultipartUploadsRequest(input *ListMultipartUploadsInput) (req *request.Request, output *ListMultipartUploadsOutput) { - op := &request.Operation{ - Name: opListMultipartUploads, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?uploads", - Paginator: &request.Paginator{ - InputTokens: []string{"KeyMarker", "UploadIdMarker"}, - OutputTokens: []string{"NextKeyMarker", "NextUploadIdMarker"}, - LimitToken: "MaxUploads", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListMultipartUploadsInput{} - } - - output = &ListMultipartUploadsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListMultipartUploads API operation for Amazon Simple Storage Service. -// -// This action lists in-progress multipart uploads. An in-progress multipart -// upload is a multipart upload that has been initiated using the Initiate Multipart -// Upload request, but has not yet been completed or aborted. -// -// This action returns at most 1,000 multipart uploads in the response. 1,000 -// multipart uploads is the maximum number of uploads a response can include, -// which is also the default value. You can further limit the number of uploads -// in a response by specifying the max-uploads parameter in the response. If -// additional multipart uploads satisfy the list criteria, the response will -// contain an IsTruncated element with the value true. To list the additional -// multipart uploads, use the key-marker and upload-id-marker request parameters. -// -// In the response, the uploads are sorted by key. If your application has initiated -// more than one multipart upload using the same object key, then uploads in -// the response are first sorted by key. Additionally, uploads are sorted in -// ascending order within each key by the upload initiation time. -// -// For more information on multipart uploads, see Uploading Objects Using Multipart -// Upload (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html). -// -// For information on permissions required to use the multipart upload API, -// see Multipart Upload and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). -// -// The following operations are related to ListMultipartUploads: -// -// - CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) -// -// - UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// -// - CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) -// -// - ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) -// -// - AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation ListMultipartUploads for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListMultipartUploads -func (c *S3) ListMultipartUploads(input *ListMultipartUploadsInput) (*ListMultipartUploadsOutput, error) { - req, out := c.ListMultipartUploadsRequest(input) - return out, req.Send() -} - -// ListMultipartUploadsWithContext is the same as ListMultipartUploads with the addition of -// the ability to pass a context and additional request options. -// -// See ListMultipartUploads for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) ListMultipartUploadsWithContext(ctx aws.Context, input *ListMultipartUploadsInput, opts ...request.Option) (*ListMultipartUploadsOutput, error) { - req, out := c.ListMultipartUploadsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListMultipartUploadsPages iterates over the pages of a ListMultipartUploads operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListMultipartUploads method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListMultipartUploads operation. -// pageNum := 0 -// err := client.ListMultipartUploadsPages(params, -// func(page *s3.ListMultipartUploadsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *S3) ListMultipartUploadsPages(input *ListMultipartUploadsInput, fn func(*ListMultipartUploadsOutput, bool) bool) error { - return c.ListMultipartUploadsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListMultipartUploadsPagesWithContext same as ListMultipartUploadsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) ListMultipartUploadsPagesWithContext(ctx aws.Context, input *ListMultipartUploadsInput, fn func(*ListMultipartUploadsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListMultipartUploadsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListMultipartUploadsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListMultipartUploadsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListObjectVersions = "ListObjectVersions" - -// ListObjectVersionsRequest generates a "aws/request.Request" representing the -// client's request for the ListObjectVersions operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListObjectVersions for more information on using the ListObjectVersions -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListObjectVersionsRequest method. -// req, resp := client.ListObjectVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectVersions -func (c *S3) ListObjectVersionsRequest(input *ListObjectVersionsInput) (req *request.Request, output *ListObjectVersionsOutput) { - op := &request.Operation{ - Name: opListObjectVersions, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?versions", - Paginator: &request.Paginator{ - InputTokens: []string{"KeyMarker", "VersionIdMarker"}, - OutputTokens: []string{"NextKeyMarker", "NextVersionIdMarker"}, - LimitToken: "MaxKeys", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListObjectVersionsInput{} - } - - output = &ListObjectVersionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListObjectVersions API operation for Amazon Simple Storage Service. -// -// Returns metadata about all versions of the objects in a bucket. You can also -// use request parameters as selection criteria to return metadata about a subset -// of all the object versions. -// -// To use this operation, you must have permissions to perform the s3:ListBucketVersions -// action. Be aware of the name difference. -// -// A 200 OK response can contain valid or invalid XML. Make sure to design your -// application to parse the contents of the response and handle it appropriately. -// -// To use this operation, you must have READ access to the bucket. -// -// This action is not supported by Amazon S3 on Outposts. -// -// The following operations are related to ListObjectVersions: -// -// - ListObjectsV2 (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html) -// -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// -// - PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) -// -// - DeleteObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation ListObjectVersions for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectVersions -func (c *S3) ListObjectVersions(input *ListObjectVersionsInput) (*ListObjectVersionsOutput, error) { - req, out := c.ListObjectVersionsRequest(input) - return out, req.Send() -} - -// ListObjectVersionsWithContext is the same as ListObjectVersions with the addition of -// the ability to pass a context and additional request options. -// -// See ListObjectVersions for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) ListObjectVersionsWithContext(ctx aws.Context, input *ListObjectVersionsInput, opts ...request.Option) (*ListObjectVersionsOutput, error) { - req, out := c.ListObjectVersionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListObjectVersionsPages iterates over the pages of a ListObjectVersions operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListObjectVersions method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListObjectVersions operation. -// pageNum := 0 -// err := client.ListObjectVersionsPages(params, -// func(page *s3.ListObjectVersionsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *S3) ListObjectVersionsPages(input *ListObjectVersionsInput, fn func(*ListObjectVersionsOutput, bool) bool) error { - return c.ListObjectVersionsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListObjectVersionsPagesWithContext same as ListObjectVersionsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) ListObjectVersionsPagesWithContext(ctx aws.Context, input *ListObjectVersionsInput, fn func(*ListObjectVersionsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListObjectVersionsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListObjectVersionsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListObjectVersionsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListObjects = "ListObjects" - -// ListObjectsRequest generates a "aws/request.Request" representing the -// client's request for the ListObjects operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListObjects for more information on using the ListObjects -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListObjectsRequest method. -// req, resp := client.ListObjectsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjects -func (c *S3) ListObjectsRequest(input *ListObjectsInput) (req *request.Request, output *ListObjectsOutput) { - op := &request.Operation{ - Name: opListObjects, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}", - Paginator: &request.Paginator{ - InputTokens: []string{"Marker"}, - OutputTokens: []string{"NextMarker || Contents[-1].Key"}, - LimitToken: "MaxKeys", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListObjectsInput{} - } - - output = &ListObjectsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListObjects API operation for Amazon Simple Storage Service. -// -// Returns some or all (up to 1,000) of the objects in a bucket. You can use -// the request parameters as selection criteria to return a subset of the objects -// in a bucket. A 200 OK response can contain valid or invalid XML. Be sure -// to design your application to parse the contents of the response and handle -// it appropriately. -// -// This action has been revised. We recommend that you use the newer version, -// ListObjectsV2 (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html), -// when developing applications. For backward compatibility, Amazon S3 continues -// to support ListObjects. -// -// The following operations are related to ListObjects: -// -// - ListObjectsV2 (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html) -// -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// -// - PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) -// -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// -// - ListBuckets (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation ListObjects for usage and error information. -// -// Returned Error Codes: -// - ErrCodeNoSuchBucket "NoSuchBucket" -// The specified bucket does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjects -func (c *S3) ListObjects(input *ListObjectsInput) (*ListObjectsOutput, error) { - req, out := c.ListObjectsRequest(input) - return out, req.Send() -} - -// ListObjectsWithContext is the same as ListObjects with the addition of -// the ability to pass a context and additional request options. -// -// See ListObjects for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) ListObjectsWithContext(ctx aws.Context, input *ListObjectsInput, opts ...request.Option) (*ListObjectsOutput, error) { - req, out := c.ListObjectsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListObjectsPages iterates over the pages of a ListObjects operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListObjects method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListObjects operation. -// pageNum := 0 -// err := client.ListObjectsPages(params, -// func(page *s3.ListObjectsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *S3) ListObjectsPages(input *ListObjectsInput, fn func(*ListObjectsOutput, bool) bool) error { - return c.ListObjectsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListObjectsPagesWithContext same as ListObjectsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) ListObjectsPagesWithContext(ctx aws.Context, input *ListObjectsInput, fn func(*ListObjectsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListObjectsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListObjectsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListObjectsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListObjectsV2 = "ListObjectsV2" - -// ListObjectsV2Request generates a "aws/request.Request" representing the -// client's request for the ListObjectsV2 operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListObjectsV2 for more information on using the ListObjectsV2 -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListObjectsV2Request method. -// req, resp := client.ListObjectsV2Request(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsV2 -func (c *S3) ListObjectsV2Request(input *ListObjectsV2Input) (req *request.Request, output *ListObjectsV2Output) { - op := &request.Operation{ - Name: opListObjectsV2, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}?list-type=2", - Paginator: &request.Paginator{ - InputTokens: []string{"ContinuationToken"}, - OutputTokens: []string{"NextContinuationToken"}, - LimitToken: "MaxKeys", - TruncationToken: "", - }, - } - - if input == nil { - input = &ListObjectsV2Input{} - } - - output = &ListObjectsV2Output{} - req = c.newRequest(op, input, output) - return -} - -// ListObjectsV2 API operation for Amazon Simple Storage Service. -// -// Returns some or all (up to 1,000) of the objects in a bucket with each request. -// You can use the request parameters as selection criteria to return a subset -// of the objects in a bucket. A 200 OK response can contain valid or invalid -// XML. Make sure to design your application to parse the contents of the response -// and handle it appropriately. Objects are returned sorted in an ascending -// order of the respective key names in the list. For more information about -// listing objects, see Listing object keys programmatically (https://docs.aws.amazon.com/AmazonS3/latest/userguide/ListingKeysUsingAPIs.html) -// -// To use this operation, you must have READ access to the bucket. -// -// To use this action in an Identity and Access Management (IAM) policy, you -// must have permissions to perform the s3:ListBucket action. The bucket owner -// has this permission by default and can grant this permission to others. For -// more information about permissions, see Permissions Related to Bucket Subresource -// Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// This section describes the latest revision of this action. We recommend that -// you use this revised API for application development. For backward compatibility, -// Amazon S3 continues to support the prior version of this API, ListObjects -// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html). -// -// To get a list of your buckets, see ListBuckets (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBuckets.html). -// -// The following operations are related to ListObjectsV2: -// -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// -// - PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) -// -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation ListObjectsV2 for usage and error information. -// -// Returned Error Codes: -// - ErrCodeNoSuchBucket "NoSuchBucket" -// The specified bucket does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListObjectsV2 -func (c *S3) ListObjectsV2(input *ListObjectsV2Input) (*ListObjectsV2Output, error) { - req, out := c.ListObjectsV2Request(input) - return out, req.Send() -} - -// ListObjectsV2WithContext is the same as ListObjectsV2 with the addition of -// the ability to pass a context and additional request options. -// -// See ListObjectsV2 for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) ListObjectsV2WithContext(ctx aws.Context, input *ListObjectsV2Input, opts ...request.Option) (*ListObjectsV2Output, error) { - req, out := c.ListObjectsV2Request(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListObjectsV2Pages iterates over the pages of a ListObjectsV2 operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListObjectsV2 method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListObjectsV2 operation. -// pageNum := 0 -// err := client.ListObjectsV2Pages(params, -// func(page *s3.ListObjectsV2Output, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *S3) ListObjectsV2Pages(input *ListObjectsV2Input, fn func(*ListObjectsV2Output, bool) bool) error { - return c.ListObjectsV2PagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListObjectsV2PagesWithContext same as ListObjectsV2Pages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) ListObjectsV2PagesWithContext(ctx aws.Context, input *ListObjectsV2Input, fn func(*ListObjectsV2Output, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListObjectsV2Input - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListObjectsV2Request(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListObjectsV2Output), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opListParts = "ListParts" - -// ListPartsRequest generates a "aws/request.Request" representing the -// client's request for the ListParts operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListParts for more information on using the ListParts -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListPartsRequest method. -// req, resp := client.ListPartsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListParts -func (c *S3) ListPartsRequest(input *ListPartsInput) (req *request.Request, output *ListPartsOutput) { - op := &request.Operation{ - Name: opListParts, - HTTPMethod: "GET", - HTTPPath: "/{Bucket}/{Key+}", - Paginator: &request.Paginator{ - InputTokens: []string{"PartNumberMarker"}, - OutputTokens: []string{"NextPartNumberMarker"}, - LimitToken: "MaxParts", - TruncationToken: "IsTruncated", - }, - } - - if input == nil { - input = &ListPartsInput{} - } - - output = &ListPartsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListParts API operation for Amazon Simple Storage Service. -// -// Lists the parts that have been uploaded for a specific multipart upload. -// This operation must include the upload ID, which you obtain by sending the -// initiate multipart upload request (see CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html)). -// This request returns a maximum of 1,000 uploaded parts. The default number -// of parts returned is 1,000 parts. You can restrict the number of parts returned -// by specifying the max-parts request parameter. If your multipart upload consists -// of more than 1,000 parts, the response returns an IsTruncated field with -// the value of true, and a NextPartNumberMarker element. In subsequent ListParts -// requests you can include the part-number-marker query string parameter and -// set its value to the NextPartNumberMarker field value from the previous response. -// -// If the upload was created using a checksum algorithm, you will need to have -// permission to the kms:Decrypt action for the request to succeed. -// -// For more information on multipart uploads, see Uploading Objects Using Multipart -// Upload (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html). -// -// For information on permissions required to use the multipart upload API, -// see Multipart Upload and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html). -// -// The following operations are related to ListParts: -// -// - CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) -// -// - UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// -// - CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) -// -// - AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) -// -// - GetObjectAttributes (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html) -// -// - ListMultipartUploads (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation ListParts for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/ListParts -func (c *S3) ListParts(input *ListPartsInput) (*ListPartsOutput, error) { - req, out := c.ListPartsRequest(input) - return out, req.Send() -} - -// ListPartsWithContext is the same as ListParts with the addition of -// the ability to pass a context and additional request options. -// -// See ListParts for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) ListPartsWithContext(ctx aws.Context, input *ListPartsInput, opts ...request.Option) (*ListPartsOutput, error) { - req, out := c.ListPartsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// ListPartsPages iterates over the pages of a ListParts operation, -// calling the "fn" function with the response data for each page. To stop -// iterating, return false from the fn function. -// -// See ListParts method for more information on how to use this operation. -// -// Note: This operation can generate multiple requests to a service. -// -// // Example iterating over at most 3 pages of a ListParts operation. -// pageNum := 0 -// err := client.ListPartsPages(params, -// func(page *s3.ListPartsOutput, lastPage bool) bool { -// pageNum++ -// fmt.Println(page) -// return pageNum <= 3 -// }) -func (c *S3) ListPartsPages(input *ListPartsInput, fn func(*ListPartsOutput, bool) bool) error { - return c.ListPartsPagesWithContext(aws.BackgroundContext(), input, fn) -} - -// ListPartsPagesWithContext same as ListPartsPages except -// it takes a Context and allows setting request options on the pages. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) ListPartsPagesWithContext(ctx aws.Context, input *ListPartsInput, fn func(*ListPartsOutput, bool) bool, opts ...request.Option) error { - p := request.Pagination{ - NewRequest: func() (*request.Request, error) { - var inCpy *ListPartsInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.ListPartsRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - - for p.Next() { - if !fn(p.Page().(*ListPartsOutput), !p.HasNextPage()) { - break - } - } - - return p.Err() -} - -const opPutBucketAccelerateConfiguration = "PutBucketAccelerateConfiguration" - -// PutBucketAccelerateConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketAccelerateConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutBucketAccelerateConfiguration for more information on using the PutBucketAccelerateConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutBucketAccelerateConfigurationRequest method. -// req, resp := client.PutBucketAccelerateConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAccelerateConfiguration -func (c *S3) PutBucketAccelerateConfigurationRequest(input *PutBucketAccelerateConfigurationInput) (req *request.Request, output *PutBucketAccelerateConfigurationOutput) { - op := &request.Operation{ - Name: opPutBucketAccelerateConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?accelerate", - } - - if input == nil { - input = &PutBucketAccelerateConfigurationInput{} - } - - output = &PutBucketAccelerateConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketAccelerateConfiguration API operation for Amazon Simple Storage Service. -// -// Sets the accelerate configuration of an existing bucket. Amazon S3 Transfer -// Acceleration is a bucket-level feature that enables you to perform faster -// data transfers to Amazon S3. -// -// To use this operation, you must have permission to perform the s3:PutAccelerateConfiguration -// action. The bucket owner has this permission by default. The bucket owner -// can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// The Transfer Acceleration state of a bucket can be set to one of the following -// two values: -// -// - Enabled – Enables accelerated data transfers to the bucket. -// -// - Suspended – Disables accelerated data transfers to the bucket. -// -// The GetBucketAccelerateConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAccelerateConfiguration.html) -// action returns the transfer acceleration state of a bucket. -// -// After setting the Transfer Acceleration state of a bucket to Enabled, it -// might take up to thirty minutes before the data transfer rates to the bucket -// increase. -// -// The name of the bucket used for Transfer Acceleration must be DNS-compliant -// and must not contain periods ("."). -// -// For more information about transfer acceleration, see Transfer Acceleration -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html). -// -// The following operations are related to PutBucketAccelerateConfiguration: -// -// - GetBucketAccelerateConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAccelerateConfiguration.html) -// -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutBucketAccelerateConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAccelerateConfiguration -func (c *S3) PutBucketAccelerateConfiguration(input *PutBucketAccelerateConfigurationInput) (*PutBucketAccelerateConfigurationOutput, error) { - req, out := c.PutBucketAccelerateConfigurationRequest(input) - return out, req.Send() -} - -// PutBucketAccelerateConfigurationWithContext is the same as PutBucketAccelerateConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketAccelerateConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutBucketAccelerateConfigurationWithContext(ctx aws.Context, input *PutBucketAccelerateConfigurationInput, opts ...request.Option) (*PutBucketAccelerateConfigurationOutput, error) { - req, out := c.PutBucketAccelerateConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketAcl = "PutBucketAcl" - -// PutBucketAclRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketAcl operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutBucketAcl for more information on using the PutBucketAcl -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutBucketAclRequest method. -// req, resp := client.PutBucketAclRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAcl -func (c *S3) PutBucketAclRequest(input *PutBucketAclInput) (req *request.Request, output *PutBucketAclOutput) { - op := &request.Operation{ - Name: opPutBucketAcl, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?acl", - } - - if input == nil { - input = &PutBucketAclInput{} - } - - output = &PutBucketAclOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// PutBucketAcl API operation for Amazon Simple Storage Service. -// -// Sets the permissions on an existing bucket using access control lists (ACL). -// For more information, see Using ACLs (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html). -// To set the ACL of a bucket, you must have WRITE_ACP permission. -// -// You can use one of the following two ways to set a bucket's permissions: -// -// - Specify the ACL in the request body -// -// - Specify permissions using request headers -// -// You cannot specify access permission using both the body and the request -// headers. -// -// Depending on your application needs, you may choose to set the ACL on a bucket -// using either the request body or the headers. For example, if you have an -// existing application that updates a bucket ACL using the request body, then -// you can continue to use that approach. -// -// If your bucket uses the bucket owner enforced setting for S3 Object Ownership, -// ACLs are disabled and no longer affect permissions. You must use policies -// to grant access to your bucket and the objects in it. Requests to set ACLs -// or update ACLs fail and return the AccessControlListNotSupported error code. -// Requests to read ACLs are still supported. For more information, see Controlling -// object ownership (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) -// in the Amazon S3 User Guide. -// -// # Access Permissions -// -// You can set access permissions using one of the following methods: -// -// - Specify a canned ACL with the x-amz-acl request header. Amazon S3 supports -// a set of predefined ACLs, known as canned ACLs. Each canned ACL has a -// predefined set of grantees and permissions. Specify the canned ACL name -// as the value of x-amz-acl. If you use this header, you cannot use other -// access control-specific headers in your request. For more information, -// see Canned ACL (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL). -// -// - Specify access permissions explicitly with the x-amz-grant-read, x-amz-grant-read-acp, -// x-amz-grant-write-acp, and x-amz-grant-full-control headers. When using -// these headers, you specify explicit access permissions and grantees (Amazon -// Web Services accounts or Amazon S3 groups) who will receive the permission. -// If you use these ACL-specific headers, you cannot use the x-amz-acl header -// to set a canned ACL. These parameters map to the set of permissions that -// Amazon S3 supports in an ACL. For more information, see Access Control -// List (ACL) Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html). -// You specify each grantee as a type=value pair, where the type is one of -// the following: id – if the value specified is the canonical user ID -// of an Amazon Web Services account uri – if you are granting permissions -// to a predefined group emailAddress – if the value specified is the email -// address of an Amazon Web Services account Using email addresses to specify -// a grantee is only supported in the following Amazon Web Services Regions: -// US East (N. Virginia) US West (N. California) US West (Oregon) Asia Pacific -// (Singapore) Asia Pacific (Sydney) Asia Pacific (Tokyo) Europe (Ireland) -// South America (São Paulo) For a list of all the Amazon S3 supported Regions -// and endpoints, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) -// in the Amazon Web Services General Reference. For example, the following -// x-amz-grant-write header grants create, overwrite, and delete objects -// permission to LogDelivery group predefined by Amazon S3 and two Amazon -// Web Services accounts identified by their email addresses. x-amz-grant-write: -// uri="http://acs.amazonaws.com/groups/s3/LogDelivery", id="111122223333", -// id="555566667777" -// -// You can use either a canned ACL or specify access permissions explicitly. -// You cannot do both. -// -// # Grantee Values -// -// You can specify the person (grantee) to whom you're assigning access rights -// (using request elements) in the following ways: -// -// - By the person's ID: <>ID<><>GranteesEmail<> -// DisplayName is optional and ignored in the request -// -// - By URI: <>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<> -// -// - By Email address: <>Grantees@email.com<>lt;/Grantee> -// The grantee is resolved to the CanonicalUser and, in a response to a GET -// Object acl request, appears as the CanonicalUser. Using email addresses -// to specify a grantee is only supported in the following Amazon Web Services -// Regions: US East (N. Virginia) US West (N. California) US West (Oregon) -// Asia Pacific (Singapore) Asia Pacific (Sydney) Asia Pacific (Tokyo) Europe -// (Ireland) South America (São Paulo) For a list of all the Amazon S3 supported -// Regions and endpoints, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) -// in the Amazon Web Services General Reference. -// -// Related Resources -// -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// -// - DeleteBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html) -// -// - GetObjectAcl (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutBucketAcl for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAcl -func (c *S3) PutBucketAcl(input *PutBucketAclInput) (*PutBucketAclOutput, error) { - req, out := c.PutBucketAclRequest(input) - return out, req.Send() -} - -// PutBucketAclWithContext is the same as PutBucketAcl with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketAcl for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutBucketAclWithContext(ctx aws.Context, input *PutBucketAclInput, opts ...request.Option) (*PutBucketAclOutput, error) { - req, out := c.PutBucketAclRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketAnalyticsConfiguration = "PutBucketAnalyticsConfiguration" - -// PutBucketAnalyticsConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketAnalyticsConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutBucketAnalyticsConfiguration for more information on using the PutBucketAnalyticsConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutBucketAnalyticsConfigurationRequest method. -// req, resp := client.PutBucketAnalyticsConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAnalyticsConfiguration -func (c *S3) PutBucketAnalyticsConfigurationRequest(input *PutBucketAnalyticsConfigurationInput) (req *request.Request, output *PutBucketAnalyticsConfigurationOutput) { - op := &request.Operation{ - Name: opPutBucketAnalyticsConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?analytics", - } - - if input == nil { - input = &PutBucketAnalyticsConfigurationInput{} - } - - output = &PutBucketAnalyticsConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketAnalyticsConfiguration API operation for Amazon Simple Storage Service. -// -// Sets an analytics configuration for the bucket (specified by the analytics -// configuration ID). You can have up to 1,000 analytics configurations per -// bucket. -// -// You can choose to have storage class analysis export analysis reports sent -// to a comma-separated values (CSV) flat file. See the DataExport request element. -// Reports are updated daily and are based on the object filters that you configure. -// When selecting data export, you specify a destination bucket and an optional -// destination prefix where the file is written. You can export the data to -// a destination bucket in a different account. However, the destination bucket -// must be in the same Region as the bucket that you are making the PUT analytics -// configuration to. For more information, see Amazon S3 Analytics – Storage -// Class Analysis (https://docs.aws.amazon.com/AmazonS3/latest/dev/analytics-storage-class.html). -// -// You must create a bucket policy on the destination bucket where the exported -// file is written to grant permissions to Amazon S3 to write objects to the -// bucket. For an example policy, see Granting Permissions for Amazon S3 Inventory -// and Storage Class Analysis (https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html#example-bucket-policies-use-case-9). -// -// To use this operation, you must have permissions to perform the s3:PutAnalyticsConfiguration -// action. The bucket owner has this permission by default. The bucket owner -// can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// Special Errors -// -// - HTTP Error: HTTP 400 Bad Request Code: InvalidArgument Cause: Invalid -// argument. -// -// - HTTP Error: HTTP 400 Bad Request Code: TooManyConfigurations Cause: -// You are attempting to create a new configuration but have already reached -// the 1,000-configuration limit. -// -// - HTTP Error: HTTP 403 Forbidden Code: AccessDenied Cause: You are not -// the owner of the specified bucket, or you do not have the s3:PutAnalyticsConfiguration -// bucket permission to set the configuration on the bucket. -// -// Related Resources -// -// - GetBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketAnalyticsConfiguration.html) -// -// - DeleteBucketAnalyticsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketAnalyticsConfiguration.html) -// -// - ListBucketAnalyticsConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketAnalyticsConfigurations.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutBucketAnalyticsConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketAnalyticsConfiguration -func (c *S3) PutBucketAnalyticsConfiguration(input *PutBucketAnalyticsConfigurationInput) (*PutBucketAnalyticsConfigurationOutput, error) { - req, out := c.PutBucketAnalyticsConfigurationRequest(input) - return out, req.Send() -} - -// PutBucketAnalyticsConfigurationWithContext is the same as PutBucketAnalyticsConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketAnalyticsConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutBucketAnalyticsConfigurationWithContext(ctx aws.Context, input *PutBucketAnalyticsConfigurationInput, opts ...request.Option) (*PutBucketAnalyticsConfigurationOutput, error) { - req, out := c.PutBucketAnalyticsConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketCors = "PutBucketCors" - -// PutBucketCorsRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketCors operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutBucketCors for more information on using the PutBucketCors -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutBucketCorsRequest method. -// req, resp := client.PutBucketCorsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketCors -func (c *S3) PutBucketCorsRequest(input *PutBucketCorsInput) (req *request.Request, output *PutBucketCorsOutput) { - op := &request.Operation{ - Name: opPutBucketCors, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?cors", - } - - if input == nil { - input = &PutBucketCorsInput{} - } - - output = &PutBucketCorsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// PutBucketCors API operation for Amazon Simple Storage Service. -// -// Sets the cors configuration for your bucket. If the configuration exists, -// Amazon S3 replaces it. -// -// To use this operation, you must be allowed to perform the s3:PutBucketCORS -// action. By default, the bucket owner has this permission and can grant it -// to others. -// -// You set this configuration on a bucket so that the bucket can service cross-origin -// requests. For example, you might want to enable a request whose origin is -// http://www.example.com to access your Amazon S3 bucket at my.example.bucket.com -// by using the browser's XMLHttpRequest capability. -// -// To enable cross-origin resource sharing (CORS) on a bucket, you add the cors -// subresource to the bucket. The cors subresource is an XML document in which -// you configure rules that identify origins and the HTTP methods that can be -// executed on your bucket. The document is limited to 64 KB in size. -// -// When Amazon S3 receives a cross-origin request (or a pre-flight OPTIONS request) -// against a bucket, it evaluates the cors configuration on the bucket and uses -// the first CORSRule rule that matches the incoming browser request to enable -// a cross-origin request. For a rule to match, the following conditions must -// be met: -// -// - The request's Origin header must match AllowedOrigin elements. -// -// - The request method (for example, GET, PUT, HEAD, and so on) or the Access-Control-Request-Method -// header in case of a pre-flight OPTIONS request must be one of the AllowedMethod -// elements. -// -// - Every header specified in the Access-Control-Request-Headers request -// header of a pre-flight request must match an AllowedHeader element. -// -// For more information about CORS, go to Enabling Cross-Origin Resource Sharing -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) in the Amazon -// S3 User Guide. -// -// Related Resources -// -// - GetBucketCors (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketCors.html) -// -// - DeleteBucketCors (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketCors.html) -// -// - RESTOPTIONSobject (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTOPTIONSobject.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutBucketCors for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketCors -func (c *S3) PutBucketCors(input *PutBucketCorsInput) (*PutBucketCorsOutput, error) { - req, out := c.PutBucketCorsRequest(input) - return out, req.Send() -} - -// PutBucketCorsWithContext is the same as PutBucketCors with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketCors for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutBucketCorsWithContext(ctx aws.Context, input *PutBucketCorsInput, opts ...request.Option) (*PutBucketCorsOutput, error) { - req, out := c.PutBucketCorsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketEncryption = "PutBucketEncryption" - -// PutBucketEncryptionRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketEncryption operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutBucketEncryption for more information on using the PutBucketEncryption -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutBucketEncryptionRequest method. -// req, resp := client.PutBucketEncryptionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketEncryption -func (c *S3) PutBucketEncryptionRequest(input *PutBucketEncryptionInput) (req *request.Request, output *PutBucketEncryptionOutput) { - op := &request.Operation{ - Name: opPutBucketEncryption, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?encryption", - } - - if input == nil { - input = &PutBucketEncryptionInput{} - } - - output = &PutBucketEncryptionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// PutBucketEncryption API operation for Amazon Simple Storage Service. -// -// This action uses the encryption subresource to configure default encryption -// and Amazon S3 Bucket Key for an existing bucket. -// -// Default encryption for a bucket can use server-side encryption with Amazon -// S3-managed keys (SSE-S3) or customer managed keys (SSE-KMS). If you specify -// default encryption using SSE-KMS, you can also configure Amazon S3 Bucket -// Key. When the default encryption is SSE-KMS, if you upload an object to the -// bucket and do not specify the KMS key to use for encryption, Amazon S3 uses -// the default Amazon Web Services managed KMS key for your account. For information -// about default encryption, see Amazon S3 default bucket encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) -// in the Amazon S3 User Guide. For more information about S3 Bucket Keys, see -// Amazon S3 Bucket Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) -// in the Amazon S3 User Guide. -// -// This action requires Amazon Web Services Signature Version 4. For more information, -// see Authenticating Requests (Amazon Web Services Signature Version 4) (https://docs.aws.amazon.com/AmazonS3/latest/API/sig-v4-authenticating-requests.html). -// -// To use this operation, you must have permissions to perform the s3:PutEncryptionConfiguration -// action. The bucket owner has this permission by default. The bucket owner -// can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// in the Amazon S3 User Guide. -// -// Related Resources -// -// - GetBucketEncryption (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketEncryption.html) -// -// - DeleteBucketEncryption (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketEncryption.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutBucketEncryption for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketEncryption -func (c *S3) PutBucketEncryption(input *PutBucketEncryptionInput) (*PutBucketEncryptionOutput, error) { - req, out := c.PutBucketEncryptionRequest(input) - return out, req.Send() -} - -// PutBucketEncryptionWithContext is the same as PutBucketEncryption with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketEncryption for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutBucketEncryptionWithContext(ctx aws.Context, input *PutBucketEncryptionInput, opts ...request.Option) (*PutBucketEncryptionOutput, error) { - req, out := c.PutBucketEncryptionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketIntelligentTieringConfiguration = "PutBucketIntelligentTieringConfiguration" - -// PutBucketIntelligentTieringConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketIntelligentTieringConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutBucketIntelligentTieringConfiguration for more information on using the PutBucketIntelligentTieringConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutBucketIntelligentTieringConfigurationRequest method. -// req, resp := client.PutBucketIntelligentTieringConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketIntelligentTieringConfiguration -func (c *S3) PutBucketIntelligentTieringConfigurationRequest(input *PutBucketIntelligentTieringConfigurationInput) (req *request.Request, output *PutBucketIntelligentTieringConfigurationOutput) { - op := &request.Operation{ - Name: opPutBucketIntelligentTieringConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?intelligent-tiering", - } - - if input == nil { - input = &PutBucketIntelligentTieringConfigurationInput{} - } - - output = &PutBucketIntelligentTieringConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketIntelligentTieringConfiguration API operation for Amazon Simple Storage Service. -// -// Puts a S3 Intelligent-Tiering configuration to the specified bucket. You -// can have up to 1,000 S3 Intelligent-Tiering configurations per bucket. -// -// The S3 Intelligent-Tiering storage class is designed to optimize storage -// costs by automatically moving data to the most cost-effective storage access -// tier, without performance impact or operational overhead. S3 Intelligent-Tiering -// delivers automatic cost savings in three low latency and high throughput -// access tiers. To get the lowest storage cost on data that can be accessed -// in minutes to hours, you can choose to activate additional archiving capabilities. -// -// The S3 Intelligent-Tiering storage class is the ideal storage class for data -// with unknown, changing, or unpredictable access patterns, independent of -// object size or retention period. If the size of an object is less than 128 -// KB, it is not monitored and not eligible for auto-tiering. Smaller objects -// can be stored, but they are always charged at the Frequent Access tier rates -// in the S3 Intelligent-Tiering storage class. -// -// For more information, see Storage class for automatically optimizing frequently -// and infrequently accessed objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access). -// -// Operations related to PutBucketIntelligentTieringConfiguration include: -// -// - DeleteBucketIntelligentTieringConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketIntelligentTieringConfiguration.html) -// -// - GetBucketIntelligentTieringConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketIntelligentTieringConfiguration.html) -// -// - ListBucketIntelligentTieringConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketIntelligentTieringConfigurations.html) -// -// You only need S3 Intelligent-Tiering enabled on a bucket if you want to automatically -// move objects stored in the S3 Intelligent-Tiering storage class to the Archive -// Access or Deep Archive Access tier. -// -// Special Errors -// -// - HTTP 400 Bad Request Error Code: InvalidArgument Cause: Invalid Argument -// -// - HTTP 400 Bad Request Error Code: TooManyConfigurations Cause: You are -// attempting to create a new configuration but have already reached the -// 1,000-configuration limit. -// -// - HTTP 403 Forbidden Error Code: AccessDenied Cause: You are not the owner -// of the specified bucket, or you do not have the s3:PutIntelligentTieringConfiguration -// bucket permission to set the configuration on the bucket. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutBucketIntelligentTieringConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketIntelligentTieringConfiguration -func (c *S3) PutBucketIntelligentTieringConfiguration(input *PutBucketIntelligentTieringConfigurationInput) (*PutBucketIntelligentTieringConfigurationOutput, error) { - req, out := c.PutBucketIntelligentTieringConfigurationRequest(input) - return out, req.Send() -} - -// PutBucketIntelligentTieringConfigurationWithContext is the same as PutBucketIntelligentTieringConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketIntelligentTieringConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutBucketIntelligentTieringConfigurationWithContext(ctx aws.Context, input *PutBucketIntelligentTieringConfigurationInput, opts ...request.Option) (*PutBucketIntelligentTieringConfigurationOutput, error) { - req, out := c.PutBucketIntelligentTieringConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketInventoryConfiguration = "PutBucketInventoryConfiguration" - -// PutBucketInventoryConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketInventoryConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutBucketInventoryConfiguration for more information on using the PutBucketInventoryConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutBucketInventoryConfigurationRequest method. -// req, resp := client.PutBucketInventoryConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketInventoryConfiguration -func (c *S3) PutBucketInventoryConfigurationRequest(input *PutBucketInventoryConfigurationInput) (req *request.Request, output *PutBucketInventoryConfigurationOutput) { - op := &request.Operation{ - Name: opPutBucketInventoryConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?inventory", - } - - if input == nil { - input = &PutBucketInventoryConfigurationInput{} - } - - output = &PutBucketInventoryConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketInventoryConfiguration API operation for Amazon Simple Storage Service. -// -// This implementation of the PUT action adds an inventory configuration (identified -// by the inventory ID) to the bucket. You can have up to 1,000 inventory configurations -// per bucket. -// -// Amazon S3 inventory generates inventories of the objects in the bucket on -// a daily or weekly basis, and the results are published to a flat file. The -// bucket that is inventoried is called the source bucket, and the bucket where -// the inventory flat file is stored is called the destination bucket. The destination -// bucket must be in the same Amazon Web Services Region as the source bucket. -// -// When you configure an inventory for a source bucket, you specify the destination -// bucket where you want the inventory to be stored, and whether to generate -// the inventory daily or weekly. You can also configure what object metadata -// to include and whether to inventory all object versions or only current versions. -// For more information, see Amazon S3 Inventory (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-inventory.html) -// in the Amazon S3 User Guide. -// -// You must create a bucket policy on the destination bucket to grant permissions -// to Amazon S3 to write objects to the bucket in the defined location. For -// an example policy, see Granting Permissions for Amazon S3 Inventory and Storage -// Class Analysis (https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html#example-bucket-policies-use-case-9). -// -// To use this operation, you must have permissions to perform the s3:PutInventoryConfiguration -// action. The bucket owner has this permission by default and can grant this -// permission to others. For more information about permissions, see Permissions -// Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// in the Amazon S3 User Guide. -// -// Special Errors -// -// - HTTP 400 Bad Request Error Code: InvalidArgument Cause: Invalid Argument -// -// - HTTP 400 Bad Request Error Code: TooManyConfigurations Cause: You are -// attempting to create a new configuration but have already reached the -// 1,000-configuration limit. -// -// - HTTP 403 Forbidden Error Code: AccessDenied Cause: You are not the owner -// of the specified bucket, or you do not have the s3:PutInventoryConfiguration -// bucket permission to set the configuration on the bucket. -// -// Related Resources -// -// - GetBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketInventoryConfiguration.html) -// -// - DeleteBucketInventoryConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketInventoryConfiguration.html) -// -// - ListBucketInventoryConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketInventoryConfigurations.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutBucketInventoryConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketInventoryConfiguration -func (c *S3) PutBucketInventoryConfiguration(input *PutBucketInventoryConfigurationInput) (*PutBucketInventoryConfigurationOutput, error) { - req, out := c.PutBucketInventoryConfigurationRequest(input) - return out, req.Send() -} - -// PutBucketInventoryConfigurationWithContext is the same as PutBucketInventoryConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketInventoryConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutBucketInventoryConfigurationWithContext(ctx aws.Context, input *PutBucketInventoryConfigurationInput, opts ...request.Option) (*PutBucketInventoryConfigurationOutput, error) { - req, out := c.PutBucketInventoryConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketLifecycle = "PutBucketLifecycle" - -// PutBucketLifecycleRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketLifecycle operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutBucketLifecycle for more information on using the PutBucketLifecycle -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutBucketLifecycleRequest method. -// req, resp := client.PutBucketLifecycleRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycle -// -// Deprecated: PutBucketLifecycle has been deprecated -func (c *S3) PutBucketLifecycleRequest(input *PutBucketLifecycleInput) (req *request.Request, output *PutBucketLifecycleOutput) { - if c.Client.Config.Logger != nil { - c.Client.Config.Logger.Log("This operation, PutBucketLifecycle, has been deprecated") - } - op := &request.Operation{ - Name: opPutBucketLifecycle, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?lifecycle", - } - - if input == nil { - input = &PutBucketLifecycleInput{} - } - - output = &PutBucketLifecycleOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// PutBucketLifecycle API operation for Amazon Simple Storage Service. -// -// For an updated version of this API, see PutBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html). -// This version has been deprecated. Existing lifecycle configurations will -// work. For new lifecycle configurations, use the updated API. -// -// Creates a new lifecycle configuration for the bucket or replaces an existing -// lifecycle configuration. For information about lifecycle configuration, see -// Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) -// in the Amazon S3 User Guide. -// -// By default, all Amazon S3 resources, including buckets, objects, and related -// subresources (for example, lifecycle configuration and website configuration) -// are private. Only the resource owner, the Amazon Web Services account that -// created the resource, can access it. The resource owner can optionally grant -// access permissions to others by writing an access policy. For this operation, -// users must get the s3:PutLifecycleConfiguration permission. -// -// You can also explicitly deny permissions. Explicit denial also supersedes -// any other permissions. If you want to prevent users or accounts from removing -// or deleting objects from your bucket, you must deny them permissions for -// the following actions: -// -// - s3:DeleteObject -// -// - s3:DeleteObjectVersion -// -// - s3:PutLifecycleConfiguration -// -// For more information about permissions, see Managing Access Permissions to -// your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// in the Amazon S3 User Guide. -// -// For more examples of transitioning objects to storage classes such as STANDARD_IA -// or ONEZONE_IA, see Examples of Lifecycle Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#lifecycle-configuration-examples). -// -// Related Resources -// -// - GetBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html)(Deprecated) -// -// - GetBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html) -// -// - RestoreObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html) -// -// - By default, a resource owner—in this case, a bucket owner, which is -// the Amazon Web Services account that created the bucket—can perform -// any of the operations. A resource owner can also grant others permission -// to perform the operation. For more information, see the following topics -// in the Amazon S3 User Guide: Specifying Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html) -// Managing Access Permissions to your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutBucketLifecycle for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycle -// -// Deprecated: PutBucketLifecycle has been deprecated -func (c *S3) PutBucketLifecycle(input *PutBucketLifecycleInput) (*PutBucketLifecycleOutput, error) { - req, out := c.PutBucketLifecycleRequest(input) - return out, req.Send() -} - -// PutBucketLifecycleWithContext is the same as PutBucketLifecycle with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketLifecycle for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -// -// Deprecated: PutBucketLifecycleWithContext has been deprecated -func (c *S3) PutBucketLifecycleWithContext(ctx aws.Context, input *PutBucketLifecycleInput, opts ...request.Option) (*PutBucketLifecycleOutput, error) { - req, out := c.PutBucketLifecycleRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketLifecycleConfiguration = "PutBucketLifecycleConfiguration" - -// PutBucketLifecycleConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketLifecycleConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutBucketLifecycleConfiguration for more information on using the PutBucketLifecycleConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutBucketLifecycleConfigurationRequest method. -// req, resp := client.PutBucketLifecycleConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycleConfiguration -func (c *S3) PutBucketLifecycleConfigurationRequest(input *PutBucketLifecycleConfigurationInput) (req *request.Request, output *PutBucketLifecycleConfigurationOutput) { - op := &request.Operation{ - Name: opPutBucketLifecycleConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?lifecycle", - } - - if input == nil { - input = &PutBucketLifecycleConfigurationInput{} - } - - output = &PutBucketLifecycleConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// PutBucketLifecycleConfiguration API operation for Amazon Simple Storage Service. -// -// Creates a new lifecycle configuration for the bucket or replaces an existing -// lifecycle configuration. Keep in mind that this will overwrite an existing -// lifecycle configuration, so if you want to retain any configuration details, -// they must be included in the new lifecycle configuration. For information -// about lifecycle configuration, see Managing your storage lifecycle (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html). -// -// Bucket lifecycle configuration now supports specifying a lifecycle rule using -// an object key name prefix, one or more object tags, or a combination of both. -// Accordingly, this section describes the latest API. The previous version -// of the API supported filtering based only on an object key name prefix, which -// is supported for backward compatibility. For the related API description, -// see PutBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html). -// -// # Rules -// -// You specify the lifecycle configuration in your request body. The lifecycle -// configuration is specified as XML consisting of one or more rules. An Amazon -// S3 Lifecycle configuration can have up to 1,000 rules. This limit is not -// adjustable. Each rule consists of the following: -// -// - Filter identifying a subset of objects to which the rule applies. The -// filter can be based on a key name prefix, object tags, or a combination -// of both. -// -// - Status whether the rule is in effect. -// -// - One or more lifecycle transition and expiration actions that you want -// Amazon S3 to perform on the objects identified by the filter. If the state -// of your bucket is versioning-enabled or versioning-suspended, you can -// have many versions of the same object (one current version and zero or -// more noncurrent versions). Amazon S3 provides predefined actions that -// you can specify for current and noncurrent object versions. -// -// For more information, see Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) -// and Lifecycle Configuration Elements (https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html). -// -// # Permissions -// -// By default, all Amazon S3 resources are private, including buckets, objects, -// and related subresources (for example, lifecycle configuration and website -// configuration). Only the resource owner (that is, the Amazon Web Services -// account that created it) can access the resource. The resource owner can -// optionally grant access permissions to others by writing an access policy. -// For this operation, a user must get the s3:PutLifecycleConfiguration permission. -// -// You can also explicitly deny permissions. Explicit deny also supersedes any -// other permissions. If you want to block users or accounts from removing or -// deleting objects from your bucket, you must deny them permissions for the -// following actions: -// -// - s3:DeleteObject -// -// - s3:DeleteObjectVersion -// -// - s3:PutLifecycleConfiguration -// -// For more information about permissions, see Managing Access Permissions to -// Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// The following are related to PutBucketLifecycleConfiguration: -// -// - Examples of Lifecycle Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-configuration-examples.html) -// -// - GetBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html) -// -// - DeleteBucketLifecycle (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutBucketLifecycleConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLifecycleConfiguration -func (c *S3) PutBucketLifecycleConfiguration(input *PutBucketLifecycleConfigurationInput) (*PutBucketLifecycleConfigurationOutput, error) { - req, out := c.PutBucketLifecycleConfigurationRequest(input) - return out, req.Send() -} - -// PutBucketLifecycleConfigurationWithContext is the same as PutBucketLifecycleConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketLifecycleConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutBucketLifecycleConfigurationWithContext(ctx aws.Context, input *PutBucketLifecycleConfigurationInput, opts ...request.Option) (*PutBucketLifecycleConfigurationOutput, error) { - req, out := c.PutBucketLifecycleConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketLogging = "PutBucketLogging" - -// PutBucketLoggingRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketLogging operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutBucketLogging for more information on using the PutBucketLogging -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutBucketLoggingRequest method. -// req, resp := client.PutBucketLoggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLogging -func (c *S3) PutBucketLoggingRequest(input *PutBucketLoggingInput) (req *request.Request, output *PutBucketLoggingOutput) { - op := &request.Operation{ - Name: opPutBucketLogging, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?logging", - } - - if input == nil { - input = &PutBucketLoggingInput{} - } - - output = &PutBucketLoggingOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// PutBucketLogging API operation for Amazon Simple Storage Service. -// -// Set the logging parameters for a bucket and to specify permissions for who -// can view and modify the logging parameters. All logs are saved to buckets -// in the same Amazon Web Services Region as the source bucket. To set the logging -// status of a bucket, you must be the bucket owner. -// -// The bucket owner is automatically granted FULL_CONTROL to all logs. You use -// the Grantee request element to grant access to other people. The Permissions -// request element specifies the kind of access the grantee has to the logs. -// -// If the target bucket for log delivery uses the bucket owner enforced setting -// for S3 Object Ownership, you can't use the Grantee request element to grant -// access to others. Permissions can only be granted using policies. For more -// information, see Permissions for server access log delivery (https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html#grant-log-delivery-permissions-general) -// in the Amazon S3 User Guide. -// -// # Grantee Values -// -// You can specify the person (grantee) to whom you're assigning access rights -// (using request elements) in the following ways: -// -// - By the person's ID: <>ID<><>GranteesEmail<> -// DisplayName is optional and ignored in the request. -// -// - By Email address: <>Grantees@email.com<> -// The grantee is resolved to the CanonicalUser and, in a response to a GET -// Object acl request, appears as the CanonicalUser. -// -// - By URI: <>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<> -// -// To enable logging, you use LoggingEnabled and its children request elements. -// To disable logging, you use an empty BucketLoggingStatus request element: -// -// -// -// For more information about server access logging, see Server Access Logging -// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerLogs.html) in -// the Amazon S3 User Guide. -// -// For more information about creating a bucket, see CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html). -// For more information about returning the logging status of a bucket, see -// GetBucketLogging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLogging.html). -// -// The following operations are related to PutBucketLogging: -// -// - PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) -// -// - DeleteBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html) -// -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// -// - GetBucketLogging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLogging.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutBucketLogging for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketLogging -func (c *S3) PutBucketLogging(input *PutBucketLoggingInput) (*PutBucketLoggingOutput, error) { - req, out := c.PutBucketLoggingRequest(input) - return out, req.Send() -} - -// PutBucketLoggingWithContext is the same as PutBucketLogging with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketLogging for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutBucketLoggingWithContext(ctx aws.Context, input *PutBucketLoggingInput, opts ...request.Option) (*PutBucketLoggingOutput, error) { - req, out := c.PutBucketLoggingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketMetricsConfiguration = "PutBucketMetricsConfiguration" - -// PutBucketMetricsConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketMetricsConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutBucketMetricsConfiguration for more information on using the PutBucketMetricsConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutBucketMetricsConfigurationRequest method. -// req, resp := client.PutBucketMetricsConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketMetricsConfiguration -func (c *S3) PutBucketMetricsConfigurationRequest(input *PutBucketMetricsConfigurationInput) (req *request.Request, output *PutBucketMetricsConfigurationOutput) { - op := &request.Operation{ - Name: opPutBucketMetricsConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?metrics", - } - - if input == nil { - input = &PutBucketMetricsConfigurationInput{} - } - - output = &PutBucketMetricsConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketMetricsConfiguration API operation for Amazon Simple Storage Service. -// -// Sets a metrics configuration (specified by the metrics configuration ID) -// for the bucket. You can have up to 1,000 metrics configurations per bucket. -// If you're updating an existing metrics configuration, note that this is a -// full replacement of the existing metrics configuration. If you don't include -// the elements you want to keep, they are erased. -// -// To use this operation, you must have permissions to perform the s3:PutMetricsConfiguration -// action. The bucket owner has this permission by default. The bucket owner -// can grant this permission to others. For more information about permissions, -// see Permissions Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// For information about CloudWatch request metrics for Amazon S3, see Monitoring -// Metrics with Amazon CloudWatch (https://docs.aws.amazon.com/AmazonS3/latest/dev/cloudwatch-monitoring.html). -// -// The following operations are related to PutBucketMetricsConfiguration: -// -// - DeleteBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketMetricsConfiguration.html) -// -// - GetBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketMetricsConfiguration.html) -// -// - ListBucketMetricsConfigurations (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListBucketMetricsConfigurations.html) -// -// GetBucketLifecycle has the following special error: -// -// - Error code: TooManyConfigurations Description: You are attempting to -// create a new configuration but have already reached the 1,000-configuration -// limit. HTTP Status Code: HTTP 400 Bad Request -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutBucketMetricsConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketMetricsConfiguration -func (c *S3) PutBucketMetricsConfiguration(input *PutBucketMetricsConfigurationInput) (*PutBucketMetricsConfigurationOutput, error) { - req, out := c.PutBucketMetricsConfigurationRequest(input) - return out, req.Send() -} - -// PutBucketMetricsConfigurationWithContext is the same as PutBucketMetricsConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketMetricsConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutBucketMetricsConfigurationWithContext(ctx aws.Context, input *PutBucketMetricsConfigurationInput, opts ...request.Option) (*PutBucketMetricsConfigurationOutput, error) { - req, out := c.PutBucketMetricsConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketNotification = "PutBucketNotification" - -// PutBucketNotificationRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketNotification operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutBucketNotification for more information on using the PutBucketNotification -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutBucketNotificationRequest method. -// req, resp := client.PutBucketNotificationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotification -// -// Deprecated: PutBucketNotification has been deprecated -func (c *S3) PutBucketNotificationRequest(input *PutBucketNotificationInput) (req *request.Request, output *PutBucketNotificationOutput) { - if c.Client.Config.Logger != nil { - c.Client.Config.Logger.Log("This operation, PutBucketNotification, has been deprecated") - } - op := &request.Operation{ - Name: opPutBucketNotification, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?notification", - } - - if input == nil { - input = &PutBucketNotificationInput{} - } - - output = &PutBucketNotificationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// PutBucketNotification API operation for Amazon Simple Storage Service. -// -// No longer used, see the PutBucketNotificationConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketNotificationConfiguration.html) -// operation. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutBucketNotification for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotification -// -// Deprecated: PutBucketNotification has been deprecated -func (c *S3) PutBucketNotification(input *PutBucketNotificationInput) (*PutBucketNotificationOutput, error) { - req, out := c.PutBucketNotificationRequest(input) - return out, req.Send() -} - -// PutBucketNotificationWithContext is the same as PutBucketNotification with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketNotification for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -// -// Deprecated: PutBucketNotificationWithContext has been deprecated -func (c *S3) PutBucketNotificationWithContext(ctx aws.Context, input *PutBucketNotificationInput, opts ...request.Option) (*PutBucketNotificationOutput, error) { - req, out := c.PutBucketNotificationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketNotificationConfiguration = "PutBucketNotificationConfiguration" - -// PutBucketNotificationConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketNotificationConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutBucketNotificationConfiguration for more information on using the PutBucketNotificationConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutBucketNotificationConfigurationRequest method. -// req, resp := client.PutBucketNotificationConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotificationConfiguration -func (c *S3) PutBucketNotificationConfigurationRequest(input *PutBucketNotificationConfigurationInput) (req *request.Request, output *PutBucketNotificationConfigurationOutput) { - op := &request.Operation{ - Name: opPutBucketNotificationConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?notification", - } - - if input == nil { - input = &PutBucketNotificationConfigurationInput{} - } - - output = &PutBucketNotificationConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutBucketNotificationConfiguration API operation for Amazon Simple Storage Service. -// -// Enables notifications of specified events for a bucket. For more information -// about event notifications, see Configuring Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html). -// -// Using this API, you can replace an existing notification configuration. The -// configuration is an XML file that defines the event types that you want Amazon -// S3 to publish and the destination where you want Amazon S3 to publish an -// event notification when it detects an event of the specified type. -// -// By default, your bucket has no event notifications configured. That is, the -// notification configuration will be an empty NotificationConfiguration. -// -// -// -// -// -// This action replaces the existing notification configuration with the configuration -// you include in the request body. -// -// After Amazon S3 receives this request, it first verifies that any Amazon -// Simple Notification Service (Amazon SNS) or Amazon Simple Queue Service (Amazon -// SQS) destination exists, and that the bucket owner has permission to publish -// to it by sending a test notification. In the case of Lambda destinations, -// Amazon S3 verifies that the Lambda function permissions grant Amazon S3 permission -// to invoke the function from the Amazon S3 bucket. For more information, see -// Configuring Notifications for Amazon S3 Events (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html). -// -// You can disable notifications by adding the empty NotificationConfiguration -// element. -// -// For more information about the number of event notification configurations -// that you can create per bucket, see Amazon S3 service quotas (https://docs.aws.amazon.com/general/latest/gr/s3.html#limits_s3) -// in Amazon Web Services General Reference. -// -// By default, only the bucket owner can configure notifications on a bucket. -// However, bucket owners can use a bucket policy to grant permission to other -// users to set this configuration with s3:PutBucketNotification permission. -// -// The PUT notification is an atomic operation. For example, suppose your notification -// configuration includes SNS topic, SQS queue, and Lambda function configurations. -// When you send a PUT request with this configuration, Amazon S3 sends test -// messages to your SNS topic. If the message fails, the entire PUT action will -// fail, and Amazon S3 will not add the configuration to your bucket. -// -// # Responses -// -// If the configuration in the request body includes only one TopicConfiguration -// specifying only the s3:ReducedRedundancyLostObject event type, the response -// will also include the x-amz-sns-test-message-id header containing the message -// ID of the test notification sent to the topic. -// -// The following action is related to PutBucketNotificationConfiguration: -// -// - GetBucketNotificationConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutBucketNotificationConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketNotificationConfiguration -func (c *S3) PutBucketNotificationConfiguration(input *PutBucketNotificationConfigurationInput) (*PutBucketNotificationConfigurationOutput, error) { - req, out := c.PutBucketNotificationConfigurationRequest(input) - return out, req.Send() -} - -// PutBucketNotificationConfigurationWithContext is the same as PutBucketNotificationConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketNotificationConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutBucketNotificationConfigurationWithContext(ctx aws.Context, input *PutBucketNotificationConfigurationInput, opts ...request.Option) (*PutBucketNotificationConfigurationOutput, error) { - req, out := c.PutBucketNotificationConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketOwnershipControls = "PutBucketOwnershipControls" - -// PutBucketOwnershipControlsRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketOwnershipControls operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutBucketOwnershipControls for more information on using the PutBucketOwnershipControls -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutBucketOwnershipControlsRequest method. -// req, resp := client.PutBucketOwnershipControlsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketOwnershipControls -func (c *S3) PutBucketOwnershipControlsRequest(input *PutBucketOwnershipControlsInput) (req *request.Request, output *PutBucketOwnershipControlsOutput) { - op := &request.Operation{ - Name: opPutBucketOwnershipControls, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?ownershipControls", - } - - if input == nil { - input = &PutBucketOwnershipControlsInput{} - } - - output = &PutBucketOwnershipControlsOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// PutBucketOwnershipControls API operation for Amazon Simple Storage Service. -// -// Creates or modifies OwnershipControls for an Amazon S3 bucket. To use this -// operation, you must have the s3:PutBucketOwnershipControls permission. For -// more information about Amazon S3 permissions, see Specifying permissions -// in a policy (https://docs.aws.amazon.com/AmazonS3/latest/user-guide/using-with-s3-actions.html). -// -// For information about Amazon S3 Object Ownership, see Using object ownership -// (https://docs.aws.amazon.com/AmazonS3/latest/user-guide/about-object-ownership.html). -// -// The following operations are related to PutBucketOwnershipControls: -// -// - GetBucketOwnershipControls -// -// - DeleteBucketOwnershipControls -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutBucketOwnershipControls for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketOwnershipControls -func (c *S3) PutBucketOwnershipControls(input *PutBucketOwnershipControlsInput) (*PutBucketOwnershipControlsOutput, error) { - req, out := c.PutBucketOwnershipControlsRequest(input) - return out, req.Send() -} - -// PutBucketOwnershipControlsWithContext is the same as PutBucketOwnershipControls with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketOwnershipControls for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutBucketOwnershipControlsWithContext(ctx aws.Context, input *PutBucketOwnershipControlsInput, opts ...request.Option) (*PutBucketOwnershipControlsOutput, error) { - req, out := c.PutBucketOwnershipControlsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketPolicy = "PutBucketPolicy" - -// PutBucketPolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketPolicy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutBucketPolicy for more information on using the PutBucketPolicy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutBucketPolicyRequest method. -// req, resp := client.PutBucketPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketPolicy -func (c *S3) PutBucketPolicyRequest(input *PutBucketPolicyInput) (req *request.Request, output *PutBucketPolicyOutput) { - op := &request.Operation{ - Name: opPutBucketPolicy, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?policy", - } - - if input == nil { - input = &PutBucketPolicyInput{} - } - - output = &PutBucketPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// PutBucketPolicy API operation for Amazon Simple Storage Service. -// -// Applies an Amazon S3 bucket policy to an Amazon S3 bucket. If you are using -// an identity other than the root user of the Amazon Web Services account that -// owns the bucket, the calling identity must have the PutBucketPolicy permissions -// on the specified bucket and belong to the bucket owner's account in order -// to use this operation. -// -// If you don't have PutBucketPolicy permissions, Amazon S3 returns a 403 Access -// Denied error. If you have the correct permissions, but you're not using an -// identity that belongs to the bucket owner's account, Amazon S3 returns a -// 405 Method Not Allowed error. -// -// As a security precaution, the root user of the Amazon Web Services account -// that owns a bucket can always use this operation, even if the policy explicitly -// denies the root user the ability to perform this action. -// -// For more information, see Bucket policy examples (https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html). -// -// The following operations are related to PutBucketPolicy: -// -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// -// - DeleteBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutBucketPolicy for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketPolicy -func (c *S3) PutBucketPolicy(input *PutBucketPolicyInput) (*PutBucketPolicyOutput, error) { - req, out := c.PutBucketPolicyRequest(input) - return out, req.Send() -} - -// PutBucketPolicyWithContext is the same as PutBucketPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketPolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutBucketPolicyWithContext(ctx aws.Context, input *PutBucketPolicyInput, opts ...request.Option) (*PutBucketPolicyOutput, error) { - req, out := c.PutBucketPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketReplication = "PutBucketReplication" - -// PutBucketReplicationRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketReplication operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutBucketReplication for more information on using the PutBucketReplication -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutBucketReplicationRequest method. -// req, resp := client.PutBucketReplicationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketReplication -func (c *S3) PutBucketReplicationRequest(input *PutBucketReplicationInput) (req *request.Request, output *PutBucketReplicationOutput) { - op := &request.Operation{ - Name: opPutBucketReplication, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?replication", - } - - if input == nil { - input = &PutBucketReplicationInput{} - } - - output = &PutBucketReplicationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// PutBucketReplication API operation for Amazon Simple Storage Service. -// -// Creates a replication configuration or replaces an existing one. For more -// information, see Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html) -// in the Amazon S3 User Guide. -// -// Specify the replication configuration in the request body. In the replication -// configuration, you provide the name of the destination bucket or buckets -// where you want Amazon S3 to replicate objects, the IAM role that Amazon S3 -// can assume to replicate objects on your behalf, and other relevant information. -// -// A replication configuration must include at least one rule, and can contain -// a maximum of 1,000. Each rule identifies a subset of objects to replicate -// by filtering the objects in the source bucket. To choose additional subsets -// of objects to replicate, add a rule for each subset. -// -// To specify a subset of the objects in the source bucket to apply a replication -// rule to, add the Filter element as a child of the Rule element. You can filter -// objects based on an object key prefix, one or more object tags, or both. -// When you add the Filter element in the configuration, you must also add the -// following elements: DeleteMarkerReplication, Status, and Priority. -// -// If you are using an earlier version of the replication configuration, Amazon -// S3 handles replication of delete markers differently. For more information, -// see Backward Compatibility (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations). -// -// For information about enabling versioning on a bucket, see Using Versioning -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html). -// -// # Handling Replication of Encrypted Objects -// -// By default, Amazon S3 doesn't replicate objects that are stored at rest using -// server-side encryption with KMS keys. To replicate Amazon Web Services KMS-encrypted -// objects, add the following: SourceSelectionCriteria, SseKmsEncryptedObjects, -// Status, EncryptionConfiguration, and ReplicaKmsKeyID. For information about -// replication configuration, see Replicating Objects Created with SSE Using -// KMS keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-config-for-kms-objects.html). -// -// For information on PutBucketReplication errors, see List of replication-related -// error codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#ReplicationErrorCodeList) -// -// # Permissions -// -// To create a PutBucketReplication request, you must have s3:PutReplicationConfiguration -// permissions for the bucket. -// -// By default, a resource owner, in this case the Amazon Web Services account -// that created the bucket, can perform this operation. The resource owner can -// also grant others permissions to perform the operation. For more information -// about permissions, see Specifying Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// To perform this operation, the user or role performing the action must have -// the iam:PassRole (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_use_passrole.html) -// permission. -// -// The following operations are related to PutBucketReplication: -// -// - GetBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketReplication.html) -// -// - DeleteBucketReplication (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutBucketReplication for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketReplication -func (c *S3) PutBucketReplication(input *PutBucketReplicationInput) (*PutBucketReplicationOutput, error) { - req, out := c.PutBucketReplicationRequest(input) - return out, req.Send() -} - -// PutBucketReplicationWithContext is the same as PutBucketReplication with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketReplication for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutBucketReplicationWithContext(ctx aws.Context, input *PutBucketReplicationInput, opts ...request.Option) (*PutBucketReplicationOutput, error) { - req, out := c.PutBucketReplicationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketRequestPayment = "PutBucketRequestPayment" - -// PutBucketRequestPaymentRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketRequestPayment operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutBucketRequestPayment for more information on using the PutBucketRequestPayment -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutBucketRequestPaymentRequest method. -// req, resp := client.PutBucketRequestPaymentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketRequestPayment -func (c *S3) PutBucketRequestPaymentRequest(input *PutBucketRequestPaymentInput) (req *request.Request, output *PutBucketRequestPaymentOutput) { - op := &request.Operation{ - Name: opPutBucketRequestPayment, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?requestPayment", - } - - if input == nil { - input = &PutBucketRequestPaymentInput{} - } - - output = &PutBucketRequestPaymentOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// PutBucketRequestPayment API operation for Amazon Simple Storage Service. -// -// Sets the request payment configuration for a bucket. By default, the bucket -// owner pays for downloads from the bucket. This configuration parameter enables -// the bucket owner (only) to specify that the person requesting the download -// will be charged for the download. For more information, see Requester Pays -// Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html). -// -// The following operations are related to PutBucketRequestPayment: -// -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// -// - GetBucketRequestPayment (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketRequestPayment.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutBucketRequestPayment for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketRequestPayment -func (c *S3) PutBucketRequestPayment(input *PutBucketRequestPaymentInput) (*PutBucketRequestPaymentOutput, error) { - req, out := c.PutBucketRequestPaymentRequest(input) - return out, req.Send() -} - -// PutBucketRequestPaymentWithContext is the same as PutBucketRequestPayment with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketRequestPayment for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutBucketRequestPaymentWithContext(ctx aws.Context, input *PutBucketRequestPaymentInput, opts ...request.Option) (*PutBucketRequestPaymentOutput, error) { - req, out := c.PutBucketRequestPaymentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketTagging = "PutBucketTagging" - -// PutBucketTaggingRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketTagging operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutBucketTagging for more information on using the PutBucketTagging -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutBucketTaggingRequest method. -// req, resp := client.PutBucketTaggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketTagging -func (c *S3) PutBucketTaggingRequest(input *PutBucketTaggingInput) (req *request.Request, output *PutBucketTaggingOutput) { - op := &request.Operation{ - Name: opPutBucketTagging, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?tagging", - } - - if input == nil { - input = &PutBucketTaggingInput{} - } - - output = &PutBucketTaggingOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// PutBucketTagging API operation for Amazon Simple Storage Service. -// -// Sets the tags for a bucket. -// -// Use tags to organize your Amazon Web Services bill to reflect your own cost -// structure. To do this, sign up to get your Amazon Web Services account bill -// with tag key values included. Then, to see the cost of combined resources, -// organize your billing information according to resources with the same tag -// key values. For example, you can tag several resources with a specific application -// name, and then organize your billing information to see the total cost of -// that application across several services. For more information, see Cost -// Allocation and Tagging (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) -// and Using Cost Allocation in Amazon S3 Bucket Tags (https://docs.aws.amazon.com/AmazonS3/latest/dev/CostAllocTagging.html). -// -// When this operation sets the tags for a bucket, it will overwrite any current -// tags the bucket already has. You cannot use this operation to add tags to -// an existing list of tags. -// -// To use this operation, you must have permissions to perform the s3:PutBucketTagging -// action. The bucket owner has this permission by default and can grant this -// permission to others. For more information about permissions, see Permissions -// Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html). -// -// PutBucketTagging has the following special errors: -// -// - Error code: InvalidTagError Description: The tag provided was not a -// valid tag. This error can occur if the tag did not pass input validation. -// For information about tag restrictions, see User-Defined Tag Restrictions -// (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html) -// and Amazon Web Services-Generated Cost Allocation Tag Restrictions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/aws-tag-restrictions.html). -// -// - Error code: MalformedXMLError Description: The XML provided does not -// match the schema. -// -// - Error code: OperationAbortedError Description: A conflicting conditional -// action is currently in progress against this resource. Please try again. -// -// - Error code: InternalError Description: The service was unable to apply -// the provided tag to the bucket. -// -// The following operations are related to PutBucketTagging: -// -// - GetBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketTagging.html) -// -// - DeleteBucketTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketTagging.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutBucketTagging for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketTagging -func (c *S3) PutBucketTagging(input *PutBucketTaggingInput) (*PutBucketTaggingOutput, error) { - req, out := c.PutBucketTaggingRequest(input) - return out, req.Send() -} - -// PutBucketTaggingWithContext is the same as PutBucketTagging with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketTagging for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutBucketTaggingWithContext(ctx aws.Context, input *PutBucketTaggingInput, opts ...request.Option) (*PutBucketTaggingOutput, error) { - req, out := c.PutBucketTaggingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketVersioning = "PutBucketVersioning" - -// PutBucketVersioningRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketVersioning operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutBucketVersioning for more information on using the PutBucketVersioning -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutBucketVersioningRequest method. -// req, resp := client.PutBucketVersioningRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketVersioning -func (c *S3) PutBucketVersioningRequest(input *PutBucketVersioningInput) (req *request.Request, output *PutBucketVersioningOutput) { - op := &request.Operation{ - Name: opPutBucketVersioning, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?versioning", - } - - if input == nil { - input = &PutBucketVersioningInput{} - } - - output = &PutBucketVersioningOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// PutBucketVersioning API operation for Amazon Simple Storage Service. -// -// Sets the versioning state of an existing bucket. -// -// You can set the versioning state with one of the following values: -// -// Enabled—Enables versioning for the objects in the bucket. All objects added -// to the bucket receive a unique version ID. -// -// Suspended—Disables versioning for the objects in the bucket. All objects -// added to the bucket receive the version ID null. -// -// If the versioning state has never been set on a bucket, it has no versioning -// state; a GetBucketVersioning (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html) -// request does not return a versioning state value. -// -// In order to enable MFA Delete, you must be the bucket owner. If you are the -// bucket owner and want to enable MFA Delete in the bucket versioning configuration, -// you must include the x-amz-mfa request header and the Status and the MfaDelete -// request elements in a request to set the versioning state of the bucket. -// -// If you have an object expiration lifecycle policy in your non-versioned bucket -// and you want to maintain the same permanent delete behavior when you enable -// versioning, you must add a noncurrent expiration policy. The noncurrent expiration -// lifecycle policy will manage the deletes of the noncurrent object versions -// in the version-enabled bucket. (A version-enabled bucket maintains one current -// and zero or more noncurrent object versions.) For more information, see Lifecycle -// and Versioning (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html#lifecycle-and-other-bucket-config). -// -// Related Resources -// -// - CreateBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) -// -// - DeleteBucket (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucket.html) -// -// - GetBucketVersioning (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutBucketVersioning for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketVersioning -func (c *S3) PutBucketVersioning(input *PutBucketVersioningInput) (*PutBucketVersioningOutput, error) { - req, out := c.PutBucketVersioningRequest(input) - return out, req.Send() -} - -// PutBucketVersioningWithContext is the same as PutBucketVersioning with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketVersioning for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutBucketVersioningWithContext(ctx aws.Context, input *PutBucketVersioningInput, opts ...request.Option) (*PutBucketVersioningOutput, error) { - req, out := c.PutBucketVersioningRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutBucketWebsite = "PutBucketWebsite" - -// PutBucketWebsiteRequest generates a "aws/request.Request" representing the -// client's request for the PutBucketWebsite operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutBucketWebsite for more information on using the PutBucketWebsite -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutBucketWebsiteRequest method. -// req, resp := client.PutBucketWebsiteRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketWebsite -func (c *S3) PutBucketWebsiteRequest(input *PutBucketWebsiteInput) (req *request.Request, output *PutBucketWebsiteOutput) { - op := &request.Operation{ - Name: opPutBucketWebsite, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?website", - } - - if input == nil { - input = &PutBucketWebsiteInput{} - } - - output = &PutBucketWebsiteOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// PutBucketWebsite API operation for Amazon Simple Storage Service. -// -// Sets the configuration of the website that is specified in the website subresource. -// To configure a bucket as a website, you can add this subresource on the bucket -// with website configuration information such as the file name of the index -// document and any redirect rules. For more information, see Hosting Websites -// on Amazon S3 (https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html). -// -// This PUT action requires the S3:PutBucketWebsite permission. By default, -// only the bucket owner can configure the website attached to a bucket; however, -// bucket owners can allow other users to set the website configuration by writing -// a bucket policy that grants them the S3:PutBucketWebsite permission. -// -// To redirect all website requests sent to the bucket's website endpoint, you -// add a website configuration with the following elements. Because all requests -// are sent to another website, you don't need to provide index document name -// for the bucket. -// -// - WebsiteConfiguration -// -// - RedirectAllRequestsTo -// -// - HostName -// -// - Protocol -// -// If you want granular control over redirects, you can use the following elements -// to add routing rules that describe conditions for redirecting requests and -// information about the redirect destination. In this case, the website configuration -// must provide an index document for the bucket, because some requests might -// not be redirected. -// -// - WebsiteConfiguration -// -// - IndexDocument -// -// - Suffix -// -// - ErrorDocument -// -// - Key -// -// - RoutingRules -// -// - RoutingRule -// -// - Condition -// -// - HttpErrorCodeReturnedEquals -// -// - KeyPrefixEquals -// -// - Redirect -// -// - Protocol -// -// - HostName -// -// - ReplaceKeyPrefixWith -// -// - ReplaceKeyWith -// -// - HttpRedirectCode -// -// Amazon S3 has a limitation of 50 routing rules per website configuration. -// If you require more than 50 routing rules, you can use object redirect. For -// more information, see Configuring an Object Redirect (https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html) -// in the Amazon S3 User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutBucketWebsite for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutBucketWebsite -func (c *S3) PutBucketWebsite(input *PutBucketWebsiteInput) (*PutBucketWebsiteOutput, error) { - req, out := c.PutBucketWebsiteRequest(input) - return out, req.Send() -} - -// PutBucketWebsiteWithContext is the same as PutBucketWebsite with the addition of -// the ability to pass a context and additional request options. -// -// See PutBucketWebsite for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutBucketWebsiteWithContext(ctx aws.Context, input *PutBucketWebsiteInput, opts ...request.Option) (*PutBucketWebsiteOutput, error) { - req, out := c.PutBucketWebsiteRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutObject = "PutObject" - -// PutObjectRequest generates a "aws/request.Request" representing the -// client's request for the PutObject operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutObject for more information on using the PutObject -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutObjectRequest method. -// req, resp := client.PutObjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObject -func (c *S3) PutObjectRequest(input *PutObjectInput) (req *request.Request, output *PutObjectOutput) { - op := &request.Operation{ - Name: opPutObject, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}/{Key+}", - } - - if input == nil { - input = &PutObjectInput{} - } - - output = &PutObjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutObject API operation for Amazon Simple Storage Service. -// -// Adds an object to a bucket. You must have WRITE permissions on a bucket to -// add an object to it. -// -// Amazon S3 never adds partial objects; if you receive a success response, -// Amazon S3 added the entire object to the bucket. -// -// Amazon S3 is a distributed system. If it receives multiple write requests -// for the same object simultaneously, it overwrites all but the last object -// written. Amazon S3 does not provide object locking; if you need this, make -// sure to build it into your application layer or use versioning instead. -// -// To ensure that data is not corrupted traversing the network, use the Content-MD5 -// header. When you use this header, Amazon S3 checks the object against the -// provided MD5 value and, if they do not match, returns an error. Additionally, -// you can calculate the MD5 while putting an object to Amazon S3 and compare -// the returned ETag to the calculated MD5 value. -// -// - To successfully complete the PutObject request, you must have the s3:PutObject -// in your IAM permissions. -// -// - To successfully change the objects acl of your PutObject request, you -// must have the s3:PutObjectAcl in your IAM permissions. -// -// - The Content-MD5 header is required for any request to upload an object -// with a retention period configured using Amazon S3 Object Lock. For more -// information about Amazon S3 Object Lock, see Amazon S3 Object Lock Overview -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock-overview.html) -// in the Amazon S3 User Guide. -// -// # Server-side Encryption -// -// You can optionally request server-side encryption. With server-side encryption, -// Amazon S3 encrypts your data as it writes it to disks in its data centers -// and decrypts the data when you access it. You have the option to provide -// your own encryption key or use Amazon Web Services managed encryption keys -// (SSE-S3 or SSE-KMS). For more information, see Using Server-Side Encryption -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html). -// -// If you request server-side encryption using Amazon Web Services Key Management -// Service (SSE-KMS), you can enable an S3 Bucket Key at the object-level. For -// more information, see Amazon S3 Bucket Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) -// in the Amazon S3 User Guide. -// -// # Access Control List (ACL)-Specific Request Headers -// -// You can use headers to grant ACL- based permissions. By default, all objects -// are private. Only the owner has full access control. When adding a new object, -// you can grant permissions to individual Amazon Web Services accounts or to -// predefined groups defined by Amazon S3. These permissions are then added -// to the ACL on the object. For more information, see Access Control List (ACL) -// Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html) -// and Managing ACLs Using the REST API (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-using-rest-api.html). -// -// If the bucket that you're uploading objects to uses the bucket owner enforced -// setting for S3 Object Ownership, ACLs are disabled and no longer affect permissions. -// Buckets that use this setting only accept PUT requests that don't specify -// an ACL or PUT requests that specify bucket owner full control ACLs, such -// as the bucket-owner-full-control canned ACL or an equivalent form of this -// ACL expressed in the XML format. PUT requests that contain other ACLs (for -// example, custom grants to certain Amazon Web Services accounts) fail and -// return a 400 error with the error code AccessControlListNotSupported. -// -// For more information, see Controlling ownership of objects and disabling -// ACLs (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) -// in the Amazon S3 User Guide. -// -// If your bucket uses the bucket owner enforced setting for Object Ownership, -// all objects written to the bucket by any account will be owned by the bucket -// owner. -// -// # Storage Class Options -// -// By default, Amazon S3 uses the STANDARD Storage Class to store newly created -// objects. The STANDARD storage class provides high durability and high availability. -// Depending on performance needs, you can specify a different Storage Class. -// Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. For more information, -// see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) -// in the Amazon S3 User Guide. -// -// # Versioning -// -// If you enable versioning for a bucket, Amazon S3 automatically generates -// a unique version ID for the object being stored. Amazon S3 returns this ID -// in the response. When you enable versioning for a bucket, if Amazon S3 receives -// multiple write requests for the same object simultaneously, it stores all -// of the objects. -// -// For more information about versioning, see Adding Objects to Versioning Enabled -// Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/AddingObjectstoVersioningEnabledBuckets.html). -// For information about returning the versioning state of a bucket, see GetBucketVersioning -// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html). -// -// Related Resources -// -// - CopyObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html) -// -// - DeleteObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutObject for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObject -func (c *S3) PutObject(input *PutObjectInput) (*PutObjectOutput, error) { - req, out := c.PutObjectRequest(input) - return out, req.Send() -} - -// PutObjectWithContext is the same as PutObject with the addition of -// the ability to pass a context and additional request options. -// -// See PutObject for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutObjectWithContext(ctx aws.Context, input *PutObjectInput, opts ...request.Option) (*PutObjectOutput, error) { - req, out := c.PutObjectRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutObjectAcl = "PutObjectAcl" - -// PutObjectAclRequest generates a "aws/request.Request" representing the -// client's request for the PutObjectAcl operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutObjectAcl for more information on using the PutObjectAcl -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutObjectAclRequest method. -// req, resp := client.PutObjectAclRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectAcl -func (c *S3) PutObjectAclRequest(input *PutObjectAclInput) (req *request.Request, output *PutObjectAclOutput) { - op := &request.Operation{ - Name: opPutObjectAcl, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}/{Key+}?acl", - } - - if input == nil { - input = &PutObjectAclInput{} - } - - output = &PutObjectAclOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// PutObjectAcl API operation for Amazon Simple Storage Service. -// -// Uses the acl subresource to set the access control list (ACL) permissions -// for a new or existing object in an S3 bucket. You must have WRITE_ACP permission -// to set the ACL of an object. For more information, see What permissions can -// I grant? (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#permissions) -// in the Amazon S3 User Guide. -// -// This action is not supported by Amazon S3 on Outposts. -// -// Depending on your application needs, you can choose to set the ACL on an -// object using either the request body or the headers. For example, if you -// have an existing application that updates a bucket ACL using the request -// body, you can continue to use that approach. For more information, see Access -// Control List (ACL) Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html) -// in the Amazon S3 User Guide. -// -// If your bucket uses the bucket owner enforced setting for S3 Object Ownership, -// ACLs are disabled and no longer affect permissions. You must use policies -// to grant access to your bucket and the objects in it. Requests to set ACLs -// or update ACLs fail and return the AccessControlListNotSupported error code. -// Requests to read ACLs are still supported. For more information, see Controlling -// object ownership (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html) -// in the Amazon S3 User Guide. -// -// # Access Permissions -// -// You can set access permissions using one of the following methods: -// -// - Specify a canned ACL with the x-amz-acl request header. Amazon S3 supports -// a set of predefined ACLs, known as canned ACLs. Each canned ACL has a -// predefined set of grantees and permissions. Specify the canned ACL name -// as the value of x-amz-acl. If you use this header, you cannot use other -// access control-specific headers in your request. For more information, -// see Canned ACL (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL). -// -// - Specify access permissions explicitly with the x-amz-grant-read, x-amz-grant-read-acp, -// x-amz-grant-write-acp, and x-amz-grant-full-control headers. When using -// these headers, you specify explicit access permissions and grantees (Amazon -// Web Services accounts or Amazon S3 groups) who will receive the permission. -// If you use these ACL-specific headers, you cannot use x-amz-acl header -// to set a canned ACL. These parameters map to the set of permissions that -// Amazon S3 supports in an ACL. For more information, see Access Control -// List (ACL) Overview (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html). -// You specify each grantee as a type=value pair, where the type is one of -// the following: id – if the value specified is the canonical user ID -// of an Amazon Web Services account uri – if you are granting permissions -// to a predefined group emailAddress – if the value specified is the email -// address of an Amazon Web Services account Using email addresses to specify -// a grantee is only supported in the following Amazon Web Services Regions: -// US East (N. Virginia) US West (N. California) US West (Oregon) Asia Pacific -// (Singapore) Asia Pacific (Sydney) Asia Pacific (Tokyo) Europe (Ireland) -// South America (São Paulo) For a list of all the Amazon S3 supported Regions -// and endpoints, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) -// in the Amazon Web Services General Reference. For example, the following -// x-amz-grant-read header grants list objects permission to the two Amazon -// Web Services accounts identified by their email addresses. x-amz-grant-read: -// emailAddress="xyz@amazon.com", emailAddress="abc@amazon.com" -// -// You can use either a canned ACL or specify access permissions explicitly. -// You cannot do both. -// -// # Grantee Values -// -// You can specify the person (grantee) to whom you're assigning access rights -// (using request elements) in the following ways: -// -// - By the person's ID: <>ID<><>GranteesEmail<> -// DisplayName is optional and ignored in the request. -// -// - By URI: <>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<> -// -// - By Email address: <>Grantees@email.com<>lt;/Grantee> -// The grantee is resolved to the CanonicalUser and, in a response to a GET -// Object acl request, appears as the CanonicalUser. Using email addresses -// to specify a grantee is only supported in the following Amazon Web Services -// Regions: US East (N. Virginia) US West (N. California) US West (Oregon) -// Asia Pacific (Singapore) Asia Pacific (Sydney) Asia Pacific (Tokyo) Europe -// (Ireland) South America (São Paulo) For a list of all the Amazon S3 supported -// Regions and endpoints, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) -// in the Amazon Web Services General Reference. -// -// # Versioning -// -// The ACL of an object is set at the object version level. By default, PUT -// sets the ACL of the current version of an object. To set the ACL of a different -// version, use the versionId subresource. -// -// Related Resources -// -// - CopyObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html) -// -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutObjectAcl for usage and error information. -// -// Returned Error Codes: -// - ErrCodeNoSuchKey "NoSuchKey" -// The specified key does not exist. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectAcl -func (c *S3) PutObjectAcl(input *PutObjectAclInput) (*PutObjectAclOutput, error) { - req, out := c.PutObjectAclRequest(input) - return out, req.Send() -} - -// PutObjectAclWithContext is the same as PutObjectAcl with the addition of -// the ability to pass a context and additional request options. -// -// See PutObjectAcl for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutObjectAclWithContext(ctx aws.Context, input *PutObjectAclInput, opts ...request.Option) (*PutObjectAclOutput, error) { - req, out := c.PutObjectAclRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutObjectLegalHold = "PutObjectLegalHold" - -// PutObjectLegalHoldRequest generates a "aws/request.Request" representing the -// client's request for the PutObjectLegalHold operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutObjectLegalHold for more information on using the PutObjectLegalHold -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutObjectLegalHoldRequest method. -// req, resp := client.PutObjectLegalHoldRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectLegalHold -func (c *S3) PutObjectLegalHoldRequest(input *PutObjectLegalHoldInput) (req *request.Request, output *PutObjectLegalHoldOutput) { - op := &request.Operation{ - Name: opPutObjectLegalHold, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}/{Key+}?legal-hold", - } - - if input == nil { - input = &PutObjectLegalHoldInput{} - } - - output = &PutObjectLegalHoldOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// PutObjectLegalHold API operation for Amazon Simple Storage Service. -// -// Applies a legal hold configuration to the specified object. For more information, -// see Locking Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). -// -// This action is not supported by Amazon S3 on Outposts. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutObjectLegalHold for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectLegalHold -func (c *S3) PutObjectLegalHold(input *PutObjectLegalHoldInput) (*PutObjectLegalHoldOutput, error) { - req, out := c.PutObjectLegalHoldRequest(input) - return out, req.Send() -} - -// PutObjectLegalHoldWithContext is the same as PutObjectLegalHold with the addition of -// the ability to pass a context and additional request options. -// -// See PutObjectLegalHold for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutObjectLegalHoldWithContext(ctx aws.Context, input *PutObjectLegalHoldInput, opts ...request.Option) (*PutObjectLegalHoldOutput, error) { - req, out := c.PutObjectLegalHoldRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutObjectLockConfiguration = "PutObjectLockConfiguration" - -// PutObjectLockConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutObjectLockConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutObjectLockConfiguration for more information on using the PutObjectLockConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutObjectLockConfigurationRequest method. -// req, resp := client.PutObjectLockConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectLockConfiguration -func (c *S3) PutObjectLockConfigurationRequest(input *PutObjectLockConfigurationInput) (req *request.Request, output *PutObjectLockConfigurationOutput) { - op := &request.Operation{ - Name: opPutObjectLockConfiguration, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?object-lock", - } - - if input == nil { - input = &PutObjectLockConfigurationInput{} - } - - output = &PutObjectLockConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// PutObjectLockConfiguration API operation for Amazon Simple Storage Service. -// -// Places an Object Lock configuration on the specified bucket. The rule specified -// in the Object Lock configuration will be applied by default to every new -// object placed in the specified bucket. For more information, see Locking -// Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). -// -// - The DefaultRetention settings require both a mode and a period. -// -// - The DefaultRetention period can be either Days or Years but you must -// select one. You cannot specify Days and Years at the same time. -// -// - You can only enable Object Lock for new buckets. If you want to turn -// on Object Lock for an existing bucket, contact Amazon Web Services Support. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutObjectLockConfiguration for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectLockConfiguration -func (c *S3) PutObjectLockConfiguration(input *PutObjectLockConfigurationInput) (*PutObjectLockConfigurationOutput, error) { - req, out := c.PutObjectLockConfigurationRequest(input) - return out, req.Send() -} - -// PutObjectLockConfigurationWithContext is the same as PutObjectLockConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutObjectLockConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutObjectLockConfigurationWithContext(ctx aws.Context, input *PutObjectLockConfigurationInput, opts ...request.Option) (*PutObjectLockConfigurationOutput, error) { - req, out := c.PutObjectLockConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutObjectRetention = "PutObjectRetention" - -// PutObjectRetentionRequest generates a "aws/request.Request" representing the -// client's request for the PutObjectRetention operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutObjectRetention for more information on using the PutObjectRetention -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutObjectRetentionRequest method. -// req, resp := client.PutObjectRetentionRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectRetention -func (c *S3) PutObjectRetentionRequest(input *PutObjectRetentionInput) (req *request.Request, output *PutObjectRetentionOutput) { - op := &request.Operation{ - Name: opPutObjectRetention, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}/{Key+}?retention", - } - - if input == nil { - input = &PutObjectRetentionInput{} - } - - output = &PutObjectRetentionOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// PutObjectRetention API operation for Amazon Simple Storage Service. -// -// Places an Object Retention configuration on an object. For more information, -// see Locking Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). -// Users or accounts require the s3:PutObjectRetention permission in order to -// place an Object Retention configuration on objects. Bypassing a Governance -// Retention configuration requires the s3:BypassGovernanceRetention permission. -// -// This action is not supported by Amazon S3 on Outposts. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutObjectRetention for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectRetention -func (c *S3) PutObjectRetention(input *PutObjectRetentionInput) (*PutObjectRetentionOutput, error) { - req, out := c.PutObjectRetentionRequest(input) - return out, req.Send() -} - -// PutObjectRetentionWithContext is the same as PutObjectRetention with the addition of -// the ability to pass a context and additional request options. -// -// See PutObjectRetention for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutObjectRetentionWithContext(ctx aws.Context, input *PutObjectRetentionInput, opts ...request.Option) (*PutObjectRetentionOutput, error) { - req, out := c.PutObjectRetentionRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutObjectTagging = "PutObjectTagging" - -// PutObjectTaggingRequest generates a "aws/request.Request" representing the -// client's request for the PutObjectTagging operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutObjectTagging for more information on using the PutObjectTagging -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutObjectTaggingRequest method. -// req, resp := client.PutObjectTaggingRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectTagging -func (c *S3) PutObjectTaggingRequest(input *PutObjectTaggingInput) (req *request.Request, output *PutObjectTaggingOutput) { - op := &request.Operation{ - Name: opPutObjectTagging, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}/{Key+}?tagging", - } - - if input == nil { - input = &PutObjectTaggingInput{} - } - - output = &PutObjectTaggingOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// PutObjectTagging API operation for Amazon Simple Storage Service. -// -// Sets the supplied tag-set to an object that already exists in a bucket. -// -// A tag is a key-value pair. You can associate tags with an object by sending -// a PUT request against the tagging subresource that is associated with the -// object. You can retrieve tags by sending a GET request. For more information, -// see GetObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html). -// -// For tagging-related restrictions related to characters and encodings, see -// Tag Restrictions (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/allocation-tag-restrictions.html). -// Note that Amazon S3 limits the maximum number of tags to 10 tags per object. -// -// To use this operation, you must have permission to perform the s3:PutObjectTagging -// action. By default, the bucket owner has this permission and can grant this -// permission to others. -// -// To put tags of any other version, use the versionId query parameter. You -// also need permission for the s3:PutObjectVersionTagging action. -// -// For information about the Amazon S3 object tagging feature, see Object Tagging -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html). -// -// Special Errors -// -// - Code: InvalidTagError Cause: The tag provided was not a valid tag. This -// error can occur if the tag did not pass input validation. For more information, -// see Object Tagging (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html). -// -// - Code: MalformedXMLError Cause: The XML provided does not match the schema. -// -// - Code: OperationAbortedError Cause: A conflicting conditional action -// is currently in progress against this resource. Please try again. -// -// - Code: InternalError Cause: The service was unable to apply the provided -// tag to the object. -// -// Related Resources -// -// - GetObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html) -// -// - DeleteObjectTagging (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutObjectTagging for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutObjectTagging -func (c *S3) PutObjectTagging(input *PutObjectTaggingInput) (*PutObjectTaggingOutput, error) { - req, out := c.PutObjectTaggingRequest(input) - return out, req.Send() -} - -// PutObjectTaggingWithContext is the same as PutObjectTagging with the addition of -// the ability to pass a context and additional request options. -// -// See PutObjectTagging for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutObjectTaggingWithContext(ctx aws.Context, input *PutObjectTaggingInput, opts ...request.Option) (*PutObjectTaggingOutput, error) { - req, out := c.PutObjectTaggingRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutPublicAccessBlock = "PutPublicAccessBlock" - -// PutPublicAccessBlockRequest generates a "aws/request.Request" representing the -// client's request for the PutPublicAccessBlock operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutPublicAccessBlock for more information on using the PutPublicAccessBlock -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutPublicAccessBlockRequest method. -// req, resp := client.PutPublicAccessBlockRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutPublicAccessBlock -func (c *S3) PutPublicAccessBlockRequest(input *PutPublicAccessBlockInput) (req *request.Request, output *PutPublicAccessBlockOutput) { - op := &request.Operation{ - Name: opPutPublicAccessBlock, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}?publicAccessBlock", - } - - if input == nil { - input = &PutPublicAccessBlockInput{} - } - - output = &PutPublicAccessBlockOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(request.NamedHandler{ - Name: "contentMd5Handler", - Fn: checksum.AddBodyContentMD5Handler, - }) - return -} - -// PutPublicAccessBlock API operation for Amazon Simple Storage Service. -// -// Creates or modifies the PublicAccessBlock configuration for an Amazon S3 -// bucket. To use this operation, you must have the s3:PutBucketPublicAccessBlock -// permission. For more information about Amazon S3 permissions, see Specifying -// Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html). -// -// When Amazon S3 evaluates the PublicAccessBlock configuration for a bucket -// or an object, it checks the PublicAccessBlock configuration for both the -// bucket (or the bucket that contains the object) and the bucket owner's account. -// If the PublicAccessBlock configurations are different between the bucket -// and the account, Amazon S3 uses the most restrictive combination of the bucket-level -// and account-level settings. -// -// For more information about when Amazon S3 considers a bucket or an object -// public, see The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status). -// -// Related Resources -// -// - GetPublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetPublicAccessBlock.html) -// -// - DeletePublicAccessBlock (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeletePublicAccessBlock.html) -// -// - GetBucketPolicyStatus (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketPolicyStatus.html) -// -// - Using Amazon S3 Block Public Access (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation PutPublicAccessBlock for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/PutPublicAccessBlock -func (c *S3) PutPublicAccessBlock(input *PutPublicAccessBlockInput) (*PutPublicAccessBlockOutput, error) { - req, out := c.PutPublicAccessBlockRequest(input) - return out, req.Send() -} - -// PutPublicAccessBlockWithContext is the same as PutPublicAccessBlock with the addition of -// the ability to pass a context and additional request options. -// -// See PutPublicAccessBlock for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) PutPublicAccessBlockWithContext(ctx aws.Context, input *PutPublicAccessBlockInput, opts ...request.Option) (*PutPublicAccessBlockOutput, error) { - req, out := c.PutPublicAccessBlockRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opRestoreObject = "RestoreObject" - -// RestoreObjectRequest generates a "aws/request.Request" representing the -// client's request for the RestoreObject operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See RestoreObject for more information on using the RestoreObject -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the RestoreObjectRequest method. -// req, resp := client.RestoreObjectRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreObject -func (c *S3) RestoreObjectRequest(input *RestoreObjectInput) (req *request.Request, output *RestoreObjectOutput) { - op := &request.Operation{ - Name: opRestoreObject, - HTTPMethod: "POST", - HTTPPath: "/{Bucket}/{Key+}?restore", - } - - if input == nil { - input = &RestoreObjectInput{} - } - - output = &RestoreObjectOutput{} - req = c.newRequest(op, input, output) - return -} - -// RestoreObject API operation for Amazon Simple Storage Service. -// -// # Restores an archived copy of an object back into Amazon S3 -// -// This action is not supported by Amazon S3 on Outposts. -// -// This action performs the following types of requests: -// -// - select - Perform a select query on an archived object -// -// - restore an archive - Restore an archived object -// -// To use this operation, you must have permissions to perform the s3:RestoreObject -// action. The bucket owner has this permission by default and can grant this -// permission to others. For more information about permissions, see Permissions -// Related to Bucket Subresource Operations (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources) -// and Managing Access Permissions to Your Amazon S3 Resources (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html) -// in the Amazon S3 User Guide. -// -// # Querying Archives with Select Requests -// -// You use a select type of request to perform SQL queries on archived objects. -// The archived objects that are being queried by the select request must be -// formatted as uncompressed comma-separated values (CSV) files. You can run -// queries and custom analytics on your archived data without having to restore -// your data to a hotter Amazon S3 tier. For an overview about select requests, -// see Querying Archived Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/querying-glacier-archives.html) -// in the Amazon S3 User Guide. -// -// When making a select request, do the following: -// -// - Define an output location for the select query's output. This must be -// an Amazon S3 bucket in the same Amazon Web Services Region as the bucket -// that contains the archive object that is being queried. The Amazon Web -// Services account that initiates the job must have permissions to write -// to the S3 bucket. You can specify the storage class and encryption for -// the output objects stored in the bucket. For more information about output, -// see Querying Archived Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/querying-glacier-archives.html) -// in the Amazon S3 User Guide. For more information about the S3 structure -// in the request body, see the following: PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) -// Managing Access with ACLs (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3_ACLs_UsingACLs.html) -// in the Amazon S3 User Guide Protecting Data Using Server-Side Encryption -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html) -// in the Amazon S3 User Guide -// -// - Define the SQL expression for the SELECT type of restoration for your -// query in the request body's SelectParameters structure. You can use expressions -// like the following examples. The following expression returns all records -// from the specified object. SELECT * FROM Object Assuming that you are -// not using any headers for data stored in the object, you can specify columns -// with positional headers. SELECT s._1, s._2 FROM Object s WHERE s._3 > -// 100 If you have headers and you set the fileHeaderInfo in the CSV structure -// in the request body to USE, you can specify headers in the query. (If -// you set the fileHeaderInfo field to IGNORE, the first row is skipped for -// the query.) You cannot mix ordinal positions with header column names. -// SELECT s.Id, s.FirstName, s.SSN FROM S3Object s -// -// For more information about using SQL with S3 Glacier Select restore, see -// SQL Reference for Amazon S3 Select and S3 Glacier Select (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-glacier-select-sql-reference.html) -// in the Amazon S3 User Guide. -// -// When making a select request, you can also do the following: -// -// - To expedite your queries, specify the Expedited tier. For more information -// about tiers, see "Restoring Archives," later in this topic. -// -// - Specify details about the data serialization format of both the input -// object that is being queried and the serialization of the CSV-encoded -// query results. -// -// The following are additional important facts about the select feature: -// -// - The output results are new Amazon S3 objects. Unlike archive retrievals, -// they are stored until explicitly deleted-manually or through a lifecycle -// policy. -// -// - You can issue more than one select request on the same Amazon S3 object. -// Amazon S3 doesn't deduplicate requests, so avoid issuing duplicate requests. -// -// - Amazon S3 accepts a select request even if the object has already been -// restored. A select request doesn’t return error response 409. -// -// # Restoring objects -// -// Objects that you archive to the S3 Glacier or S3 Glacier Deep Archive storage -// class, and S3 Intelligent-Tiering Archive or S3 Intelligent-Tiering Deep -// Archive tiers are not accessible in real time. For objects in Archive Access -// or Deep Archive Access tiers you must first initiate a restore request, and -// then wait until the object is moved into the Frequent Access tier. For objects -// in S3 Glacier or S3 Glacier Deep Archive storage classes you must first initiate -// a restore request, and then wait until a temporary copy of the object is -// available. To access an archived object, you must restore the object for -// the duration (number of days) that you specify. -// -// To restore a specific object version, you can provide a version ID. If you -// don't provide a version ID, Amazon S3 restores the current version. -// -// When restoring an archived object (or using a select request), you can specify -// one of the following data access tier options in the Tier element of the -// request body: -// -// - Expedited - Expedited retrievals allow you to quickly access your data -// stored in the S3 Glacier storage class or S3 Intelligent-Tiering Archive -// tier when occasional urgent requests for a subset of archives are required. -// For all but the largest archived objects (250 MB+), data accessed using -// Expedited retrievals is typically made available within 1–5 minutes. -// Provisioned capacity ensures that retrieval capacity for Expedited retrievals -// is available when you need it. Expedited retrievals and provisioned capacity -// are not available for objects stored in the S3 Glacier Deep Archive storage -// class or S3 Intelligent-Tiering Deep Archive tier. -// -// - Standard - Standard retrievals allow you to access any of your archived -// objects within several hours. This is the default option for retrieval -// requests that do not specify the retrieval option. Standard retrievals -// typically finish within 3–5 hours for objects stored in the S3 Glacier -// storage class or S3 Intelligent-Tiering Archive tier. They typically finish -// within 12 hours for objects stored in the S3 Glacier Deep Archive storage -// class or S3 Intelligent-Tiering Deep Archive tier. Standard retrievals -// are free for objects stored in S3 Intelligent-Tiering. -// -// - Bulk - Bulk retrievals are the lowest-cost retrieval option in S3 Glacier, -// enabling you to retrieve large amounts, even petabytes, of data inexpensively. -// Bulk retrievals typically finish within 5–12 hours for objects stored -// in the S3 Glacier storage class or S3 Intelligent-Tiering Archive tier. -// They typically finish within 48 hours for objects stored in the S3 Glacier -// Deep Archive storage class or S3 Intelligent-Tiering Deep Archive tier. -// Bulk retrievals are free for objects stored in S3 Intelligent-Tiering. -// -// For more information about archive retrieval options and provisioned capacity -// for Expedited data access, see Restoring Archived Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html) -// in the Amazon S3 User Guide. -// -// You can use Amazon S3 restore speed upgrade to change the restore speed to -// a faster speed while it is in progress. For more information, see Upgrading -// the speed of an in-progress restore (https://docs.aws.amazon.com/AmazonS3/latest/dev/restoring-objects.html#restoring-objects-upgrade-tier.title.html) -// in the Amazon S3 User Guide. -// -// To get the status of object restoration, you can send a HEAD request. Operations -// return the x-amz-restore header, which provides information about the restoration -// status, in the response. You can use Amazon S3 event notifications to notify -// you when a restore is initiated or completed. For more information, see Configuring -// Amazon S3 Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) -// in the Amazon S3 User Guide. -// -// After restoring an archived object, you can update the restoration period -// by reissuing the request with a new period. Amazon S3 updates the restoration -// period relative to the current time and charges only for the request-there -// are no data transfer charges. You cannot update the restoration period when -// Amazon S3 is actively processing your current restore request for the object. -// -// If your bucket has a lifecycle configuration with a rule that includes an -// expiration action, the object expiration overrides the life span that you -// specify in a restore request. For example, if you restore an object copy -// for 10 days, but the object is scheduled to expire in 3 days, Amazon S3 deletes -// the object in 3 days. For more information about lifecycle configuration, -// see PutBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html) -// and Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) -// in Amazon S3 User Guide. -// -// # Responses -// -// A successful action returns either the 200 OK or 202 Accepted status code. -// -// - If the object is not previously restored, then Amazon S3 returns 202 -// Accepted in the response. -// -// - If the object is previously restored, Amazon S3 returns 200 OK in the -// response. -// -// Special Errors -// -// - Code: RestoreAlreadyInProgress Cause: Object restore is already in progress. -// (This error does not apply to SELECT type requests.) HTTP Status Code: -// 409 Conflict SOAP Fault Code Prefix: Client -// -// - Code: GlacierExpeditedRetrievalNotAvailable Cause: expedited retrievals -// are currently not available. Try again later. (Returned if there is insufficient -// capacity to process the Expedited request. This error applies only to -// Expedited retrievals and not to S3 Standard or Bulk retrievals.) HTTP -// Status Code: 503 SOAP Fault Code Prefix: N/A -// -// Related Resources -// -// - PutBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html) -// -// - GetBucketNotificationConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketNotificationConfiguration.html) -// -// - SQL Reference for Amazon S3 Select and S3 Glacier Select (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-glacier-select-sql-reference.html) -// in the Amazon S3 User Guide -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation RestoreObject for usage and error information. -// -// Returned Error Codes: -// - ErrCodeObjectAlreadyInActiveTierError "ObjectAlreadyInActiveTierError" -// This action is not allowed against this storage tier. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/RestoreObject -func (c *S3) RestoreObject(input *RestoreObjectInput) (*RestoreObjectOutput, error) { - req, out := c.RestoreObjectRequest(input) - return out, req.Send() -} - -// RestoreObjectWithContext is the same as RestoreObject with the addition of -// the ability to pass a context and additional request options. -// -// See RestoreObject for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) RestoreObjectWithContext(ctx aws.Context, input *RestoreObjectInput, opts ...request.Option) (*RestoreObjectOutput, error) { - req, out := c.RestoreObjectRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opSelectObjectContent = "SelectObjectContent" - -// SelectObjectContentRequest generates a "aws/request.Request" representing the -// client's request for the SelectObjectContent operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See SelectObjectContent for more information on using the SelectObjectContent -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the SelectObjectContentRequest method. -// req, resp := client.SelectObjectContentRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/SelectObjectContent -func (c *S3) SelectObjectContentRequest(input *SelectObjectContentInput) (req *request.Request, output *SelectObjectContentOutput) { - op := &request.Operation{ - Name: opSelectObjectContent, - HTTPMethod: "POST", - HTTPPath: "/{Bucket}/{Key+}?select&select-type=2", - } - - if input == nil { - input = &SelectObjectContentInput{} - } - - output = &SelectObjectContentOutput{} - req = c.newRequest(op, input, output) - - es := NewSelectObjectContentEventStream() - req.Handlers.Unmarshal.PushBack(es.setStreamCloser) - output.EventStream = es - - req.Handlers.Send.Swap(client.LogHTTPResponseHandler.Name, client.LogHTTPResponseHeaderHandler) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, rest.UnmarshalHandler) - req.Handlers.Unmarshal.PushBack(es.runOutputStream) - req.Handlers.Unmarshal.PushBack(es.runOnStreamPartClose) - return -} - -// SelectObjectContent API operation for Amazon Simple Storage Service. -// -// This action filters the contents of an Amazon S3 object based on a simple -// structured query language (SQL) statement. In the request, along with the -// SQL expression, you must also specify a data serialization format (JSON, -// CSV, or Apache Parquet) of the object. Amazon S3 uses this format to parse -// object data into records, and returns only records that match the specified -// SQL expression. You must also specify the data serialization format for the -// response. -// -// This action is not supported by Amazon S3 on Outposts. -// -// For more information about Amazon S3 Select, see Selecting Content from Objects -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/selecting-content-from-objects.html) -// and SELECT Command (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-glacier-select-sql-reference-select.html) -// in the Amazon S3 User Guide. -// -// For more information about using SQL with Amazon S3 Select, see SQL Reference -// for Amazon S3 Select and S3 Glacier Select (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-glacier-select-sql-reference.html) -// in the Amazon S3 User Guide. -// -// # Permissions -// -// You must have s3:GetObject permission for this operation. Amazon S3 Select -// does not support anonymous access. For more information about permissions, -// see Specifying Permissions in a Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html) -// in the Amazon S3 User Guide. -// -// # Object Data Formats -// -// You can use Amazon S3 Select to query objects that have the following format -// properties: -// -// - CSV, JSON, and Parquet - Objects must be in CSV, JSON, or Parquet format. -// -// - UTF-8 - UTF-8 is the only encoding type Amazon S3 Select supports. -// -// - GZIP or BZIP2 - CSV and JSON files can be compressed using GZIP or BZIP2. -// GZIP and BZIP2 are the only compression formats that Amazon S3 Select -// supports for CSV and JSON files. Amazon S3 Select supports columnar compression -// for Parquet using GZIP or Snappy. Amazon S3 Select does not support whole-object -// compression for Parquet objects. -// -// - Server-side encryption - Amazon S3 Select supports querying objects -// that are protected with server-side encryption. For objects that are encrypted -// with customer-provided encryption keys (SSE-C), you must use HTTPS, and -// you must use the headers that are documented in the GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html). -// For more information about SSE-C, see Server-Side Encryption (Using Customer-Provided -// Encryption Keys) (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) -// in the Amazon S3 User Guide. For objects that are encrypted with Amazon -// S3 managed encryption keys (SSE-S3) and Amazon Web Services KMS keys (SSE-KMS), -// server-side encryption is handled transparently, so you don't need to -// specify anything. For more information about server-side encryption, including -// SSE-S3 and SSE-KMS, see Protecting Data Using Server-Side Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/serv-side-encryption.html) -// in the Amazon S3 User Guide. -// -// # Working with the Response Body -// -// Given the response size is unknown, Amazon S3 Select streams the response -// as a series of messages and includes a Transfer-Encoding header with chunked -// as its value in the response. For more information, see Appendix: SelectObjectContent -// Response (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTSelectObjectAppendix.html). -// -// # GetObject Support -// -// The SelectObjectContent action does not support the following GetObject functionality. -// For more information, see GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html). -// -// - Range: Although you can specify a scan range for an Amazon S3 Select -// request (see SelectObjectContentRequest - ScanRange (https://docs.aws.amazon.com/AmazonS3/latest/API/API_SelectObjectContent.html#AmazonS3-SelectObjectContent-request-ScanRange) -// in the request parameters), you cannot specify the range of bytes of an -// object to return. -// -// - GLACIER, DEEP_ARCHIVE and REDUCED_REDUNDANCY storage classes: You cannot -// specify the GLACIER, DEEP_ARCHIVE, or REDUCED_REDUNDANCY storage classes. -// For more information, about storage classes see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html#storage-class-intro) -// in the Amazon S3 User Guide. -// -// # Special Errors -// -// For a list of special errors for this operation, see List of SELECT Object -// Content Error Codes (https://docs.aws.amazon.com/AmazonS3/latest/API/ErrorResponses.html#SelectObjectContentErrorCodeList) -// -// Related Resources -// -// - GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html) -// -// - GetBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html) -// -// - PutBucketLifecycleConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation SelectObjectContent for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/SelectObjectContent -func (c *S3) SelectObjectContent(input *SelectObjectContentInput) (*SelectObjectContentOutput, error) { - req, out := c.SelectObjectContentRequest(input) - return out, req.Send() -} - -// SelectObjectContentWithContext is the same as SelectObjectContent with the addition of -// the ability to pass a context and additional request options. -// -// See SelectObjectContent for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) SelectObjectContentWithContext(ctx aws.Context, input *SelectObjectContentInput, opts ...request.Option) (*SelectObjectContentOutput, error) { - req, out := c.SelectObjectContentRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -var _ awserr.Error - -// SelectObjectContentEventStream provides the event stream handling for the SelectObjectContent. -// -// For testing and mocking the event stream this type should be initialized via -// the NewSelectObjectContentEventStream constructor function. Using the functional options -// to pass in nested mock behavior. -type SelectObjectContentEventStream struct { - - // Reader is the EventStream reader for the SelectObjectContentEventStream - // events. This value is automatically set by the SDK when the API call is made - // Use this member when unit testing your code with the SDK to mock out the - // EventStream Reader. - // - // Must not be nil. - Reader SelectObjectContentEventStreamReader - - outputReader io.ReadCloser - - // StreamCloser is the io.Closer for the EventStream connection. For HTTP - // EventStream this is the response Body. The stream will be closed when - // the Close method of the EventStream is called. - StreamCloser io.Closer - - done chan struct{} - closeOnce sync.Once - err *eventstreamapi.OnceError -} - -// NewSelectObjectContentEventStream initializes an SelectObjectContentEventStream. -// This function should only be used for testing and mocking the SelectObjectContentEventStream -// stream within your application. -// -// The Reader member must be set before reading events from the stream. -// -// The StreamCloser member should be set to the underlying io.Closer, -// (e.g. http.Response.Body), that will be closed when the stream Close method -// is called. -// -// es := NewSelectObjectContentEventStream(func(o *SelectObjectContentEventStream){ -// es.Reader = myMockStreamReader -// es.StreamCloser = myMockStreamCloser -// }) -func NewSelectObjectContentEventStream(opts ...func(*SelectObjectContentEventStream)) *SelectObjectContentEventStream { - es := &SelectObjectContentEventStream{ - done: make(chan struct{}), - err: eventstreamapi.NewOnceError(), - } - - for _, fn := range opts { - fn(es) - } - - return es -} - -func (es *SelectObjectContentEventStream) setStreamCloser(r *request.Request) { - es.StreamCloser = r.HTTPResponse.Body -} - -func (es *SelectObjectContentEventStream) runOnStreamPartClose(r *request.Request) { - if es.done == nil { - return - } - go es.waitStreamPartClose() - -} - -func (es *SelectObjectContentEventStream) waitStreamPartClose() { - var outputErrCh <-chan struct{} - if v, ok := es.Reader.(interface{ ErrorSet() <-chan struct{} }); ok { - outputErrCh = v.ErrorSet() - } - var outputClosedCh <-chan struct{} - if v, ok := es.Reader.(interface{ Closed() <-chan struct{} }); ok { - outputClosedCh = v.Closed() - } - - select { - case <-es.done: - case <-outputErrCh: - es.err.SetError(es.Reader.Err()) - es.Close() - case <-outputClosedCh: - if err := es.Reader.Err(); err != nil { - es.err.SetError(es.Reader.Err()) - } - es.Close() - } -} - -// Events returns a channel to read events from. -// -// These events are: -// -// - ContinuationEvent -// - EndEvent -// - ProgressEvent -// - RecordsEvent -// - StatsEvent -// - SelectObjectContentEventStreamUnknownEvent -func (es *SelectObjectContentEventStream) Events() <-chan SelectObjectContentEventStreamEvent { - return es.Reader.Events() -} - -func (es *SelectObjectContentEventStream) runOutputStream(r *request.Request) { - var opts []func(*eventstream.Decoder) - if r.Config.Logger != nil && r.Config.LogLevel.Matches(aws.LogDebugWithEventStreamBody) { - opts = append(opts, eventstream.DecodeWithLogger(r.Config.Logger)) - } - - unmarshalerForEvent := unmarshalerForSelectObjectContentEventStreamEvent{ - metadata: protocol.ResponseMetadata{ - StatusCode: r.HTTPResponse.StatusCode, - RequestID: r.RequestID, - }, - }.UnmarshalerForEventName - - decoder := eventstream.NewDecoder(r.HTTPResponse.Body, opts...) - eventReader := eventstreamapi.NewEventReader(decoder, - protocol.HandlerPayloadUnmarshal{ - Unmarshalers: r.Handlers.UnmarshalStream, - }, - unmarshalerForEvent, - ) - - es.outputReader = r.HTTPResponse.Body - es.Reader = newReadSelectObjectContentEventStream(eventReader) -} - -// Close closes the stream. This will also cause the stream to be closed. -// Close must be called when done using the stream API. Not calling Close -// may result in resource leaks. -// -// You can use the closing of the Reader's Events channel to terminate your -// application's read from the API's stream. -func (es *SelectObjectContentEventStream) Close() (err error) { - es.closeOnce.Do(es.safeClose) - return es.Err() -} - -func (es *SelectObjectContentEventStream) safeClose() { - if es.done != nil { - close(es.done) - } - - es.Reader.Close() - if es.outputReader != nil { - es.outputReader.Close() - } - - es.StreamCloser.Close() -} - -// Err returns any error that occurred while reading or writing EventStream -// Events from the service API's response. Returns nil if there were no errors. -func (es *SelectObjectContentEventStream) Err() error { - if err := es.err.Err(); err != nil { - return err - } - if err := es.Reader.Err(); err != nil { - return err - } - - return nil -} - -const opUploadPart = "UploadPart" - -// UploadPartRequest generates a "aws/request.Request" representing the -// client's request for the UploadPart operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UploadPart for more information on using the UploadPart -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the UploadPartRequest method. -// req, resp := client.UploadPartRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPart -func (c *S3) UploadPartRequest(input *UploadPartInput) (req *request.Request, output *UploadPartOutput) { - op := &request.Operation{ - Name: opUploadPart, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}/{Key+}", - } - - if input == nil { - input = &UploadPartInput{} - } - - output = &UploadPartOutput{} - req = c.newRequest(op, input, output) - return -} - -// UploadPart API operation for Amazon Simple Storage Service. -// -// Uploads a part in a multipart upload. -// -// In this operation, you provide part data in your request. However, you have -// an option to specify your existing Amazon S3 object as a data source for -// the part you are uploading. To upload a part from an existing object, you -// use the UploadPartCopy (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html) -// operation. -// -// You must initiate a multipart upload (see CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html)) -// before you can upload any part. In response to your initiate request, Amazon -// S3 returns an upload ID, a unique identifier, that you must include in your -// upload part request. -// -// Part numbers can be any number from 1 to 10,000, inclusive. A part number -// uniquely identifies a part and also defines its position within the object -// being created. If you upload a new part using the same part number that was -// used with a previous part, the previously uploaded part is overwritten. -// -// For information about maximum and minimum part sizes and other multipart -// upload specifications, see Multipart upload limits (https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html) -// in the Amazon S3 User Guide. -// -// To ensure that data is not corrupted when traversing the network, specify -// the Content-MD5 header in the upload part request. Amazon S3 checks the part -// data against the provided MD5 value. If they do not match, Amazon S3 returns -// an error. -// -// If the upload request is signed with Signature Version 4, then Amazon Web -// Services S3 uses the x-amz-content-sha256 header as a checksum instead of -// Content-MD5. For more information see Authenticating Requests: Using the -// Authorization Header (Amazon Web Services Signature Version 4) (https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html). -// -// Note: After you initiate multipart upload and upload one or more parts, you -// must either complete or abort multipart upload in order to stop getting charged -// for storage of the uploaded parts. Only after you either complete or abort -// multipart upload, Amazon S3 frees up the parts storage and stops charging -// you for the parts storage. -// -// For more information on multipart uploads, go to Multipart Upload Overview -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html) in the -// Amazon S3 User Guide . -// -// For information on the permissions required to use the multipart upload API, -// go to Multipart Upload and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html) -// in the Amazon S3 User Guide. -// -// You can optionally request server-side encryption where Amazon S3 encrypts -// your data as it writes it to disks in its data centers and decrypts it for -// you when you access it. You have the option of providing your own encryption -// key, or you can use the Amazon Web Services managed encryption keys. If you -// choose to provide your own encryption key, the request headers you provide -// in the request must match the headers you used in the request to initiate -// the upload by using CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html). -// For more information, go to Using Server-Side Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingServerSideEncryption.html) -// in the Amazon S3 User Guide. -// -// Server-side encryption is supported by the S3 Multipart Upload actions. Unless -// you are using a customer-provided encryption key, you don't need to specify -// the encryption parameters in each UploadPart request. Instead, you only need -// to specify the server-side encryption parameters in the initial Initiate -// Multipart request. For more information, see CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html). -// -// If you requested server-side encryption using a customer-provided encryption -// key in your initiate multipart upload request, you must provide identical -// encryption information in each part upload using the following headers. -// -// - x-amz-server-side-encryption-customer-algorithm -// -// - x-amz-server-side-encryption-customer-key -// -// - x-amz-server-side-encryption-customer-key-MD5 -// -// Special Errors -// -// - Code: NoSuchUpload Cause: The specified multipart upload does not exist. -// The upload ID might be invalid, or the multipart upload might have been -// aborted or completed. HTTP Status Code: 404 Not Found SOAP Fault Code -// Prefix: Client -// -// Related Resources -// -// - CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) -// -// - CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) -// -// - AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) -// -// - ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) -// -// - ListMultipartUploads (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation UploadPart for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPart -func (c *S3) UploadPart(input *UploadPartInput) (*UploadPartOutput, error) { - req, out := c.UploadPartRequest(input) - return out, req.Send() -} - -// UploadPartWithContext is the same as UploadPart with the addition of -// the ability to pass a context and additional request options. -// -// See UploadPart for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) UploadPartWithContext(ctx aws.Context, input *UploadPartInput, opts ...request.Option) (*UploadPartOutput, error) { - req, out := c.UploadPartRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUploadPartCopy = "UploadPartCopy" - -// UploadPartCopyRequest generates a "aws/request.Request" representing the -// client's request for the UploadPartCopy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UploadPartCopy for more information on using the UploadPartCopy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the UploadPartCopyRequest method. -// req, resp := client.UploadPartCopyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartCopy -func (c *S3) UploadPartCopyRequest(input *UploadPartCopyInput) (req *request.Request, output *UploadPartCopyOutput) { - op := &request.Operation{ - Name: opUploadPartCopy, - HTTPMethod: "PUT", - HTTPPath: "/{Bucket}/{Key+}", - } - - if input == nil { - input = &UploadPartCopyInput{} - } - - output = &UploadPartCopyOutput{} - req = c.newRequest(op, input, output) - return -} - -// UploadPartCopy API operation for Amazon Simple Storage Service. -// -// Uploads a part by copying data from an existing object as data source. You -// specify the data source by adding the request header x-amz-copy-source in -// your request and a byte range by adding the request header x-amz-copy-source-range -// in your request. -// -// For information about maximum and minimum part sizes and other multipart -// upload specifications, see Multipart upload limits (https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html) -// in the Amazon S3 User Guide. -// -// Instead of using an existing object as part data, you might use the UploadPart -// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) action -// and provide data in your request. -// -// You must initiate a multipart upload before you can upload any part. In response -// to your initiate request. Amazon S3 returns a unique identifier, the upload -// ID, that you must include in your upload part request. -// -// For more information about using the UploadPartCopy operation, see the following: -// -// - For conceptual information about multipart uploads, see Uploading Objects -// Using Multipart Upload (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html) -// in the Amazon S3 User Guide. -// -// - For information about permissions required to use the multipart upload -// API, see Multipart Upload and Permissions (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html) -// in the Amazon S3 User Guide. -// -// - For information about copying objects using a single atomic action vs. -// a multipart upload, see Operations on Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectOperations.html) -// in the Amazon S3 User Guide. -// -// - For information about using server-side encryption with customer-provided -// encryption keys with the UploadPartCopy operation, see CopyObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html) -// and UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html). -// -// Note the following additional considerations about the request headers x-amz-copy-source-if-match, -// x-amz-copy-source-if-none-match, x-amz-copy-source-if-unmodified-since, and -// x-amz-copy-source-if-modified-since: -// -// - Consideration 1 - If both of the x-amz-copy-source-if-match and x-amz-copy-source-if-unmodified-since -// headers are present in the request as follows: x-amz-copy-source-if-match -// condition evaluates to true, and; x-amz-copy-source-if-unmodified-since -// condition evaluates to false; Amazon S3 returns 200 OK and copies the -// data. -// -// - Consideration 2 - If both of the x-amz-copy-source-if-none-match and -// x-amz-copy-source-if-modified-since headers are present in the request -// as follows: x-amz-copy-source-if-none-match condition evaluates to false, -// and; x-amz-copy-source-if-modified-since condition evaluates to true; -// Amazon S3 returns 412 Precondition Failed response code. -// -// # Versioning -// -// If your bucket has versioning enabled, you could have multiple versions of -// the same object. By default, x-amz-copy-source identifies the current version -// of the object to copy. If the current version is a delete marker and you -// don't specify a versionId in the x-amz-copy-source, Amazon S3 returns a 404 -// error, because the object does not exist. If you specify versionId in the -// x-amz-copy-source and the versionId is a delete marker, Amazon S3 returns -// an HTTP 400 error, because you are not allowed to specify a delete marker -// as a version for the x-amz-copy-source. -// -// You can optionally specify a specific version of the source object to copy -// by adding the versionId subresource as shown in the following example: -// -// x-amz-copy-source: /bucket/object?versionId=version id -// -// Special Errors -// -// - Code: NoSuchUpload Cause: The specified multipart upload does not exist. -// The upload ID might be invalid, or the multipart upload might have been -// aborted or completed. HTTP Status Code: 404 Not Found -// -// - Code: InvalidRequest Cause: The specified copy source is not supported -// as a byte-range copy source. HTTP Status Code: 400 Bad Request -// -// Related Resources -// -// - CreateMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html) -// -// - UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) -// -// - CompleteMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) -// -// - AbortMultipartUpload (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html) -// -// - ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html) -// -// - ListMultipartUploads (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html) -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation UploadPartCopy for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/UploadPartCopy -func (c *S3) UploadPartCopy(input *UploadPartCopyInput) (*UploadPartCopyOutput, error) { - req, out := c.UploadPartCopyRequest(input) - return out, req.Send() -} - -// UploadPartCopyWithContext is the same as UploadPartCopy with the addition of -// the ability to pass a context and additional request options. -// -// See UploadPartCopy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) UploadPartCopyWithContext(ctx aws.Context, input *UploadPartCopyInput, opts ...request.Option) (*UploadPartCopyOutput, error) { - req, out := c.UploadPartCopyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opWriteGetObjectResponse = "WriteGetObjectResponse" - -// WriteGetObjectResponseRequest generates a "aws/request.Request" representing the -// client's request for the WriteGetObjectResponse operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See WriteGetObjectResponse for more information on using the WriteGetObjectResponse -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the WriteGetObjectResponseRequest method. -// req, resp := client.WriteGetObjectResponseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/WriteGetObjectResponse -func (c *S3) WriteGetObjectResponseRequest(input *WriteGetObjectResponseInput) (req *request.Request, output *WriteGetObjectResponseOutput) { - op := &request.Operation{ - Name: opWriteGetObjectResponse, - HTTPMethod: "POST", - HTTPPath: "/WriteGetObjectResponse", - } - - if input == nil { - input = &WriteGetObjectResponseInput{} - } - - output = &WriteGetObjectResponseOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Sign.Remove(v4.SignRequestHandler) - handler := v4.BuildNamedHandler("v4.CustomSignerHandler", v4.WithUnsignedPayload) - req.Handlers.Sign.PushFrontNamed(handler) - req.Handlers.Unmarshal.Swap(restxml.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - req.Handlers.Build.PushBackNamed(protocol.NewHostPrefixHandler("{RequestRoute}.", input.hostLabels)) - req.Handlers.Build.PushBackNamed(protocol.ValidateEndpointHostHandler) - return -} - -// WriteGetObjectResponse API operation for Amazon Simple Storage Service. -// -// Passes transformed objects to a GetObject operation when using Object Lambda -// access points. For information about Object Lambda access points, see Transforming -// objects with Object Lambda access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/transforming-objects.html) -// in the Amazon S3 User Guide. -// -// This operation supports metadata that can be returned by GetObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html), -// in addition to RequestRoute, RequestToken, StatusCode, ErrorCode, and ErrorMessage. -// The GetObject response metadata is supported so that the WriteGetObjectResponse -// caller, typically an Lambda function, can provide the same metadata when -// it internally invokes GetObject. When WriteGetObjectResponse is called by -// a customer-owned Lambda function, the metadata returned to the end user GetObject -// call might differ from what Amazon S3 would normally return. -// -// You can include any number of metadata headers. When including a metadata -// header, it should be prefaced with x-amz-meta. For example, x-amz-meta-my-custom-header: -// MyCustomValue. The primary use case for this is to forward GetObject metadata. -// -// Amazon Web Services provides some prebuilt Lambda functions that you can -// use with S3 Object Lambda to detect and redact personally identifiable information -// (PII) and decompress S3 objects. These Lambda functions are available in -// the Amazon Web Services Serverless Application Repository, and can be selected -// through the Amazon Web Services Management Console when you create your Object -// Lambda access point. -// -// Example 1: PII Access Control - This Lambda function uses Amazon Comprehend, -// a natural language processing (NLP) service using machine learning to find -// insights and relationships in text. It automatically detects personally identifiable -// information (PII) such as names, addresses, dates, credit card numbers, and -// social security numbers from documents in your Amazon S3 bucket. -// -// Example 2: PII Redaction - This Lambda function uses Amazon Comprehend, a -// natural language processing (NLP) service using machine learning to find -// insights and relationships in text. It automatically redacts personally identifiable -// information (PII) such as names, addresses, dates, credit card numbers, and -// social security numbers from documents in your Amazon S3 bucket. -// -// Example 3: Decompression - The Lambda function S3ObjectLambdaDecompression, -// is equipped to decompress objects stored in S3 in one of six compressed file -// formats including bzip2, gzip, snappy, zlib, zstandard and ZIP. -// -// For information on how to view and use these functions, see Using Amazon -// Web Services built Lambda functions (https://docs.aws.amazon.com/AmazonS3/latest/userguide/olap-examples.html) -// in the Amazon S3 User Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for Amazon Simple Storage Service's -// API operation WriteGetObjectResponse for usage and error information. -// See also, https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01/WriteGetObjectResponse -func (c *S3) WriteGetObjectResponse(input *WriteGetObjectResponseInput) (*WriteGetObjectResponseOutput, error) { - req, out := c.WriteGetObjectResponseRequest(input) - return out, req.Send() -} - -// WriteGetObjectResponseWithContext is the same as WriteGetObjectResponse with the addition of -// the ability to pass a context and additional request options. -// -// See WriteGetObjectResponse for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) WriteGetObjectResponseWithContext(ctx aws.Context, input *WriteGetObjectResponseInput, opts ...request.Option) (*WriteGetObjectResponseOutput, error) { - req, out := c.WriteGetObjectResponseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Specifies the days since the initiation of an incomplete multipart upload -// that Amazon S3 will wait before permanently removing all parts of the upload. -// For more information, see Aborting Incomplete Multipart Uploads Using a Bucket -// Lifecycle Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config) -// in the Amazon S3 User Guide. -type AbortIncompleteMultipartUpload struct { - _ struct{} `type:"structure"` - - // Specifies the number of days after which Amazon S3 aborts an incomplete multipart - // upload. - DaysAfterInitiation *int64 `type:"integer"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AbortIncompleteMultipartUpload) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AbortIncompleteMultipartUpload) GoString() string { - return s.String() -} - -// SetDaysAfterInitiation sets the DaysAfterInitiation field's value. -func (s *AbortIncompleteMultipartUpload) SetDaysAfterInitiation(v int64) *AbortIncompleteMultipartUpload { - s.DaysAfterInitiation = &v - return s -} - -type AbortMultipartUploadInput struct { - _ struct{} `locationName:"AbortMultipartUploadRequest" type:"structure"` - - // The bucket name to which the upload was taking place. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Key of the object for which the multipart upload was initiated. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // Upload ID that identifies the multipart upload. - // - // UploadId is a required field - UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AbortMultipartUploadInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AbortMultipartUploadInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AbortMultipartUploadInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AbortMultipartUploadInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *AbortMultipartUploadInput) SetBucket(v string) *AbortMultipartUploadInput { - s.Bucket = &v - return s -} - -func (s *AbortMultipartUploadInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *AbortMultipartUploadInput) SetExpectedBucketOwner(v string) *AbortMultipartUploadInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetKey sets the Key field's value. -func (s *AbortMultipartUploadInput) SetKey(v string) *AbortMultipartUploadInput { - s.Key = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *AbortMultipartUploadInput) SetRequestPayer(v string) *AbortMultipartUploadInput { - s.RequestPayer = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *AbortMultipartUploadInput) SetUploadId(v string) *AbortMultipartUploadInput { - s.UploadId = &v - return s -} - -func (s *AbortMultipartUploadInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *AbortMultipartUploadInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s AbortMultipartUploadInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type AbortMultipartUploadOutput struct { - _ struct{} `type:"structure"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AbortMultipartUploadOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AbortMultipartUploadOutput) GoString() string { - return s.String() -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *AbortMultipartUploadOutput) SetRequestCharged(v string) *AbortMultipartUploadOutput { - s.RequestCharged = &v - return s -} - -// Configures the transfer acceleration state for an Amazon S3 bucket. For more -// information, see Amazon S3 Transfer Acceleration (https://docs.aws.amazon.com/AmazonS3/latest/dev/transfer-acceleration.html) -// in the Amazon S3 User Guide. -type AccelerateConfiguration struct { - _ struct{} `type:"structure"` - - // Specifies the transfer acceleration status of the bucket. - Status *string `type:"string" enum:"BucketAccelerateStatus"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccelerateConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccelerateConfiguration) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *AccelerateConfiguration) SetStatus(v string) *AccelerateConfiguration { - s.Status = &v - return s -} - -// Contains the elements that set the ACL permissions for an object per grantee. -type AccessControlPolicy struct { - _ struct{} `type:"structure"` - - // A list of grants. - Grants []*Grant `locationName:"AccessControlList" locationNameList:"Grant" type:"list"` - - // Container for the bucket owner's display name and ID. - Owner *Owner `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccessControlPolicy) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccessControlPolicy) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AccessControlPolicy) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AccessControlPolicy"} - if s.Grants != nil { - for i, v := range s.Grants { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Grants", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGrants sets the Grants field's value. -func (s *AccessControlPolicy) SetGrants(v []*Grant) *AccessControlPolicy { - s.Grants = v - return s -} - -// SetOwner sets the Owner field's value. -func (s *AccessControlPolicy) SetOwner(v *Owner) *AccessControlPolicy { - s.Owner = v - return s -} - -// A container for information about access control for replicas. -type AccessControlTranslation struct { - _ struct{} `type:"structure"` - - // Specifies the replica ownership. For default and valid values, see PUT bucket - // replication (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html) - // in the Amazon S3 API Reference. - // - // Owner is a required field - Owner *string `type:"string" required:"true" enum:"OwnerOverride"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccessControlTranslation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AccessControlTranslation) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AccessControlTranslation) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AccessControlTranslation"} - if s.Owner == nil { - invalidParams.Add(request.NewErrParamRequired("Owner")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetOwner sets the Owner field's value. -func (s *AccessControlTranslation) SetOwner(v string) *AccessControlTranslation { - s.Owner = &v - return s -} - -// A conjunction (logical AND) of predicates, which is used in evaluating a -// metrics filter. The operator must have at least two predicates in any combination, -// and an object must match all of the predicates for the filter to apply. -type AnalyticsAndOperator struct { - _ struct{} `type:"structure"` - - // The prefix to use when evaluating an AND predicate: The prefix that an object - // must have to be included in the metrics results. - Prefix *string `type:"string"` - - // The list of tags to use when evaluating an AND predicate. - Tags []*Tag `locationName:"Tag" locationNameList:"Tag" type:"list" flattened:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AnalyticsAndOperator) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AnalyticsAndOperator) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AnalyticsAndOperator) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AnalyticsAndOperator"} - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPrefix sets the Prefix field's value. -func (s *AnalyticsAndOperator) SetPrefix(v string) *AnalyticsAndOperator { - s.Prefix = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *AnalyticsAndOperator) SetTags(v []*Tag) *AnalyticsAndOperator { - s.Tags = v - return s -} - -// Specifies the configuration and any analyses for the analytics filter of -// an Amazon S3 bucket. -type AnalyticsConfiguration struct { - _ struct{} `type:"structure"` - - // The filter used to describe a set of objects for analyses. A filter must - // have exactly one prefix, one tag, or one conjunction (AnalyticsAndOperator). - // If no filter is provided, all objects will be considered in any analysis. - Filter *AnalyticsFilter `type:"structure"` - - // The ID that identifies the analytics configuration. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // Contains data related to access patterns to be collected and made available - // to analyze the tradeoffs between different storage classes. - // - // StorageClassAnalysis is a required field - StorageClassAnalysis *StorageClassAnalysis `type:"structure" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AnalyticsConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AnalyticsConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AnalyticsConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AnalyticsConfiguration"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.StorageClassAnalysis == nil { - invalidParams.Add(request.NewErrParamRequired("StorageClassAnalysis")) - } - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - if s.StorageClassAnalysis != nil { - if err := s.StorageClassAnalysis.Validate(); err != nil { - invalidParams.AddNested("StorageClassAnalysis", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *AnalyticsConfiguration) SetFilter(v *AnalyticsFilter) *AnalyticsConfiguration { - s.Filter = v - return s -} - -// SetId sets the Id field's value. -func (s *AnalyticsConfiguration) SetId(v string) *AnalyticsConfiguration { - s.Id = &v - return s -} - -// SetStorageClassAnalysis sets the StorageClassAnalysis field's value. -func (s *AnalyticsConfiguration) SetStorageClassAnalysis(v *StorageClassAnalysis) *AnalyticsConfiguration { - s.StorageClassAnalysis = v - return s -} - -// Where to publish the analytics results. -type AnalyticsExportDestination struct { - _ struct{} `type:"structure"` - - // A destination signifying output to an S3 bucket. - // - // S3BucketDestination is a required field - S3BucketDestination *AnalyticsS3BucketDestination `type:"structure" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AnalyticsExportDestination) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AnalyticsExportDestination) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AnalyticsExportDestination) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AnalyticsExportDestination"} - if s.S3BucketDestination == nil { - invalidParams.Add(request.NewErrParamRequired("S3BucketDestination")) - } - if s.S3BucketDestination != nil { - if err := s.S3BucketDestination.Validate(); err != nil { - invalidParams.AddNested("S3BucketDestination", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3BucketDestination sets the S3BucketDestination field's value. -func (s *AnalyticsExportDestination) SetS3BucketDestination(v *AnalyticsS3BucketDestination) *AnalyticsExportDestination { - s.S3BucketDestination = v - return s -} - -// The filter used to describe a set of objects for analyses. A filter must -// have exactly one prefix, one tag, or one conjunction (AnalyticsAndOperator). -// If no filter is provided, all objects will be considered in any analysis. -type AnalyticsFilter struct { - _ struct{} `type:"structure"` - - // A conjunction (logical AND) of predicates, which is used in evaluating an - // analytics filter. The operator must have at least two predicates. - And *AnalyticsAndOperator `type:"structure"` - - // The prefix to use when evaluating an analytics filter. - Prefix *string `type:"string"` - - // The tag to use when evaluating an analytics filter. - Tag *Tag `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AnalyticsFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AnalyticsFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AnalyticsFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AnalyticsFilter"} - if s.And != nil { - if err := s.And.Validate(); err != nil { - invalidParams.AddNested("And", err.(request.ErrInvalidParams)) - } - } - if s.Tag != nil { - if err := s.Tag.Validate(); err != nil { - invalidParams.AddNested("Tag", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnd sets the And field's value. -func (s *AnalyticsFilter) SetAnd(v *AnalyticsAndOperator) *AnalyticsFilter { - s.And = v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *AnalyticsFilter) SetPrefix(v string) *AnalyticsFilter { - s.Prefix = &v - return s -} - -// SetTag sets the Tag field's value. -func (s *AnalyticsFilter) SetTag(v *Tag) *AnalyticsFilter { - s.Tag = v - return s -} - -// Contains information about where to publish the analytics results. -type AnalyticsS3BucketDestination struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the bucket to which data is exported. - // - // Bucket is a required field - Bucket *string `type:"string" required:"true"` - - // The account ID that owns the destination S3 bucket. If no account ID is provided, - // the owner is not validated before exporting data. - // - // Although this value is optional, we strongly recommend that you set it to - // help prevent problems if the destination bucket ownership changes. - BucketAccountId *string `type:"string"` - - // Specifies the file format used when exporting data to Amazon S3. - // - // Format is a required field - Format *string `type:"string" required:"true" enum:"AnalyticsS3ExportFileFormat"` - - // The prefix to use when exporting data. The prefix is prepended to all results. - Prefix *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AnalyticsS3BucketDestination) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AnalyticsS3BucketDestination) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AnalyticsS3BucketDestination) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AnalyticsS3BucketDestination"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Format == nil { - invalidParams.Add(request.NewErrParamRequired("Format")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *AnalyticsS3BucketDestination) SetBucket(v string) *AnalyticsS3BucketDestination { - s.Bucket = &v - return s -} - -func (s *AnalyticsS3BucketDestination) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetBucketAccountId sets the BucketAccountId field's value. -func (s *AnalyticsS3BucketDestination) SetBucketAccountId(v string) *AnalyticsS3BucketDestination { - s.BucketAccountId = &v - return s -} - -// SetFormat sets the Format field's value. -func (s *AnalyticsS3BucketDestination) SetFormat(v string) *AnalyticsS3BucketDestination { - s.Format = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *AnalyticsS3BucketDestination) SetPrefix(v string) *AnalyticsS3BucketDestination { - s.Prefix = &v - return s -} - -// In terms of implementation, a Bucket is a resource. An Amazon S3 bucket name -// is globally unique, and the namespace is shared by all Amazon Web Services -// accounts. -type Bucket struct { - _ struct{} `type:"structure"` - - // Date the bucket was created. This date can change when making changes to - // your bucket, such as editing its bucket policy. - CreationDate *time.Time `type:"timestamp"` - - // The name of the bucket. - Name *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Bucket) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Bucket) GoString() string { - return s.String() -} - -// SetCreationDate sets the CreationDate field's value. -func (s *Bucket) SetCreationDate(v time.Time) *Bucket { - s.CreationDate = &v - return s -} - -// SetName sets the Name field's value. -func (s *Bucket) SetName(v string) *Bucket { - s.Name = &v - return s -} - -// Specifies the lifecycle configuration for objects in an Amazon S3 bucket. -// For more information, see Object Lifecycle Management (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) -// in the Amazon S3 User Guide. -type BucketLifecycleConfiguration struct { - _ struct{} `type:"structure"` - - // A lifecycle rule for individual objects in an Amazon S3 bucket. - // - // Rules is a required field - Rules []*LifecycleRule `locationName:"Rule" type:"list" flattened:"true" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s BucketLifecycleConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s BucketLifecycleConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BucketLifecycleConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BucketLifecycleConfiguration"} - if s.Rules == nil { - invalidParams.Add(request.NewErrParamRequired("Rules")) - } - if s.Rules != nil { - for i, v := range s.Rules { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRules sets the Rules field's value. -func (s *BucketLifecycleConfiguration) SetRules(v []*LifecycleRule) *BucketLifecycleConfiguration { - s.Rules = v - return s -} - -// Container for logging status information. -type BucketLoggingStatus struct { - _ struct{} `type:"structure"` - - // Describes where logs are stored and the prefix that Amazon S3 assigns to - // all log object keys for a bucket. For more information, see PUT Bucket logging - // (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html) - // in the Amazon S3 API Reference. - LoggingEnabled *LoggingEnabled `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s BucketLoggingStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s BucketLoggingStatus) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BucketLoggingStatus) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BucketLoggingStatus"} - if s.LoggingEnabled != nil { - if err := s.LoggingEnabled.Validate(); err != nil { - invalidParams.AddNested("LoggingEnabled", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetLoggingEnabled sets the LoggingEnabled field's value. -func (s *BucketLoggingStatus) SetLoggingEnabled(v *LoggingEnabled) *BucketLoggingStatus { - s.LoggingEnabled = v - return s -} - -// Describes the cross-origin access configuration for objects in an Amazon -// S3 bucket. For more information, see Enabling Cross-Origin Resource Sharing -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) in the Amazon -// S3 User Guide. -type CORSConfiguration struct { - _ struct{} `type:"structure"` - - // A set of origins and methods (cross-origin access that you want to allow). - // You can add up to 100 rules to the configuration. - // - // CORSRules is a required field - CORSRules []*CORSRule `locationName:"CORSRule" type:"list" flattened:"true" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CORSConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CORSConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CORSConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CORSConfiguration"} - if s.CORSRules == nil { - invalidParams.Add(request.NewErrParamRequired("CORSRules")) - } - if s.CORSRules != nil { - for i, v := range s.CORSRules { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CORSRules", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCORSRules sets the CORSRules field's value. -func (s *CORSConfiguration) SetCORSRules(v []*CORSRule) *CORSConfiguration { - s.CORSRules = v - return s -} - -// Specifies a cross-origin access rule for an Amazon S3 bucket. -type CORSRule struct { - _ struct{} `type:"structure"` - - // Headers that are specified in the Access-Control-Request-Headers header. - // These headers are allowed in a preflight OPTIONS request. In response to - // any preflight OPTIONS request, Amazon S3 returns any requested headers that - // are allowed. - AllowedHeaders []*string `locationName:"AllowedHeader" type:"list" flattened:"true"` - - // An HTTP method that you allow the origin to execute. Valid values are GET, - // PUT, HEAD, POST, and DELETE. - // - // AllowedMethods is a required field - AllowedMethods []*string `locationName:"AllowedMethod" type:"list" flattened:"true" required:"true"` - - // One or more origins you want customers to be able to access the bucket from. - // - // AllowedOrigins is a required field - AllowedOrigins []*string `locationName:"AllowedOrigin" type:"list" flattened:"true" required:"true"` - - // One or more headers in the response that you want customers to be able to - // access from their applications (for example, from a JavaScript XMLHttpRequest - // object). - ExposeHeaders []*string `locationName:"ExposeHeader" type:"list" flattened:"true"` - - // Unique identifier for the rule. The value cannot be longer than 255 characters. - ID *string `type:"string"` - - // The time in seconds that your browser is to cache the preflight response - // for the specified resource. - MaxAgeSeconds *int64 `type:"integer"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CORSRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CORSRule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CORSRule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CORSRule"} - if s.AllowedMethods == nil { - invalidParams.Add(request.NewErrParamRequired("AllowedMethods")) - } - if s.AllowedOrigins == nil { - invalidParams.Add(request.NewErrParamRequired("AllowedOrigins")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllowedHeaders sets the AllowedHeaders field's value. -func (s *CORSRule) SetAllowedHeaders(v []*string) *CORSRule { - s.AllowedHeaders = v - return s -} - -// SetAllowedMethods sets the AllowedMethods field's value. -func (s *CORSRule) SetAllowedMethods(v []*string) *CORSRule { - s.AllowedMethods = v - return s -} - -// SetAllowedOrigins sets the AllowedOrigins field's value. -func (s *CORSRule) SetAllowedOrigins(v []*string) *CORSRule { - s.AllowedOrigins = v - return s -} - -// SetExposeHeaders sets the ExposeHeaders field's value. -func (s *CORSRule) SetExposeHeaders(v []*string) *CORSRule { - s.ExposeHeaders = v - return s -} - -// SetID sets the ID field's value. -func (s *CORSRule) SetID(v string) *CORSRule { - s.ID = &v - return s -} - -// SetMaxAgeSeconds sets the MaxAgeSeconds field's value. -func (s *CORSRule) SetMaxAgeSeconds(v int64) *CORSRule { - s.MaxAgeSeconds = &v - return s -} - -// Describes how an uncompressed comma-separated values (CSV)-formatted input -// object is formatted. -type CSVInput struct { - _ struct{} `type:"structure"` - - // Specifies that CSV field values may contain quoted record delimiters and - // such records should be allowed. Default value is FALSE. Setting this value - // to TRUE may lower performance. - AllowQuotedRecordDelimiter *bool `type:"boolean"` - - // A single character used to indicate that a row should be ignored when the - // character is present at the start of that row. You can specify any character - // to indicate a comment line. - Comments *string `type:"string"` - - // A single character used to separate individual fields in a record. You can - // specify an arbitrary delimiter. - FieldDelimiter *string `type:"string"` - - // Describes the first line of input. Valid values are: - // - // * NONE: First line is not a header. - // - // * IGNORE: First line is a header, but you can't use the header values - // to indicate the column in an expression. You can use column position (such - // as _1, _2, …) to indicate the column (SELECT s._1 FROM OBJECT s). - // - // * Use: First line is a header, and you can use the header value to identify - // a column in an expression (SELECT "name" FROM OBJECT). - FileHeaderInfo *string `type:"string" enum:"FileHeaderInfo"` - - // A single character used for escaping when the field delimiter is part of - // the value. For example, if the value is a, b, Amazon S3 wraps this field - // value in quotation marks, as follows: " a , b ". - // - // Type: String - // - // Default: " - // - // Ancestors: CSV - QuoteCharacter *string `type:"string"` - - // A single character used for escaping the quotation mark character inside - // an already escaped value. For example, the value """ a , b """ is parsed - // as " a , b ". - QuoteEscapeCharacter *string `type:"string"` - - // A single character used to separate individual records in the input. Instead - // of the default value, you can specify an arbitrary delimiter. - RecordDelimiter *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CSVInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CSVInput) GoString() string { - return s.String() -} - -// SetAllowQuotedRecordDelimiter sets the AllowQuotedRecordDelimiter field's value. -func (s *CSVInput) SetAllowQuotedRecordDelimiter(v bool) *CSVInput { - s.AllowQuotedRecordDelimiter = &v - return s -} - -// SetComments sets the Comments field's value. -func (s *CSVInput) SetComments(v string) *CSVInput { - s.Comments = &v - return s -} - -// SetFieldDelimiter sets the FieldDelimiter field's value. -func (s *CSVInput) SetFieldDelimiter(v string) *CSVInput { - s.FieldDelimiter = &v - return s -} - -// SetFileHeaderInfo sets the FileHeaderInfo field's value. -func (s *CSVInput) SetFileHeaderInfo(v string) *CSVInput { - s.FileHeaderInfo = &v - return s -} - -// SetQuoteCharacter sets the QuoteCharacter field's value. -func (s *CSVInput) SetQuoteCharacter(v string) *CSVInput { - s.QuoteCharacter = &v - return s -} - -// SetQuoteEscapeCharacter sets the QuoteEscapeCharacter field's value. -func (s *CSVInput) SetQuoteEscapeCharacter(v string) *CSVInput { - s.QuoteEscapeCharacter = &v - return s -} - -// SetRecordDelimiter sets the RecordDelimiter field's value. -func (s *CSVInput) SetRecordDelimiter(v string) *CSVInput { - s.RecordDelimiter = &v - return s -} - -// Describes how uncompressed comma-separated values (CSV)-formatted results -// are formatted. -type CSVOutput struct { - _ struct{} `type:"structure"` - - // The value used to separate individual fields in a record. You can specify - // an arbitrary delimiter. - FieldDelimiter *string `type:"string"` - - // A single character used for escaping when the field delimiter is part of - // the value. For example, if the value is a, b, Amazon S3 wraps this field - // value in quotation marks, as follows: " a , b ". - QuoteCharacter *string `type:"string"` - - // The single character used for escaping the quote character inside an already - // escaped value. - QuoteEscapeCharacter *string `type:"string"` - - // Indicates whether to use quotation marks around output fields. - // - // * ALWAYS: Always use quotation marks for output fields. - // - // * ASNEEDED: Use quotation marks for output fields when needed. - QuoteFields *string `type:"string" enum:"QuoteFields"` - - // A single character used to separate individual records in the output. Instead - // of the default value, you can specify an arbitrary delimiter. - RecordDelimiter *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CSVOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CSVOutput) GoString() string { - return s.String() -} - -// SetFieldDelimiter sets the FieldDelimiter field's value. -func (s *CSVOutput) SetFieldDelimiter(v string) *CSVOutput { - s.FieldDelimiter = &v - return s -} - -// SetQuoteCharacter sets the QuoteCharacter field's value. -func (s *CSVOutput) SetQuoteCharacter(v string) *CSVOutput { - s.QuoteCharacter = &v - return s -} - -// SetQuoteEscapeCharacter sets the QuoteEscapeCharacter field's value. -func (s *CSVOutput) SetQuoteEscapeCharacter(v string) *CSVOutput { - s.QuoteEscapeCharacter = &v - return s -} - -// SetQuoteFields sets the QuoteFields field's value. -func (s *CSVOutput) SetQuoteFields(v string) *CSVOutput { - s.QuoteFields = &v - return s -} - -// SetRecordDelimiter sets the RecordDelimiter field's value. -func (s *CSVOutput) SetRecordDelimiter(v string) *CSVOutput { - s.RecordDelimiter = &v - return s -} - -// Contains all the possible checksum or digest values for an object. -type Checksum struct { - _ struct{} `type:"structure"` - - // The base64-encoded, 32-bit CRC32 checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumCRC32 *string `type:"string"` - - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumCRC32C *string `type:"string"` - - // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA1 *string `type:"string"` - - // The base64-encoded, 256-bit SHA-256 digest of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA256 *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Checksum) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Checksum) GoString() string { - return s.String() -} - -// SetChecksumCRC32 sets the ChecksumCRC32 field's value. -func (s *Checksum) SetChecksumCRC32(v string) *Checksum { - s.ChecksumCRC32 = &v - return s -} - -// SetChecksumCRC32C sets the ChecksumCRC32C field's value. -func (s *Checksum) SetChecksumCRC32C(v string) *Checksum { - s.ChecksumCRC32C = &v - return s -} - -// SetChecksumSHA1 sets the ChecksumSHA1 field's value. -func (s *Checksum) SetChecksumSHA1(v string) *Checksum { - s.ChecksumSHA1 = &v - return s -} - -// SetChecksumSHA256 sets the ChecksumSHA256 field's value. -func (s *Checksum) SetChecksumSHA256(v string) *Checksum { - s.ChecksumSHA256 = &v - return s -} - -// Container for specifying the Lambda notification configuration. -type CloudFunctionConfiguration struct { - _ struct{} `type:"structure"` - - // Lambda cloud function ARN that Amazon S3 can invoke when it detects events - // of the specified type. - CloudFunction *string `type:"string"` - - // The bucket event for which to send notifications. - // - // Deprecated: Event has been deprecated - Event *string `deprecated:"true" type:"string" enum:"Event"` - - // Bucket events for which to send notifications. - Events []*string `locationName:"Event" type:"list" flattened:"true" enum:"Event"` - - // An optional unique identifier for configurations in a notification configuration. - // If you don't provide one, Amazon S3 will assign an ID. - Id *string `type:"string"` - - // The role supporting the invocation of the Lambda function - InvocationRole *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CloudFunctionConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CloudFunctionConfiguration) GoString() string { - return s.String() -} - -// SetCloudFunction sets the CloudFunction field's value. -func (s *CloudFunctionConfiguration) SetCloudFunction(v string) *CloudFunctionConfiguration { - s.CloudFunction = &v - return s -} - -// SetEvent sets the Event field's value. -func (s *CloudFunctionConfiguration) SetEvent(v string) *CloudFunctionConfiguration { - s.Event = &v - return s -} - -// SetEvents sets the Events field's value. -func (s *CloudFunctionConfiguration) SetEvents(v []*string) *CloudFunctionConfiguration { - s.Events = v - return s -} - -// SetId sets the Id field's value. -func (s *CloudFunctionConfiguration) SetId(v string) *CloudFunctionConfiguration { - s.Id = &v - return s -} - -// SetInvocationRole sets the InvocationRole field's value. -func (s *CloudFunctionConfiguration) SetInvocationRole(v string) *CloudFunctionConfiguration { - s.InvocationRole = &v - return s -} - -// Container for all (if there are any) keys between Prefix and the next occurrence -// of the string specified by a delimiter. CommonPrefixes lists keys that act -// like subdirectories in the directory specified by Prefix. For example, if -// the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, -// the common prefix is notes/summer/. -type CommonPrefix struct { - _ struct{} `type:"structure"` - - // Container for the specified common prefix. - Prefix *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CommonPrefix) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CommonPrefix) GoString() string { - return s.String() -} - -// SetPrefix sets the Prefix field's value. -func (s *CommonPrefix) SetPrefix(v string) *CommonPrefix { - s.Prefix = &v - return s -} - -type CompleteMultipartUploadInput struct { - _ struct{} `locationName:"CompleteMultipartUploadRequest" type:"structure" payload:"MultipartUpload"` - - // Name of the bucket to which the multipart upload was initiated. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // This header can be used as a data integrity check to verify that the data - // received is the same data that was originally sent. This header specifies - // the base64-encoded, 32-bit CRC32 checksum of the object. For more information, - // see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - ChecksumCRC32 *string `location:"header" locationName:"x-amz-checksum-crc32" type:"string"` - - // This header can be used as a data integrity check to verify that the data - // received is the same data that was originally sent. This header specifies - // the base64-encoded, 32-bit CRC32C checksum of the object. For more information, - // see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - ChecksumCRC32C *string `location:"header" locationName:"x-amz-checksum-crc32c" type:"string"` - - // This header can be used as a data integrity check to verify that the data - // received is the same data that was originally sent. This header specifies - // the base64-encoded, 160-bit SHA-1 digest of the object. For more information, - // see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - ChecksumSHA1 *string `location:"header" locationName:"x-amz-checksum-sha1" type:"string"` - - // This header can be used as a data integrity check to verify that the data - // received is the same data that was originally sent. This header specifies - // the base64-encoded, 256-bit SHA-256 digest of the object. For more information, - // see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - ChecksumSHA256 *string `location:"header" locationName:"x-amz-checksum-sha256" type:"string"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Object key for which the multipart upload was initiated. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // The container for the multipart upload request information. - MultipartUpload *CompletedMultipartUpload `locationName:"CompleteMultipartUpload" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // The server-side encryption (SSE) algorithm used to encrypt the object. This - // parameter is needed only when the object was created using a checksum algorithm. - // For more information, see Protecting data using SSE-C keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) - // in the Amazon S3 User Guide. - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // The server-side encryption (SSE) customer managed key. This parameter is - // needed only when the object was created using a checksum algorithm. For more - // information, see Protecting data using SSE-C keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) - // in the Amazon S3 User Guide. - // - // SSECustomerKey is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CompleteMultipartUploadInput's - // String and GoString methods. - SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` - - // The MD5 server-side encryption (SSE) customer managed key. This parameter - // is needed only when the object was created using a checksum algorithm. For - // more information, see Protecting data using SSE-C keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) - // in the Amazon S3 User Guide. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // ID for the initiated multipart upload. - // - // UploadId is a required field - UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CompleteMultipartUploadInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CompleteMultipartUploadInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CompleteMultipartUploadInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CompleteMultipartUploadInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *CompleteMultipartUploadInput) SetBucket(v string) *CompleteMultipartUploadInput { - s.Bucket = &v - return s -} - -func (s *CompleteMultipartUploadInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumCRC32 sets the ChecksumCRC32 field's value. -func (s *CompleteMultipartUploadInput) SetChecksumCRC32(v string) *CompleteMultipartUploadInput { - s.ChecksumCRC32 = &v - return s -} - -// SetChecksumCRC32C sets the ChecksumCRC32C field's value. -func (s *CompleteMultipartUploadInput) SetChecksumCRC32C(v string) *CompleteMultipartUploadInput { - s.ChecksumCRC32C = &v - return s -} - -// SetChecksumSHA1 sets the ChecksumSHA1 field's value. -func (s *CompleteMultipartUploadInput) SetChecksumSHA1(v string) *CompleteMultipartUploadInput { - s.ChecksumSHA1 = &v - return s -} - -// SetChecksumSHA256 sets the ChecksumSHA256 field's value. -func (s *CompleteMultipartUploadInput) SetChecksumSHA256(v string) *CompleteMultipartUploadInput { - s.ChecksumSHA256 = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *CompleteMultipartUploadInput) SetExpectedBucketOwner(v string) *CompleteMultipartUploadInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetKey sets the Key field's value. -func (s *CompleteMultipartUploadInput) SetKey(v string) *CompleteMultipartUploadInput { - s.Key = &v - return s -} - -// SetMultipartUpload sets the MultipartUpload field's value. -func (s *CompleteMultipartUploadInput) SetMultipartUpload(v *CompletedMultipartUpload) *CompleteMultipartUploadInput { - s.MultipartUpload = v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *CompleteMultipartUploadInput) SetRequestPayer(v string) *CompleteMultipartUploadInput { - s.RequestPayer = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *CompleteMultipartUploadInput) SetSSECustomerAlgorithm(v string) *CompleteMultipartUploadInput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKey sets the SSECustomerKey field's value. -func (s *CompleteMultipartUploadInput) SetSSECustomerKey(v string) *CompleteMultipartUploadInput { - s.SSECustomerKey = &v - return s -} - -func (s *CompleteMultipartUploadInput) getSSECustomerKey() (v string) { - if s.SSECustomerKey == nil { - return v - } - return *s.SSECustomerKey -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *CompleteMultipartUploadInput) SetSSECustomerKeyMD5(v string) *CompleteMultipartUploadInput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *CompleteMultipartUploadInput) SetUploadId(v string) *CompleteMultipartUploadInput { - s.UploadId = &v - return s -} - -func (s *CompleteMultipartUploadInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *CompleteMultipartUploadInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s CompleteMultipartUploadInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type CompleteMultipartUploadOutput struct { - _ struct{} `type:"structure"` - - // The name of the bucket that contains the newly created object. Does not return - // the access point ARN or access point alias if used. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - Bucket *string `type:"string"` - - // Indicates whether the multipart upload uses an S3 Bucket Key for server-side - // encryption with Amazon Web Services KMS (SSE-KMS). - BucketKeyEnabled *bool `location:"header" locationName:"x-amz-server-side-encryption-bucket-key-enabled" type:"boolean"` - - // The base64-encoded, 32-bit CRC32 checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumCRC32 *string `type:"string"` - - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumCRC32C *string `type:"string"` - - // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA1 *string `type:"string"` - - // The base64-encoded, 256-bit SHA-256 digest of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA256 *string `type:"string"` - - // Entity tag that identifies the newly created object's data. Objects with - // different object data will have different entity tags. The entity tag is - // an opaque string. The entity tag may or may not be an MD5 digest of the object - // data. If the entity tag is not an MD5 digest of the object data, it will - // contain one or more nonhexadecimal characters and/or will consist of less - // than 32 or more than 32 hexadecimal digits. For more information about how - // the entity tag is calculated, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - ETag *string `type:"string"` - - // If the object expiration is configured, this will contain the expiration - // date (expiry-date) and rule ID (rule-id). The value of rule-id is URL-encoded. - Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` - - // The object key of the newly created object. - Key *string `min:"1" type:"string"` - - // The URI that identifies the newly created object. - Location *string `type:"string"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // If present, specifies the ID of the Amazon Web Services Key Management Service - // (Amazon Web Services KMS) symmetric customer managed key that was used for - // the object. - // - // SSEKMSKeyId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CompleteMultipartUploadOutput's - // String and GoString methods. - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - - // If you specified server-side encryption either with an Amazon S3-managed - // encryption key or an Amazon Web Services KMS key in your initiate multipart - // upload request, the response includes this header. It confirms the encryption - // algorithm that Amazon S3 used to encrypt the object. - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - - // Version ID of the newly created object, in case the bucket has versioning - // turned on. - VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CompleteMultipartUploadOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CompleteMultipartUploadOutput) GoString() string { - return s.String() -} - -// SetBucket sets the Bucket field's value. -func (s *CompleteMultipartUploadOutput) SetBucket(v string) *CompleteMultipartUploadOutput { - s.Bucket = &v - return s -} - -func (s *CompleteMultipartUploadOutput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetBucketKeyEnabled sets the BucketKeyEnabled field's value. -func (s *CompleteMultipartUploadOutput) SetBucketKeyEnabled(v bool) *CompleteMultipartUploadOutput { - s.BucketKeyEnabled = &v - return s -} - -// SetChecksumCRC32 sets the ChecksumCRC32 field's value. -func (s *CompleteMultipartUploadOutput) SetChecksumCRC32(v string) *CompleteMultipartUploadOutput { - s.ChecksumCRC32 = &v - return s -} - -// SetChecksumCRC32C sets the ChecksumCRC32C field's value. -func (s *CompleteMultipartUploadOutput) SetChecksumCRC32C(v string) *CompleteMultipartUploadOutput { - s.ChecksumCRC32C = &v - return s -} - -// SetChecksumSHA1 sets the ChecksumSHA1 field's value. -func (s *CompleteMultipartUploadOutput) SetChecksumSHA1(v string) *CompleteMultipartUploadOutput { - s.ChecksumSHA1 = &v - return s -} - -// SetChecksumSHA256 sets the ChecksumSHA256 field's value. -func (s *CompleteMultipartUploadOutput) SetChecksumSHA256(v string) *CompleteMultipartUploadOutput { - s.ChecksumSHA256 = &v - return s -} - -// SetETag sets the ETag field's value. -func (s *CompleteMultipartUploadOutput) SetETag(v string) *CompleteMultipartUploadOutput { - s.ETag = &v - return s -} - -// SetExpiration sets the Expiration field's value. -func (s *CompleteMultipartUploadOutput) SetExpiration(v string) *CompleteMultipartUploadOutput { - s.Expiration = &v - return s -} - -// SetKey sets the Key field's value. -func (s *CompleteMultipartUploadOutput) SetKey(v string) *CompleteMultipartUploadOutput { - s.Key = &v - return s -} - -// SetLocation sets the Location field's value. -func (s *CompleteMultipartUploadOutput) SetLocation(v string) *CompleteMultipartUploadOutput { - s.Location = &v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *CompleteMultipartUploadOutput) SetRequestCharged(v string) *CompleteMultipartUploadOutput { - s.RequestCharged = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *CompleteMultipartUploadOutput) SetSSEKMSKeyId(v string) *CompleteMultipartUploadOutput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *CompleteMultipartUploadOutput) SetServerSideEncryption(v string) *CompleteMultipartUploadOutput { - s.ServerSideEncryption = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *CompleteMultipartUploadOutput) SetVersionId(v string) *CompleteMultipartUploadOutput { - s.VersionId = &v - return s -} - -// The container for the completed multipart upload details. -type CompletedMultipartUpload struct { - _ struct{} `type:"structure"` - - // Array of CompletedPart data types. - // - // If you do not supply a valid Part with your request, the service sends back - // an HTTP 400 response. - Parts []*CompletedPart `locationName:"Part" type:"list" flattened:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CompletedMultipartUpload) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CompletedMultipartUpload) GoString() string { - return s.String() -} - -// SetParts sets the Parts field's value. -func (s *CompletedMultipartUpload) SetParts(v []*CompletedPart) *CompletedMultipartUpload { - s.Parts = v - return s -} - -// Details of the parts that were uploaded. -type CompletedPart struct { - _ struct{} `type:"structure"` - - // The base64-encoded, 32-bit CRC32 checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumCRC32 *string `type:"string"` - - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumCRC32C *string `type:"string"` - - // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA1 *string `type:"string"` - - // The base64-encoded, 256-bit SHA-256 digest of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA256 *string `type:"string"` - - // Entity tag returned when the part was uploaded. - ETag *string `type:"string"` - - // Part number that identifies the part. This is a positive integer between - // 1 and 10,000. - PartNumber *int64 `type:"integer"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CompletedPart) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CompletedPart) GoString() string { - return s.String() -} - -// SetChecksumCRC32 sets the ChecksumCRC32 field's value. -func (s *CompletedPart) SetChecksumCRC32(v string) *CompletedPart { - s.ChecksumCRC32 = &v - return s -} - -// SetChecksumCRC32C sets the ChecksumCRC32C field's value. -func (s *CompletedPart) SetChecksumCRC32C(v string) *CompletedPart { - s.ChecksumCRC32C = &v - return s -} - -// SetChecksumSHA1 sets the ChecksumSHA1 field's value. -func (s *CompletedPart) SetChecksumSHA1(v string) *CompletedPart { - s.ChecksumSHA1 = &v - return s -} - -// SetChecksumSHA256 sets the ChecksumSHA256 field's value. -func (s *CompletedPart) SetChecksumSHA256(v string) *CompletedPart { - s.ChecksumSHA256 = &v - return s -} - -// SetETag sets the ETag field's value. -func (s *CompletedPart) SetETag(v string) *CompletedPart { - s.ETag = &v - return s -} - -// SetPartNumber sets the PartNumber field's value. -func (s *CompletedPart) SetPartNumber(v int64) *CompletedPart { - s.PartNumber = &v - return s -} - -// A container for describing a condition that must be met for the specified -// redirect to apply. For example, 1. If request is for pages in the /docs folder, -// redirect to the /documents folder. 2. If request results in HTTP error 4xx, -// redirect request to another host where you might process the error. -type Condition struct { - _ struct{} `type:"structure"` - - // The HTTP error code when the redirect is applied. In the event of an error, - // if the error code equals this value, then the specified redirect is applied. - // Required when parent element Condition is specified and sibling KeyPrefixEquals - // is not specified. If both are specified, then both must be true for the redirect - // to be applied. - HttpErrorCodeReturnedEquals *string `type:"string"` - - // The object key name prefix when the redirect is applied. For example, to - // redirect requests for ExamplePage.html, the key prefix will be ExamplePage.html. - // To redirect request for all pages with the prefix docs/, the key prefix will - // be /docs, which identifies all objects in the docs/ folder. Required when - // the parent element Condition is specified and sibling HttpErrorCodeReturnedEquals - // is not specified. If both conditions are specified, both must be true for - // the redirect to be applied. - // - // Replacement must be made for object keys containing special characters (such - // as carriage returns) when using XML requests. For more information, see XML - // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). - KeyPrefixEquals *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Condition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Condition) GoString() string { - return s.String() -} - -// SetHttpErrorCodeReturnedEquals sets the HttpErrorCodeReturnedEquals field's value. -func (s *Condition) SetHttpErrorCodeReturnedEquals(v string) *Condition { - s.HttpErrorCodeReturnedEquals = &v - return s -} - -// SetKeyPrefixEquals sets the KeyPrefixEquals field's value. -func (s *Condition) SetKeyPrefixEquals(v string) *Condition { - s.KeyPrefixEquals = &v - return s -} - -type ContinuationEvent struct { - _ struct{} `locationName:"ContinuationEvent" type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ContinuationEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ContinuationEvent) GoString() string { - return s.String() -} - -// The ContinuationEvent is and event in the SelectObjectContentEventStream group of events. -func (s *ContinuationEvent) eventSelectObjectContentEventStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the ContinuationEvent value. -// This method is only used internally within the SDK's EventStream handling. -func (s *ContinuationEvent) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *ContinuationEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) - return msg, err -} - -type CopyObjectInput struct { - _ struct{} `locationName:"CopyObjectRequest" type:"structure"` - - // The canned ACL to apply to the object. - // - // This action is not supported by Amazon S3 on Outposts. - ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` - - // The name of the destination bucket. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption - // with server-side encryption using AWS KMS (SSE-KMS). Setting this header - // to true causes Amazon S3 to use an S3 Bucket Key for object encryption with - // SSE-KMS. - // - // Specifying this header with a COPY action doesn’t affect bucket-level settings - // for S3 Bucket Key. - BucketKeyEnabled *bool `location:"header" locationName:"x-amz-server-side-encryption-bucket-key-enabled" type:"boolean"` - - // Specifies caching behavior along the request/reply chain. - CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` - - // Indicates the algorithm you want Amazon S3 to use to create the checksum - // for the object. For more information, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // Specifies presentational information for the object. - ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` - - // Specifies what content encodings have been applied to the object and thus - // what decoding mechanisms must be applied to obtain the media-type referenced - // by the Content-Type header field. - ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` - - // The language the content is in. - ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` - - // A standard MIME type describing the format of the object data. - ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - - // Specifies the source object for the copy operation. You specify the value - // in one of two formats, depending on whether you want to access the source - // object through an access point (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html): - // - // * For objects not accessed through an access point, specify the name of - // the source bucket and the key of the source object, separated by a slash - // (/). For example, to copy the object reports/january.pdf from the bucket - // awsexamplebucket, use awsexamplebucket/reports/january.pdf. The value - // must be URL-encoded. - // - // * For objects accessed through access points, specify the Amazon Resource - // Name (ARN) of the object as accessed through the access point, in the - // format arn:aws:s3:::accesspoint//object/. - // For example, to copy the object reports/january.pdf through access point - // my-access-point owned by account 123456789012 in Region us-west-2, use - // the URL encoding of arn:aws:s3:us-west-2:123456789012:accesspoint/my-access-point/object/reports/january.pdf. - // The value must be URL encoded. Amazon S3 supports copy operations using - // access points only when the source and destination buckets are in the - // same Amazon Web Services Region. Alternatively, for objects accessed through - // Amazon S3 on Outposts, specify the ARN of the object as accessed in the - // format arn:aws:s3-outposts:::outpost//object/. - // For example, to copy the object reports/january.pdf through outpost my-outpost - // owned by account 123456789012 in Region us-west-2, use the URL encoding - // of arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/object/reports/january.pdf. - // The value must be URL-encoded. - // - // To copy a specific version of an object, append ?versionId= to - // the value (for example, awsexamplebucket/reports/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893). - // If you don't specify a version ID, Amazon S3 copies the latest version of - // the source object. - // - // CopySource is a required field - CopySource *string `location:"header" locationName:"x-amz-copy-source" type:"string" required:"true"` - - // Copies the object if its entity tag (ETag) matches the specified tag. - CopySourceIfMatch *string `location:"header" locationName:"x-amz-copy-source-if-match" type:"string"` - - // Copies the object if it has been modified since the specified time. - CopySourceIfModifiedSince *time.Time `location:"header" locationName:"x-amz-copy-source-if-modified-since" type:"timestamp"` - - // Copies the object if its entity tag (ETag) is different than the specified - // ETag. - CopySourceIfNoneMatch *string `location:"header" locationName:"x-amz-copy-source-if-none-match" type:"string"` - - // Copies the object if it hasn't been modified since the specified time. - CopySourceIfUnmodifiedSince *time.Time `location:"header" locationName:"x-amz-copy-source-if-unmodified-since" type:"timestamp"` - - // Specifies the algorithm to use when decrypting the source object (for example, - // AES256). - CopySourceSSECustomerAlgorithm *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-algorithm" type:"string"` - - // Specifies the customer-provided encryption key for Amazon S3 to use to decrypt - // the source object. The encryption key provided in this header must be one - // that was used when the source object was created. - // - // CopySourceSSECustomerKey is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CopyObjectInput's - // String and GoString methods. - CopySourceSSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key" type:"string" sensitive:"true"` - - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure that the - // encryption key was transmitted without error. - CopySourceSSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key-MD5" type:"string"` - - // The account ID of the expected destination bucket owner. If the destination - // bucket is owned by a different account, the request fails with the HTTP status - // code 403 Forbidden (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The account ID of the expected source bucket owner. If the source bucket - // is owned by a different account, the request fails with the HTTP status code - // 403 Forbidden (access denied). - ExpectedSourceBucketOwner *string `location:"header" locationName:"x-amz-source-expected-bucket-owner" type:"string"` - - // The date and time at which the object is no longer cacheable. - Expires *time.Time `location:"header" locationName:"Expires" type:"timestamp"` - - // Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. - // - // This action is not supported by Amazon S3 on Outposts. - GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` - - // Allows grantee to read the object data and its metadata. - // - // This action is not supported by Amazon S3 on Outposts. - GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` - - // Allows grantee to read the object ACL. - // - // This action is not supported by Amazon S3 on Outposts. - GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` - - // Allows grantee to write the ACL for the applicable object. - // - // This action is not supported by Amazon S3 on Outposts. - GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` - - // The key of the destination object. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // A map of metadata to store with the object in S3. - Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` - - // Specifies whether the metadata is copied from the source object or replaced - // with metadata provided in the request. - MetadataDirective *string `location:"header" locationName:"x-amz-metadata-directive" type:"string" enum:"MetadataDirective"` - - // Specifies whether you want to apply a legal hold to the copied object. - ObjectLockLegalHoldStatus *string `location:"header" locationName:"x-amz-object-lock-legal-hold" type:"string" enum:"ObjectLockLegalHoldStatus"` - - // The Object Lock mode that you want to apply to the copied object. - ObjectLockMode *string `location:"header" locationName:"x-amz-object-lock-mode" type:"string" enum:"ObjectLockMode"` - - // The date and time when you want the copied object's Object Lock to expire. - ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // Specifies the algorithm to use to when encrypting the object (for example, - // AES256). - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting - // data. This value is used to store the object and then it is discarded; Amazon - // S3 does not store the encryption key. The key must be appropriate for use - // with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm - // header. - // - // SSECustomerKey is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CopyObjectInput's - // String and GoString methods. - SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` - - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure that the - // encryption key was transmitted without error. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // Specifies the Amazon Web Services KMS Encryption Context to use for object - // encryption. The value of this header is a base64-encoded UTF-8 string holding - // JSON with the encryption context key-value pairs. - // - // SSEKMSEncryptionContext is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CopyObjectInput's - // String and GoString methods. - SSEKMSEncryptionContext *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` - - // Specifies the Amazon Web Services KMS key ID to use for object encryption. - // All GET and PUT requests for an object protected by Amazon Web Services KMS - // will fail if not made via SSL or using SigV4. For information about configuring - // using any of the officially supported Amazon Web Services SDKs and Amazon - // Web Services CLI, see Specifying the Signature Version in Request Authentication - // (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version) - // in the Amazon S3 User Guide. - // - // SSEKMSKeyId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CopyObjectInput's - // String and GoString methods. - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - - // The server-side encryption algorithm used when storing this object in Amazon - // S3 (for example, AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - - // By default, Amazon S3 uses the STANDARD Storage Class to store newly created - // objects. The STANDARD storage class provides high durability and high availability. - // Depending on performance needs, you can specify a different Storage Class. - // Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. For more information, - // see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) - // in the Amazon S3 User Guide. - StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` - - // The tag-set for the object destination object this value must be used in - // conjunction with the TaggingDirective. The tag-set must be encoded as URL - // Query parameters. - Tagging *string `location:"header" locationName:"x-amz-tagging" type:"string"` - - // Specifies whether the object tag-set are copied from the source object or - // replaced with tag-set provided in the request. - TaggingDirective *string `location:"header" locationName:"x-amz-tagging-directive" type:"string" enum:"TaggingDirective"` - - // If the bucket is configured as a website, redirects requests for this object - // to another object in the same bucket or to an external URL. Amazon S3 stores - // the value of this header in the object metadata. - WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CopyObjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CopyObjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CopyObjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CopyObjectInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.CopySource == nil { - invalidParams.Add(request.NewErrParamRequired("CopySource")) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetACL sets the ACL field's value. -func (s *CopyObjectInput) SetACL(v string) *CopyObjectInput { - s.ACL = &v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *CopyObjectInput) SetBucket(v string) *CopyObjectInput { - s.Bucket = &v - return s -} - -func (s *CopyObjectInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetBucketKeyEnabled sets the BucketKeyEnabled field's value. -func (s *CopyObjectInput) SetBucketKeyEnabled(v bool) *CopyObjectInput { - s.BucketKeyEnabled = &v - return s -} - -// SetCacheControl sets the CacheControl field's value. -func (s *CopyObjectInput) SetCacheControl(v string) *CopyObjectInput { - s.CacheControl = &v - return s -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *CopyObjectInput) SetChecksumAlgorithm(v string) *CopyObjectInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetContentDisposition sets the ContentDisposition field's value. -func (s *CopyObjectInput) SetContentDisposition(v string) *CopyObjectInput { - s.ContentDisposition = &v - return s -} - -// SetContentEncoding sets the ContentEncoding field's value. -func (s *CopyObjectInput) SetContentEncoding(v string) *CopyObjectInput { - s.ContentEncoding = &v - return s -} - -// SetContentLanguage sets the ContentLanguage field's value. -func (s *CopyObjectInput) SetContentLanguage(v string) *CopyObjectInput { - s.ContentLanguage = &v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *CopyObjectInput) SetContentType(v string) *CopyObjectInput { - s.ContentType = &v - return s -} - -// SetCopySource sets the CopySource field's value. -func (s *CopyObjectInput) SetCopySource(v string) *CopyObjectInput { - s.CopySource = &v - return s -} - -// SetCopySourceIfMatch sets the CopySourceIfMatch field's value. -func (s *CopyObjectInput) SetCopySourceIfMatch(v string) *CopyObjectInput { - s.CopySourceIfMatch = &v - return s -} - -// SetCopySourceIfModifiedSince sets the CopySourceIfModifiedSince field's value. -func (s *CopyObjectInput) SetCopySourceIfModifiedSince(v time.Time) *CopyObjectInput { - s.CopySourceIfModifiedSince = &v - return s -} - -// SetCopySourceIfNoneMatch sets the CopySourceIfNoneMatch field's value. -func (s *CopyObjectInput) SetCopySourceIfNoneMatch(v string) *CopyObjectInput { - s.CopySourceIfNoneMatch = &v - return s -} - -// SetCopySourceIfUnmodifiedSince sets the CopySourceIfUnmodifiedSince field's value. -func (s *CopyObjectInput) SetCopySourceIfUnmodifiedSince(v time.Time) *CopyObjectInput { - s.CopySourceIfUnmodifiedSince = &v - return s -} - -// SetCopySourceSSECustomerAlgorithm sets the CopySourceSSECustomerAlgorithm field's value. -func (s *CopyObjectInput) SetCopySourceSSECustomerAlgorithm(v string) *CopyObjectInput { - s.CopySourceSSECustomerAlgorithm = &v - return s -} - -// SetCopySourceSSECustomerKey sets the CopySourceSSECustomerKey field's value. -func (s *CopyObjectInput) SetCopySourceSSECustomerKey(v string) *CopyObjectInput { - s.CopySourceSSECustomerKey = &v - return s -} - -func (s *CopyObjectInput) getCopySourceSSECustomerKey() (v string) { - if s.CopySourceSSECustomerKey == nil { - return v - } - return *s.CopySourceSSECustomerKey -} - -// SetCopySourceSSECustomerKeyMD5 sets the CopySourceSSECustomerKeyMD5 field's value. -func (s *CopyObjectInput) SetCopySourceSSECustomerKeyMD5(v string) *CopyObjectInput { - s.CopySourceSSECustomerKeyMD5 = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *CopyObjectInput) SetExpectedBucketOwner(v string) *CopyObjectInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetExpectedSourceBucketOwner sets the ExpectedSourceBucketOwner field's value. -func (s *CopyObjectInput) SetExpectedSourceBucketOwner(v string) *CopyObjectInput { - s.ExpectedSourceBucketOwner = &v - return s -} - -// SetExpires sets the Expires field's value. -func (s *CopyObjectInput) SetExpires(v time.Time) *CopyObjectInput { - s.Expires = &v - return s -} - -// SetGrantFullControl sets the GrantFullControl field's value. -func (s *CopyObjectInput) SetGrantFullControl(v string) *CopyObjectInput { - s.GrantFullControl = &v - return s -} - -// SetGrantRead sets the GrantRead field's value. -func (s *CopyObjectInput) SetGrantRead(v string) *CopyObjectInput { - s.GrantRead = &v - return s -} - -// SetGrantReadACP sets the GrantReadACP field's value. -func (s *CopyObjectInput) SetGrantReadACP(v string) *CopyObjectInput { - s.GrantReadACP = &v - return s -} - -// SetGrantWriteACP sets the GrantWriteACP field's value. -func (s *CopyObjectInput) SetGrantWriteACP(v string) *CopyObjectInput { - s.GrantWriteACP = &v - return s -} - -// SetKey sets the Key field's value. -func (s *CopyObjectInput) SetKey(v string) *CopyObjectInput { - s.Key = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *CopyObjectInput) SetMetadata(v map[string]*string) *CopyObjectInput { - s.Metadata = v - return s -} - -// SetMetadataDirective sets the MetadataDirective field's value. -func (s *CopyObjectInput) SetMetadataDirective(v string) *CopyObjectInput { - s.MetadataDirective = &v - return s -} - -// SetObjectLockLegalHoldStatus sets the ObjectLockLegalHoldStatus field's value. -func (s *CopyObjectInput) SetObjectLockLegalHoldStatus(v string) *CopyObjectInput { - s.ObjectLockLegalHoldStatus = &v - return s -} - -// SetObjectLockMode sets the ObjectLockMode field's value. -func (s *CopyObjectInput) SetObjectLockMode(v string) *CopyObjectInput { - s.ObjectLockMode = &v - return s -} - -// SetObjectLockRetainUntilDate sets the ObjectLockRetainUntilDate field's value. -func (s *CopyObjectInput) SetObjectLockRetainUntilDate(v time.Time) *CopyObjectInput { - s.ObjectLockRetainUntilDate = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *CopyObjectInput) SetRequestPayer(v string) *CopyObjectInput { - s.RequestPayer = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *CopyObjectInput) SetSSECustomerAlgorithm(v string) *CopyObjectInput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKey sets the SSECustomerKey field's value. -func (s *CopyObjectInput) SetSSECustomerKey(v string) *CopyObjectInput { - s.SSECustomerKey = &v - return s -} - -func (s *CopyObjectInput) getSSECustomerKey() (v string) { - if s.SSECustomerKey == nil { - return v - } - return *s.SSECustomerKey -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *CopyObjectInput) SetSSECustomerKeyMD5(v string) *CopyObjectInput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSEncryptionContext sets the SSEKMSEncryptionContext field's value. -func (s *CopyObjectInput) SetSSEKMSEncryptionContext(v string) *CopyObjectInput { - s.SSEKMSEncryptionContext = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *CopyObjectInput) SetSSEKMSKeyId(v string) *CopyObjectInput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *CopyObjectInput) SetServerSideEncryption(v string) *CopyObjectInput { - s.ServerSideEncryption = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *CopyObjectInput) SetStorageClass(v string) *CopyObjectInput { - s.StorageClass = &v - return s -} - -// SetTagging sets the Tagging field's value. -func (s *CopyObjectInput) SetTagging(v string) *CopyObjectInput { - s.Tagging = &v - return s -} - -// SetTaggingDirective sets the TaggingDirective field's value. -func (s *CopyObjectInput) SetTaggingDirective(v string) *CopyObjectInput { - s.TaggingDirective = &v - return s -} - -// SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. -func (s *CopyObjectInput) SetWebsiteRedirectLocation(v string) *CopyObjectInput { - s.WebsiteRedirectLocation = &v - return s -} - -func (s *CopyObjectInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *CopyObjectInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s CopyObjectInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type CopyObjectOutput struct { - _ struct{} `type:"structure" payload:"CopyObjectResult"` - - // Indicates whether the copied object uses an S3 Bucket Key for server-side - // encryption with Amazon Web Services KMS (SSE-KMS). - BucketKeyEnabled *bool `location:"header" locationName:"x-amz-server-side-encryption-bucket-key-enabled" type:"boolean"` - - // Container for all response elements. - CopyObjectResult *CopyObjectResult `type:"structure"` - - // Version of the copied object in the destination bucket. - CopySourceVersionId *string `location:"header" locationName:"x-amz-copy-source-version-id" type:"string"` - - // If the object expiration is configured, the response includes this header. - Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header confirming the encryption algorithm - // used. - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round-trip message integrity - // verification of the customer-provided encryption key. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // If present, specifies the Amazon Web Services KMS Encryption Context to use - // for object encryption. The value of this header is a base64-encoded UTF-8 - // string holding JSON with the encryption context key-value pairs. - // - // SSEKMSEncryptionContext is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CopyObjectOutput's - // String and GoString methods. - SSEKMSEncryptionContext *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` - - // If present, specifies the ID of the Amazon Web Services Key Management Service - // (Amazon Web Services KMS) symmetric customer managed key that was used for - // the object. - // - // SSEKMSKeyId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CopyObjectOutput's - // String and GoString methods. - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - - // The server-side encryption algorithm used when storing this object in Amazon - // S3 (for example, AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - - // Version ID of the newly created copy. - VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CopyObjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CopyObjectOutput) GoString() string { - return s.String() -} - -// SetBucketKeyEnabled sets the BucketKeyEnabled field's value. -func (s *CopyObjectOutput) SetBucketKeyEnabled(v bool) *CopyObjectOutput { - s.BucketKeyEnabled = &v - return s -} - -// SetCopyObjectResult sets the CopyObjectResult field's value. -func (s *CopyObjectOutput) SetCopyObjectResult(v *CopyObjectResult) *CopyObjectOutput { - s.CopyObjectResult = v - return s -} - -// SetCopySourceVersionId sets the CopySourceVersionId field's value. -func (s *CopyObjectOutput) SetCopySourceVersionId(v string) *CopyObjectOutput { - s.CopySourceVersionId = &v - return s -} - -// SetExpiration sets the Expiration field's value. -func (s *CopyObjectOutput) SetExpiration(v string) *CopyObjectOutput { - s.Expiration = &v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *CopyObjectOutput) SetRequestCharged(v string) *CopyObjectOutput { - s.RequestCharged = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *CopyObjectOutput) SetSSECustomerAlgorithm(v string) *CopyObjectOutput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *CopyObjectOutput) SetSSECustomerKeyMD5(v string) *CopyObjectOutput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSEncryptionContext sets the SSEKMSEncryptionContext field's value. -func (s *CopyObjectOutput) SetSSEKMSEncryptionContext(v string) *CopyObjectOutput { - s.SSEKMSEncryptionContext = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *CopyObjectOutput) SetSSEKMSKeyId(v string) *CopyObjectOutput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *CopyObjectOutput) SetServerSideEncryption(v string) *CopyObjectOutput { - s.ServerSideEncryption = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *CopyObjectOutput) SetVersionId(v string) *CopyObjectOutput { - s.VersionId = &v - return s -} - -// Container for all response elements. -type CopyObjectResult struct { - _ struct{} `type:"structure"` - - // The base64-encoded, 32-bit CRC32 checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumCRC32 *string `type:"string"` - - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumCRC32C *string `type:"string"` - - // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA1 *string `type:"string"` - - // The base64-encoded, 256-bit SHA-256 digest of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA256 *string `type:"string"` - - // Returns the ETag of the new object. The ETag reflects only changes to the - // contents of an object, not its metadata. - ETag *string `type:"string"` - - // Creation date of the object. - LastModified *time.Time `type:"timestamp"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CopyObjectResult) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CopyObjectResult) GoString() string { - return s.String() -} - -// SetChecksumCRC32 sets the ChecksumCRC32 field's value. -func (s *CopyObjectResult) SetChecksumCRC32(v string) *CopyObjectResult { - s.ChecksumCRC32 = &v - return s -} - -// SetChecksumCRC32C sets the ChecksumCRC32C field's value. -func (s *CopyObjectResult) SetChecksumCRC32C(v string) *CopyObjectResult { - s.ChecksumCRC32C = &v - return s -} - -// SetChecksumSHA1 sets the ChecksumSHA1 field's value. -func (s *CopyObjectResult) SetChecksumSHA1(v string) *CopyObjectResult { - s.ChecksumSHA1 = &v - return s -} - -// SetChecksumSHA256 sets the ChecksumSHA256 field's value. -func (s *CopyObjectResult) SetChecksumSHA256(v string) *CopyObjectResult { - s.ChecksumSHA256 = &v - return s -} - -// SetETag sets the ETag field's value. -func (s *CopyObjectResult) SetETag(v string) *CopyObjectResult { - s.ETag = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *CopyObjectResult) SetLastModified(v time.Time) *CopyObjectResult { - s.LastModified = &v - return s -} - -// Container for all response elements. -type CopyPartResult struct { - _ struct{} `type:"structure"` - - // The base64-encoded, 32-bit CRC32 checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumCRC32 *string `type:"string"` - - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumCRC32C *string `type:"string"` - - // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA1 *string `type:"string"` - - // The base64-encoded, 256-bit SHA-256 digest of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA256 *string `type:"string"` - - // Entity tag of the object. - ETag *string `type:"string"` - - // Date and time at which the object was uploaded. - LastModified *time.Time `type:"timestamp"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CopyPartResult) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CopyPartResult) GoString() string { - return s.String() -} - -// SetChecksumCRC32 sets the ChecksumCRC32 field's value. -func (s *CopyPartResult) SetChecksumCRC32(v string) *CopyPartResult { - s.ChecksumCRC32 = &v - return s -} - -// SetChecksumCRC32C sets the ChecksumCRC32C field's value. -func (s *CopyPartResult) SetChecksumCRC32C(v string) *CopyPartResult { - s.ChecksumCRC32C = &v - return s -} - -// SetChecksumSHA1 sets the ChecksumSHA1 field's value. -func (s *CopyPartResult) SetChecksumSHA1(v string) *CopyPartResult { - s.ChecksumSHA1 = &v - return s -} - -// SetChecksumSHA256 sets the ChecksumSHA256 field's value. -func (s *CopyPartResult) SetChecksumSHA256(v string) *CopyPartResult { - s.ChecksumSHA256 = &v - return s -} - -// SetETag sets the ETag field's value. -func (s *CopyPartResult) SetETag(v string) *CopyPartResult { - s.ETag = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *CopyPartResult) SetLastModified(v time.Time) *CopyPartResult { - s.LastModified = &v - return s -} - -// The configuration information for the bucket. -type CreateBucketConfiguration struct { - _ struct{} `type:"structure"` - - // Specifies the Region where the bucket will be created. If you don't specify - // a Region, the bucket is created in the US East (N. Virginia) Region (us-east-1). - LocationConstraint *string `type:"string" enum:"BucketLocationConstraint"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateBucketConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateBucketConfiguration) GoString() string { - return s.String() -} - -// SetLocationConstraint sets the LocationConstraint field's value. -func (s *CreateBucketConfiguration) SetLocationConstraint(v string) *CreateBucketConfiguration { - s.LocationConstraint = &v - return s -} - -type CreateBucketInput struct { - _ struct{} `locationName:"CreateBucketRequest" type:"structure" payload:"CreateBucketConfiguration"` - - // The canned ACL to apply to the bucket. - ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"BucketCannedACL"` - - // The name of the bucket to create. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The configuration information for the bucket. - CreateBucketConfiguration *CreateBucketConfiguration `locationName:"CreateBucketConfiguration" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - - // Allows grantee the read, write, read ACP, and write ACP permissions on the - // bucket. - GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` - - // Allows grantee to list the objects in the bucket. - GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` - - // Allows grantee to read the bucket ACL. - GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` - - // Allows grantee to create new objects in the bucket. - // - // For the bucket and object owners of existing objects, also allows deletions - // and overwrites of those objects. - GrantWrite *string `location:"header" locationName:"x-amz-grant-write" type:"string"` - - // Allows grantee to write the ACL for the applicable bucket. - GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` - - // Specifies whether you want S3 Object Lock to be enabled for the new bucket. - ObjectLockEnabledForBucket *bool `location:"header" locationName:"x-amz-bucket-object-lock-enabled" type:"boolean"` - - // The container element for object ownership for a bucket's ownership controls. - // - // BucketOwnerPreferred - Objects uploaded to the bucket change ownership to - // the bucket owner if the objects are uploaded with the bucket-owner-full-control - // canned ACL. - // - // ObjectWriter - The uploading account will own the object if the object is - // uploaded with the bucket-owner-full-control canned ACL. - // - // BucketOwnerEnforced - Access control lists (ACLs) are disabled and no longer - // affect permissions. The bucket owner automatically owns and has full control - // over every object in the bucket. The bucket only accepts PUT requests that - // don't specify an ACL or bucket owner full control ACLs, such as the bucket-owner-full-control - // canned ACL or an equivalent form of this ACL expressed in the XML format. - ObjectOwnership *string `location:"header" locationName:"x-amz-object-ownership" type:"string" enum:"ObjectOwnership"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateBucketInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateBucketInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateBucketInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateBucketInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetACL sets the ACL field's value. -func (s *CreateBucketInput) SetACL(v string) *CreateBucketInput { - s.ACL = &v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *CreateBucketInput) SetBucket(v string) *CreateBucketInput { - s.Bucket = &v - return s -} - -func (s *CreateBucketInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetCreateBucketConfiguration sets the CreateBucketConfiguration field's value. -func (s *CreateBucketInput) SetCreateBucketConfiguration(v *CreateBucketConfiguration) *CreateBucketInput { - s.CreateBucketConfiguration = v - return s -} - -// SetGrantFullControl sets the GrantFullControl field's value. -func (s *CreateBucketInput) SetGrantFullControl(v string) *CreateBucketInput { - s.GrantFullControl = &v - return s -} - -// SetGrantRead sets the GrantRead field's value. -func (s *CreateBucketInput) SetGrantRead(v string) *CreateBucketInput { - s.GrantRead = &v - return s -} - -// SetGrantReadACP sets the GrantReadACP field's value. -func (s *CreateBucketInput) SetGrantReadACP(v string) *CreateBucketInput { - s.GrantReadACP = &v - return s -} - -// SetGrantWrite sets the GrantWrite field's value. -func (s *CreateBucketInput) SetGrantWrite(v string) *CreateBucketInput { - s.GrantWrite = &v - return s -} - -// SetGrantWriteACP sets the GrantWriteACP field's value. -func (s *CreateBucketInput) SetGrantWriteACP(v string) *CreateBucketInput { - s.GrantWriteACP = &v - return s -} - -// SetObjectLockEnabledForBucket sets the ObjectLockEnabledForBucket field's value. -func (s *CreateBucketInput) SetObjectLockEnabledForBucket(v bool) *CreateBucketInput { - s.ObjectLockEnabledForBucket = &v - return s -} - -// SetObjectOwnership sets the ObjectOwnership field's value. -func (s *CreateBucketInput) SetObjectOwnership(v string) *CreateBucketInput { - s.ObjectOwnership = &v - return s -} - -type CreateBucketOutput struct { - _ struct{} `type:"structure"` - - // A forward slash followed by the name of the bucket. - Location *string `location:"header" locationName:"Location" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateBucketOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateBucketOutput) GoString() string { - return s.String() -} - -// SetLocation sets the Location field's value. -func (s *CreateBucketOutput) SetLocation(v string) *CreateBucketOutput { - s.Location = &v - return s -} - -type CreateMultipartUploadInput struct { - _ struct{} `locationName:"CreateMultipartUploadRequest" type:"structure"` - - // The canned ACL to apply to the object. - // - // This action is not supported by Amazon S3 on Outposts. - ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` - - // The name of the bucket to which to initiate the upload - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption - // with server-side encryption using AWS KMS (SSE-KMS). Setting this header - // to true causes Amazon S3 to use an S3 Bucket Key for object encryption with - // SSE-KMS. - // - // Specifying this header with an object action doesn’t affect bucket-level - // settings for S3 Bucket Key. - BucketKeyEnabled *bool `location:"header" locationName:"x-amz-server-side-encryption-bucket-key-enabled" type:"boolean"` - - // Specifies caching behavior along the request/reply chain. - CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` - - // Indicates the algorithm you want Amazon S3 to use to create the checksum - // for the object. For more information, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // Specifies presentational information for the object. - ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` - - // Specifies what content encodings have been applied to the object and thus - // what decoding mechanisms must be applied to obtain the media-type referenced - // by the Content-Type header field. - ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` - - // The language the content is in. - ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` - - // A standard MIME type describing the format of the object data. - ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The date and time at which the object is no longer cacheable. - Expires *time.Time `location:"header" locationName:"Expires" type:"timestamp"` - - // Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. - // - // This action is not supported by Amazon S3 on Outposts. - GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` - - // Allows grantee to read the object data and its metadata. - // - // This action is not supported by Amazon S3 on Outposts. - GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` - - // Allows grantee to read the object ACL. - // - // This action is not supported by Amazon S3 on Outposts. - GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` - - // Allows grantee to write the ACL for the applicable object. - // - // This action is not supported by Amazon S3 on Outposts. - GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` - - // Object key for which the multipart upload is to be initiated. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // A map of metadata to store with the object in S3. - Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` - - // Specifies whether you want to apply a legal hold to the uploaded object. - ObjectLockLegalHoldStatus *string `location:"header" locationName:"x-amz-object-lock-legal-hold" type:"string" enum:"ObjectLockLegalHoldStatus"` - - // Specifies the Object Lock mode that you want to apply to the uploaded object. - ObjectLockMode *string `location:"header" locationName:"x-amz-object-lock-mode" type:"string" enum:"ObjectLockMode"` - - // Specifies the date and time when you want the Object Lock to expire. - ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // Specifies the algorithm to use to when encrypting the object (for example, - // AES256). - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting - // data. This value is used to store the object and then it is discarded; Amazon - // S3 does not store the encryption key. The key must be appropriate for use - // with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm - // header. - // - // SSECustomerKey is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateMultipartUploadInput's - // String and GoString methods. - SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` - - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure that the - // encryption key was transmitted without error. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // Specifies the Amazon Web Services KMS Encryption Context to use for object - // encryption. The value of this header is a base64-encoded UTF-8 string holding - // JSON with the encryption context key-value pairs. - // - // SSEKMSEncryptionContext is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateMultipartUploadInput's - // String and GoString methods. - SSEKMSEncryptionContext *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` - - // Specifies the ID of the symmetric customer managed key to use for object - // encryption. All GET and PUT requests for an object protected by Amazon Web - // Services KMS will fail if not made via SSL or using SigV4. For information - // about configuring using any of the officially supported Amazon Web Services - // SDKs and Amazon Web Services CLI, see Specifying the Signature Version in - // Request Authentication (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingAWSSDK.html#specify-signature-version) - // in the Amazon S3 User Guide. - // - // SSEKMSKeyId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateMultipartUploadInput's - // String and GoString methods. - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - - // The server-side encryption algorithm used when storing this object in Amazon - // S3 (for example, AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - - // By default, Amazon S3 uses the STANDARD Storage Class to store newly created - // objects. The STANDARD storage class provides high durability and high availability. - // Depending on performance needs, you can specify a different Storage Class. - // Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. For more information, - // see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) - // in the Amazon S3 User Guide. - StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` - - // The tag-set for the object. The tag-set must be encoded as URL Query parameters. - Tagging *string `location:"header" locationName:"x-amz-tagging" type:"string"` - - // If the bucket is configured as a website, redirects requests for this object - // to another object in the same bucket or to an external URL. Amazon S3 stores - // the value of this header in the object metadata. - WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateMultipartUploadInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateMultipartUploadInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateMultipartUploadInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateMultipartUploadInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetACL sets the ACL field's value. -func (s *CreateMultipartUploadInput) SetACL(v string) *CreateMultipartUploadInput { - s.ACL = &v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *CreateMultipartUploadInput) SetBucket(v string) *CreateMultipartUploadInput { - s.Bucket = &v - return s -} - -func (s *CreateMultipartUploadInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetBucketKeyEnabled sets the BucketKeyEnabled field's value. -func (s *CreateMultipartUploadInput) SetBucketKeyEnabled(v bool) *CreateMultipartUploadInput { - s.BucketKeyEnabled = &v - return s -} - -// SetCacheControl sets the CacheControl field's value. -func (s *CreateMultipartUploadInput) SetCacheControl(v string) *CreateMultipartUploadInput { - s.CacheControl = &v - return s -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *CreateMultipartUploadInput) SetChecksumAlgorithm(v string) *CreateMultipartUploadInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetContentDisposition sets the ContentDisposition field's value. -func (s *CreateMultipartUploadInput) SetContentDisposition(v string) *CreateMultipartUploadInput { - s.ContentDisposition = &v - return s -} - -// SetContentEncoding sets the ContentEncoding field's value. -func (s *CreateMultipartUploadInput) SetContentEncoding(v string) *CreateMultipartUploadInput { - s.ContentEncoding = &v - return s -} - -// SetContentLanguage sets the ContentLanguage field's value. -func (s *CreateMultipartUploadInput) SetContentLanguage(v string) *CreateMultipartUploadInput { - s.ContentLanguage = &v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *CreateMultipartUploadInput) SetContentType(v string) *CreateMultipartUploadInput { - s.ContentType = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *CreateMultipartUploadInput) SetExpectedBucketOwner(v string) *CreateMultipartUploadInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetExpires sets the Expires field's value. -func (s *CreateMultipartUploadInput) SetExpires(v time.Time) *CreateMultipartUploadInput { - s.Expires = &v - return s -} - -// SetGrantFullControl sets the GrantFullControl field's value. -func (s *CreateMultipartUploadInput) SetGrantFullControl(v string) *CreateMultipartUploadInput { - s.GrantFullControl = &v - return s -} - -// SetGrantRead sets the GrantRead field's value. -func (s *CreateMultipartUploadInput) SetGrantRead(v string) *CreateMultipartUploadInput { - s.GrantRead = &v - return s -} - -// SetGrantReadACP sets the GrantReadACP field's value. -func (s *CreateMultipartUploadInput) SetGrantReadACP(v string) *CreateMultipartUploadInput { - s.GrantReadACP = &v - return s -} - -// SetGrantWriteACP sets the GrantWriteACP field's value. -func (s *CreateMultipartUploadInput) SetGrantWriteACP(v string) *CreateMultipartUploadInput { - s.GrantWriteACP = &v - return s -} - -// SetKey sets the Key field's value. -func (s *CreateMultipartUploadInput) SetKey(v string) *CreateMultipartUploadInput { - s.Key = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *CreateMultipartUploadInput) SetMetadata(v map[string]*string) *CreateMultipartUploadInput { - s.Metadata = v - return s -} - -// SetObjectLockLegalHoldStatus sets the ObjectLockLegalHoldStatus field's value. -func (s *CreateMultipartUploadInput) SetObjectLockLegalHoldStatus(v string) *CreateMultipartUploadInput { - s.ObjectLockLegalHoldStatus = &v - return s -} - -// SetObjectLockMode sets the ObjectLockMode field's value. -func (s *CreateMultipartUploadInput) SetObjectLockMode(v string) *CreateMultipartUploadInput { - s.ObjectLockMode = &v - return s -} - -// SetObjectLockRetainUntilDate sets the ObjectLockRetainUntilDate field's value. -func (s *CreateMultipartUploadInput) SetObjectLockRetainUntilDate(v time.Time) *CreateMultipartUploadInput { - s.ObjectLockRetainUntilDate = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *CreateMultipartUploadInput) SetRequestPayer(v string) *CreateMultipartUploadInput { - s.RequestPayer = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *CreateMultipartUploadInput) SetSSECustomerAlgorithm(v string) *CreateMultipartUploadInput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKey sets the SSECustomerKey field's value. -func (s *CreateMultipartUploadInput) SetSSECustomerKey(v string) *CreateMultipartUploadInput { - s.SSECustomerKey = &v - return s -} - -func (s *CreateMultipartUploadInput) getSSECustomerKey() (v string) { - if s.SSECustomerKey == nil { - return v - } - return *s.SSECustomerKey -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *CreateMultipartUploadInput) SetSSECustomerKeyMD5(v string) *CreateMultipartUploadInput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSEncryptionContext sets the SSEKMSEncryptionContext field's value. -func (s *CreateMultipartUploadInput) SetSSEKMSEncryptionContext(v string) *CreateMultipartUploadInput { - s.SSEKMSEncryptionContext = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *CreateMultipartUploadInput) SetSSEKMSKeyId(v string) *CreateMultipartUploadInput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *CreateMultipartUploadInput) SetServerSideEncryption(v string) *CreateMultipartUploadInput { - s.ServerSideEncryption = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *CreateMultipartUploadInput) SetStorageClass(v string) *CreateMultipartUploadInput { - s.StorageClass = &v - return s -} - -// SetTagging sets the Tagging field's value. -func (s *CreateMultipartUploadInput) SetTagging(v string) *CreateMultipartUploadInput { - s.Tagging = &v - return s -} - -// SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. -func (s *CreateMultipartUploadInput) SetWebsiteRedirectLocation(v string) *CreateMultipartUploadInput { - s.WebsiteRedirectLocation = &v - return s -} - -func (s *CreateMultipartUploadInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *CreateMultipartUploadInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s CreateMultipartUploadInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type CreateMultipartUploadOutput struct { - _ struct{} `type:"structure"` - - // If the bucket has a lifecycle rule configured with an action to abort incomplete - // multipart uploads and the prefix in the lifecycle rule matches the object - // name in the request, the response includes this header. The header indicates - // when the initiated multipart upload becomes eligible for an abort operation. - // For more information, see Aborting Incomplete Multipart Uploads Using a Bucket - // Lifecycle Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config). - // - // The response also includes the x-amz-abort-rule-id header that provides the - // ID of the lifecycle configuration rule that defines this action. - AbortDate *time.Time `location:"header" locationName:"x-amz-abort-date" type:"timestamp"` - - // This header is returned along with the x-amz-abort-date header. It identifies - // the applicable lifecycle configuration rule that defines the action to abort - // incomplete multipart uploads. - AbortRuleId *string `location:"header" locationName:"x-amz-abort-rule-id" type:"string"` - - // The name of the bucket to which the multipart upload was initiated. Does - // not return the access point ARN or access point alias if used. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - Bucket *string `locationName:"Bucket" type:"string"` - - // Indicates whether the multipart upload uses an S3 Bucket Key for server-side - // encryption with Amazon Web Services KMS (SSE-KMS). - BucketKeyEnabled *bool `location:"header" locationName:"x-amz-server-side-encryption-bucket-key-enabled" type:"boolean"` - - // The algorithm that was used to create a checksum of the object. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // Object key for which the multipart upload was initiated. - Key *string `min:"1" type:"string"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header confirming the encryption algorithm - // used. - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round-trip message integrity - // verification of the customer-provided encryption key. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // If present, specifies the Amazon Web Services KMS Encryption Context to use - // for object encryption. The value of this header is a base64-encoded UTF-8 - // string holding JSON with the encryption context key-value pairs. - // - // SSEKMSEncryptionContext is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateMultipartUploadOutput's - // String and GoString methods. - SSEKMSEncryptionContext *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` - - // If present, specifies the ID of the Amazon Web Services Key Management Service - // (Amazon Web Services KMS) symmetric customer managed key that was used for - // the object. - // - // SSEKMSKeyId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by CreateMultipartUploadOutput's - // String and GoString methods. - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - - // The server-side encryption algorithm used when storing this object in Amazon - // S3 (for example, AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - - // ID for the initiated multipart upload. - UploadId *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateMultipartUploadOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateMultipartUploadOutput) GoString() string { - return s.String() -} - -// SetAbortDate sets the AbortDate field's value. -func (s *CreateMultipartUploadOutput) SetAbortDate(v time.Time) *CreateMultipartUploadOutput { - s.AbortDate = &v - return s -} - -// SetAbortRuleId sets the AbortRuleId field's value. -func (s *CreateMultipartUploadOutput) SetAbortRuleId(v string) *CreateMultipartUploadOutput { - s.AbortRuleId = &v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *CreateMultipartUploadOutput) SetBucket(v string) *CreateMultipartUploadOutput { - s.Bucket = &v - return s -} - -func (s *CreateMultipartUploadOutput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetBucketKeyEnabled sets the BucketKeyEnabled field's value. -func (s *CreateMultipartUploadOutput) SetBucketKeyEnabled(v bool) *CreateMultipartUploadOutput { - s.BucketKeyEnabled = &v - return s -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *CreateMultipartUploadOutput) SetChecksumAlgorithm(v string) *CreateMultipartUploadOutput { - s.ChecksumAlgorithm = &v - return s -} - -// SetKey sets the Key field's value. -func (s *CreateMultipartUploadOutput) SetKey(v string) *CreateMultipartUploadOutput { - s.Key = &v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *CreateMultipartUploadOutput) SetRequestCharged(v string) *CreateMultipartUploadOutput { - s.RequestCharged = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *CreateMultipartUploadOutput) SetSSECustomerAlgorithm(v string) *CreateMultipartUploadOutput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *CreateMultipartUploadOutput) SetSSECustomerKeyMD5(v string) *CreateMultipartUploadOutput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSEncryptionContext sets the SSEKMSEncryptionContext field's value. -func (s *CreateMultipartUploadOutput) SetSSEKMSEncryptionContext(v string) *CreateMultipartUploadOutput { - s.SSEKMSEncryptionContext = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *CreateMultipartUploadOutput) SetSSEKMSKeyId(v string) *CreateMultipartUploadOutput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *CreateMultipartUploadOutput) SetServerSideEncryption(v string) *CreateMultipartUploadOutput { - s.ServerSideEncryption = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *CreateMultipartUploadOutput) SetUploadId(v string) *CreateMultipartUploadOutput { - s.UploadId = &v - return s -} - -// The container element for specifying the default Object Lock retention settings -// for new objects placed in the specified bucket. -// -// - The DefaultRetention settings require both a mode and a period. -// -// - The DefaultRetention period can be either Days or Years but you must -// select one. You cannot specify Days and Years at the same time. -type DefaultRetention struct { - _ struct{} `type:"structure"` - - // The number of days that you want to specify for the default retention period. - // Must be used with Mode. - Days *int64 `type:"integer"` - - // The default Object Lock retention mode you want to apply to new objects placed - // in the specified bucket. Must be used with either Days or Years. - Mode *string `type:"string" enum:"ObjectLockRetentionMode"` - - // The number of years that you want to specify for the default retention period. - // Must be used with Mode. - Years *int64 `type:"integer"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DefaultRetention) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DefaultRetention) GoString() string { - return s.String() -} - -// SetDays sets the Days field's value. -func (s *DefaultRetention) SetDays(v int64) *DefaultRetention { - s.Days = &v - return s -} - -// SetMode sets the Mode field's value. -func (s *DefaultRetention) SetMode(v string) *DefaultRetention { - s.Mode = &v - return s -} - -// SetYears sets the Years field's value. -func (s *DefaultRetention) SetYears(v int64) *DefaultRetention { - s.Years = &v - return s -} - -// Container for the objects to delete. -type Delete struct { - _ struct{} `type:"structure"` - - // The objects to delete. - // - // Objects is a required field - Objects []*ObjectIdentifier `locationName:"Object" type:"list" flattened:"true" required:"true"` - - // Element to enable quiet mode for the request. When you add this element, - // you must set its value to true. - Quiet *bool `type:"boolean"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Delete) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Delete) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Delete) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Delete"} - if s.Objects == nil { - invalidParams.Add(request.NewErrParamRequired("Objects")) - } - if s.Objects != nil { - for i, v := range s.Objects { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Objects", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetObjects sets the Objects field's value. -func (s *Delete) SetObjects(v []*ObjectIdentifier) *Delete { - s.Objects = v - return s -} - -// SetQuiet sets the Quiet field's value. -func (s *Delete) SetQuiet(v bool) *Delete { - s.Quiet = &v - return s -} - -type DeleteBucketAnalyticsConfigurationInput struct { - _ struct{} `locationName:"DeleteBucketAnalyticsConfigurationRequest" type:"structure"` - - // The name of the bucket from which an analytics configuration is deleted. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The ID that identifies the analytics configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketAnalyticsConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketAnalyticsConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketAnalyticsConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketAnalyticsConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketAnalyticsConfigurationInput) SetBucket(v string) *DeleteBucketAnalyticsConfigurationInput { - s.Bucket = &v - return s -} - -func (s *DeleteBucketAnalyticsConfigurationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *DeleteBucketAnalyticsConfigurationInput) SetExpectedBucketOwner(v string) *DeleteBucketAnalyticsConfigurationInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeleteBucketAnalyticsConfigurationInput) SetId(v string) *DeleteBucketAnalyticsConfigurationInput { - s.Id = &v - return s -} - -func (s *DeleteBucketAnalyticsConfigurationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *DeleteBucketAnalyticsConfigurationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s DeleteBucketAnalyticsConfigurationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type DeleteBucketAnalyticsConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketAnalyticsConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketAnalyticsConfigurationOutput) GoString() string { - return s.String() -} - -type DeleteBucketCorsInput struct { - _ struct{} `locationName:"DeleteBucketCorsRequest" type:"structure"` - - // Specifies the bucket whose cors configuration is being deleted. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketCorsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketCorsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketCorsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketCorsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketCorsInput) SetBucket(v string) *DeleteBucketCorsInput { - s.Bucket = &v - return s -} - -func (s *DeleteBucketCorsInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *DeleteBucketCorsInput) SetExpectedBucketOwner(v string) *DeleteBucketCorsInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *DeleteBucketCorsInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *DeleteBucketCorsInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s DeleteBucketCorsInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type DeleteBucketCorsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketCorsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketCorsOutput) GoString() string { - return s.String() -} - -type DeleteBucketEncryptionInput struct { - _ struct{} `locationName:"DeleteBucketEncryptionRequest" type:"structure"` - - // The name of the bucket containing the server-side encryption configuration - // to delete. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketEncryptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketEncryptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketEncryptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketEncryptionInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketEncryptionInput) SetBucket(v string) *DeleteBucketEncryptionInput { - s.Bucket = &v - return s -} - -func (s *DeleteBucketEncryptionInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *DeleteBucketEncryptionInput) SetExpectedBucketOwner(v string) *DeleteBucketEncryptionInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *DeleteBucketEncryptionInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *DeleteBucketEncryptionInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s DeleteBucketEncryptionInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type DeleteBucketEncryptionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketEncryptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketEncryptionOutput) GoString() string { - return s.String() -} - -type DeleteBucketInput struct { - _ struct{} `locationName:"DeleteBucketRequest" type:"structure"` - - // Specifies the bucket being deleted. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketInput) SetBucket(v string) *DeleteBucketInput { - s.Bucket = &v - return s -} - -func (s *DeleteBucketInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *DeleteBucketInput) SetExpectedBucketOwner(v string) *DeleteBucketInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *DeleteBucketInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *DeleteBucketInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s DeleteBucketInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type DeleteBucketIntelligentTieringConfigurationInput struct { - _ struct{} `locationName:"DeleteBucketIntelligentTieringConfigurationRequest" type:"structure"` - - // The name of the Amazon S3 bucket whose configuration you want to modify or - // retrieve. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The ID used to identify the S3 Intelligent-Tiering configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketIntelligentTieringConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketIntelligentTieringConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketIntelligentTieringConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketIntelligentTieringConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketIntelligentTieringConfigurationInput) SetBucket(v string) *DeleteBucketIntelligentTieringConfigurationInput { - s.Bucket = &v - return s -} - -func (s *DeleteBucketIntelligentTieringConfigurationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetId sets the Id field's value. -func (s *DeleteBucketIntelligentTieringConfigurationInput) SetId(v string) *DeleteBucketIntelligentTieringConfigurationInput { - s.Id = &v - return s -} - -func (s *DeleteBucketIntelligentTieringConfigurationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *DeleteBucketIntelligentTieringConfigurationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s DeleteBucketIntelligentTieringConfigurationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type DeleteBucketIntelligentTieringConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketIntelligentTieringConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketIntelligentTieringConfigurationOutput) GoString() string { - return s.String() -} - -type DeleteBucketInventoryConfigurationInput struct { - _ struct{} `locationName:"DeleteBucketInventoryConfigurationRequest" type:"structure"` - - // The name of the bucket containing the inventory configuration to delete. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The ID used to identify the inventory configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketInventoryConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketInventoryConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketInventoryConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketInventoryConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketInventoryConfigurationInput) SetBucket(v string) *DeleteBucketInventoryConfigurationInput { - s.Bucket = &v - return s -} - -func (s *DeleteBucketInventoryConfigurationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *DeleteBucketInventoryConfigurationInput) SetExpectedBucketOwner(v string) *DeleteBucketInventoryConfigurationInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeleteBucketInventoryConfigurationInput) SetId(v string) *DeleteBucketInventoryConfigurationInput { - s.Id = &v - return s -} - -func (s *DeleteBucketInventoryConfigurationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *DeleteBucketInventoryConfigurationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s DeleteBucketInventoryConfigurationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type DeleteBucketInventoryConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketInventoryConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketInventoryConfigurationOutput) GoString() string { - return s.String() -} - -type DeleteBucketLifecycleInput struct { - _ struct{} `locationName:"DeleteBucketLifecycleRequest" type:"structure"` - - // The bucket name of the lifecycle to delete. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketLifecycleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketLifecycleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketLifecycleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketLifecycleInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketLifecycleInput) SetBucket(v string) *DeleteBucketLifecycleInput { - s.Bucket = &v - return s -} - -func (s *DeleteBucketLifecycleInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *DeleteBucketLifecycleInput) SetExpectedBucketOwner(v string) *DeleteBucketLifecycleInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *DeleteBucketLifecycleInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *DeleteBucketLifecycleInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s DeleteBucketLifecycleInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type DeleteBucketLifecycleOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketLifecycleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketLifecycleOutput) GoString() string { - return s.String() -} - -type DeleteBucketMetricsConfigurationInput struct { - _ struct{} `locationName:"DeleteBucketMetricsConfigurationRequest" type:"structure"` - - // The name of the bucket containing the metrics configuration to delete. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The ID used to identify the metrics configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketMetricsConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketMetricsConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketMetricsConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketMetricsConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketMetricsConfigurationInput) SetBucket(v string) *DeleteBucketMetricsConfigurationInput { - s.Bucket = &v - return s -} - -func (s *DeleteBucketMetricsConfigurationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *DeleteBucketMetricsConfigurationInput) SetExpectedBucketOwner(v string) *DeleteBucketMetricsConfigurationInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetId sets the Id field's value. -func (s *DeleteBucketMetricsConfigurationInput) SetId(v string) *DeleteBucketMetricsConfigurationInput { - s.Id = &v - return s -} - -func (s *DeleteBucketMetricsConfigurationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *DeleteBucketMetricsConfigurationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s DeleteBucketMetricsConfigurationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type DeleteBucketMetricsConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketMetricsConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketMetricsConfigurationOutput) GoString() string { - return s.String() -} - -type DeleteBucketOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketOutput) GoString() string { - return s.String() -} - -type DeleteBucketOwnershipControlsInput struct { - _ struct{} `locationName:"DeleteBucketOwnershipControlsRequest" type:"structure"` - - // The Amazon S3 bucket whose OwnershipControls you want to delete. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketOwnershipControlsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketOwnershipControlsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketOwnershipControlsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketOwnershipControlsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketOwnershipControlsInput) SetBucket(v string) *DeleteBucketOwnershipControlsInput { - s.Bucket = &v - return s -} - -func (s *DeleteBucketOwnershipControlsInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *DeleteBucketOwnershipControlsInput) SetExpectedBucketOwner(v string) *DeleteBucketOwnershipControlsInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *DeleteBucketOwnershipControlsInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *DeleteBucketOwnershipControlsInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s DeleteBucketOwnershipControlsInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type DeleteBucketOwnershipControlsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketOwnershipControlsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketOwnershipControlsOutput) GoString() string { - return s.String() -} - -type DeleteBucketPolicyInput struct { - _ struct{} `locationName:"DeleteBucketPolicyRequest" type:"structure"` - - // The bucket name. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketPolicyInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketPolicyInput) SetBucket(v string) *DeleteBucketPolicyInput { - s.Bucket = &v - return s -} - -func (s *DeleteBucketPolicyInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *DeleteBucketPolicyInput) SetExpectedBucketOwner(v string) *DeleteBucketPolicyInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *DeleteBucketPolicyInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *DeleteBucketPolicyInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s DeleteBucketPolicyInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type DeleteBucketPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketPolicyOutput) GoString() string { - return s.String() -} - -type DeleteBucketReplicationInput struct { - _ struct{} `locationName:"DeleteBucketReplicationRequest" type:"structure"` - - // The bucket name. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketReplicationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketReplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketReplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketReplicationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketReplicationInput) SetBucket(v string) *DeleteBucketReplicationInput { - s.Bucket = &v - return s -} - -func (s *DeleteBucketReplicationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *DeleteBucketReplicationInput) SetExpectedBucketOwner(v string) *DeleteBucketReplicationInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *DeleteBucketReplicationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *DeleteBucketReplicationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s DeleteBucketReplicationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type DeleteBucketReplicationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketReplicationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketReplicationOutput) GoString() string { - return s.String() -} - -type DeleteBucketTaggingInput struct { - _ struct{} `locationName:"DeleteBucketTaggingRequest" type:"structure"` - - // The bucket that has the tag set to be removed. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketTaggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketTaggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketTaggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketTaggingInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketTaggingInput) SetBucket(v string) *DeleteBucketTaggingInput { - s.Bucket = &v - return s -} - -func (s *DeleteBucketTaggingInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *DeleteBucketTaggingInput) SetExpectedBucketOwner(v string) *DeleteBucketTaggingInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *DeleteBucketTaggingInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *DeleteBucketTaggingInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s DeleteBucketTaggingInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type DeleteBucketTaggingOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketTaggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketTaggingOutput) GoString() string { - return s.String() -} - -type DeleteBucketWebsiteInput struct { - _ struct{} `locationName:"DeleteBucketWebsiteRequest" type:"structure"` - - // The bucket name for which you want to remove the website configuration. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketWebsiteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketWebsiteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteBucketWebsiteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteBucketWebsiteInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteBucketWebsiteInput) SetBucket(v string) *DeleteBucketWebsiteInput { - s.Bucket = &v - return s -} - -func (s *DeleteBucketWebsiteInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *DeleteBucketWebsiteInput) SetExpectedBucketOwner(v string) *DeleteBucketWebsiteInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *DeleteBucketWebsiteInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *DeleteBucketWebsiteInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s DeleteBucketWebsiteInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type DeleteBucketWebsiteOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketWebsiteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteBucketWebsiteOutput) GoString() string { - return s.String() -} - -// Information about the delete marker. -type DeleteMarkerEntry struct { - _ struct{} `type:"structure"` - - // Specifies whether the object is (true) or is not (false) the latest version - // of an object. - IsLatest *bool `type:"boolean"` - - // The object key. - Key *string `min:"1" type:"string"` - - // Date and time the object was last modified. - LastModified *time.Time `type:"timestamp"` - - // The account that created the delete marker.> - Owner *Owner `type:"structure"` - - // Version ID of an object. - VersionId *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteMarkerEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteMarkerEntry) GoString() string { - return s.String() -} - -// SetIsLatest sets the IsLatest field's value. -func (s *DeleteMarkerEntry) SetIsLatest(v bool) *DeleteMarkerEntry { - s.IsLatest = &v - return s -} - -// SetKey sets the Key field's value. -func (s *DeleteMarkerEntry) SetKey(v string) *DeleteMarkerEntry { - s.Key = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *DeleteMarkerEntry) SetLastModified(v time.Time) *DeleteMarkerEntry { - s.LastModified = &v - return s -} - -// SetOwner sets the Owner field's value. -func (s *DeleteMarkerEntry) SetOwner(v *Owner) *DeleteMarkerEntry { - s.Owner = v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *DeleteMarkerEntry) SetVersionId(v string) *DeleteMarkerEntry { - s.VersionId = &v - return s -} - -// Specifies whether Amazon S3 replicates delete markers. If you specify a Filter -// in your replication configuration, you must also include a DeleteMarkerReplication -// element. If your Filter includes a Tag element, the DeleteMarkerReplication -// Status must be set to Disabled, because Amazon S3 does not support replicating -// delete markers for tag-based rules. For an example configuration, see Basic -// Rule Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-config-min-rule-config). -// -// For more information about delete marker replication, see Basic Rule Configuration -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html). -// -// If you are using an earlier version of the replication configuration, Amazon -// S3 handles replication of delete markers differently. For more information, -// see Backward Compatibility (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations). -type DeleteMarkerReplication struct { - _ struct{} `type:"structure"` - - // Indicates whether to replicate delete markers. - // - // Indicates whether to replicate delete markers. - Status *string `type:"string" enum:"DeleteMarkerReplicationStatus"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteMarkerReplication) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteMarkerReplication) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *DeleteMarkerReplication) SetStatus(v string) *DeleteMarkerReplication { - s.Status = &v - return s -} - -type DeleteObjectInput struct { - _ struct{} `locationName:"DeleteObjectRequest" type:"structure"` - - // The bucket name of the bucket containing the object. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates whether S3 Object Lock should bypass Governance-mode restrictions - // to process this operation. To use this header, you must have the s3:BypassGovernanceRetention - // permission. - BypassGovernanceRetention *bool `location:"header" locationName:"x-amz-bypass-governance-retention" type:"boolean"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Key name of the object to delete. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // The concatenation of the authentication device's serial number, a space, - // and the value that is displayed on your authentication device. Required to - // permanently delete a versioned object if versioning is configured with MFA - // delete enabled. - MFA *string `location:"header" locationName:"x-amz-mfa" type:"string"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // VersionId used to reference a specific version of the object. - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteObjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteObjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteObjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteObjectInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteObjectInput) SetBucket(v string) *DeleteObjectInput { - s.Bucket = &v - return s -} - -func (s *DeleteObjectInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetBypassGovernanceRetention sets the BypassGovernanceRetention field's value. -func (s *DeleteObjectInput) SetBypassGovernanceRetention(v bool) *DeleteObjectInput { - s.BypassGovernanceRetention = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *DeleteObjectInput) SetExpectedBucketOwner(v string) *DeleteObjectInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetKey sets the Key field's value. -func (s *DeleteObjectInput) SetKey(v string) *DeleteObjectInput { - s.Key = &v - return s -} - -// SetMFA sets the MFA field's value. -func (s *DeleteObjectInput) SetMFA(v string) *DeleteObjectInput { - s.MFA = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *DeleteObjectInput) SetRequestPayer(v string) *DeleteObjectInput { - s.RequestPayer = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *DeleteObjectInput) SetVersionId(v string) *DeleteObjectInput { - s.VersionId = &v - return s -} - -func (s *DeleteObjectInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *DeleteObjectInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s DeleteObjectInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type DeleteObjectOutput struct { - _ struct{} `type:"structure"` - - // Specifies whether the versioned object that was permanently deleted was (true) - // or was not (false) a delete marker. - DeleteMarker *bool `location:"header" locationName:"x-amz-delete-marker" type:"boolean"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // Returns the version ID of the delete marker created as a result of the DELETE - // operation. - VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteObjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteObjectOutput) GoString() string { - return s.String() -} - -// SetDeleteMarker sets the DeleteMarker field's value. -func (s *DeleteObjectOutput) SetDeleteMarker(v bool) *DeleteObjectOutput { - s.DeleteMarker = &v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *DeleteObjectOutput) SetRequestCharged(v string) *DeleteObjectOutput { - s.RequestCharged = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *DeleteObjectOutput) SetVersionId(v string) *DeleteObjectOutput { - s.VersionId = &v - return s -} - -type DeleteObjectTaggingInput struct { - _ struct{} `locationName:"DeleteObjectTaggingRequest" type:"structure"` - - // The bucket name containing the objects from which to remove the tags. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The key that identifies the object in the bucket from which to remove all - // tags. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // The versionId of the object that the tag-set will be removed from. - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteObjectTaggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteObjectTaggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteObjectTaggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteObjectTaggingInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteObjectTaggingInput) SetBucket(v string) *DeleteObjectTaggingInput { - s.Bucket = &v - return s -} - -func (s *DeleteObjectTaggingInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *DeleteObjectTaggingInput) SetExpectedBucketOwner(v string) *DeleteObjectTaggingInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetKey sets the Key field's value. -func (s *DeleteObjectTaggingInput) SetKey(v string) *DeleteObjectTaggingInput { - s.Key = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *DeleteObjectTaggingInput) SetVersionId(v string) *DeleteObjectTaggingInput { - s.VersionId = &v - return s -} - -func (s *DeleteObjectTaggingInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *DeleteObjectTaggingInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s DeleteObjectTaggingInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type DeleteObjectTaggingOutput struct { - _ struct{} `type:"structure"` - - // The versionId of the object the tag-set was removed from. - VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteObjectTaggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteObjectTaggingOutput) GoString() string { - return s.String() -} - -// SetVersionId sets the VersionId field's value. -func (s *DeleteObjectTaggingOutput) SetVersionId(v string) *DeleteObjectTaggingOutput { - s.VersionId = &v - return s -} - -type DeleteObjectsInput struct { - _ struct{} `locationName:"DeleteObjectsRequest" type:"structure" payload:"Delete"` - - // The bucket name containing the objects to delete. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Specifies whether you want to delete this object even if it has a Governance-type - // Object Lock in place. To use this header, you must have the s3:BypassGovernanceRetention - // permission. - BypassGovernanceRetention *bool `location:"header" locationName:"x-amz-bypass-governance-retention" type:"boolean"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // This checksum algorithm must be the same for all parts and it match the checksum - // value supplied in the CreateMultipartUpload request. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - // - // The SDK will automatically compute the Content-MD5 checksum for this operation. - // The AWS SDK for Go v2 allows you to configure alternative checksum algorithm - // to be used. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // Container for the request. - // - // Delete is a required field - Delete *Delete `locationName:"Delete" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The concatenation of the authentication device's serial number, a space, - // and the value that is displayed on your authentication device. Required to - // permanently delete a versioned object if versioning is configured with MFA - // delete enabled. - MFA *string `location:"header" locationName:"x-amz-mfa" type:"string"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteObjectsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteObjectsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteObjectsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteObjectsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Delete == nil { - invalidParams.Add(request.NewErrParamRequired("Delete")) - } - if s.Delete != nil { - if err := s.Delete.Validate(); err != nil { - invalidParams.AddNested("Delete", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeleteObjectsInput) SetBucket(v string) *DeleteObjectsInput { - s.Bucket = &v - return s -} - -func (s *DeleteObjectsInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetBypassGovernanceRetention sets the BypassGovernanceRetention field's value. -func (s *DeleteObjectsInput) SetBypassGovernanceRetention(v bool) *DeleteObjectsInput { - s.BypassGovernanceRetention = &v - return s -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *DeleteObjectsInput) SetChecksumAlgorithm(v string) *DeleteObjectsInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetDelete sets the Delete field's value. -func (s *DeleteObjectsInput) SetDelete(v *Delete) *DeleteObjectsInput { - s.Delete = v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *DeleteObjectsInput) SetExpectedBucketOwner(v string) *DeleteObjectsInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetMFA sets the MFA field's value. -func (s *DeleteObjectsInput) SetMFA(v string) *DeleteObjectsInput { - s.MFA = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *DeleteObjectsInput) SetRequestPayer(v string) *DeleteObjectsInput { - s.RequestPayer = &v - return s -} - -func (s *DeleteObjectsInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *DeleteObjectsInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s DeleteObjectsInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type DeleteObjectsOutput struct { - _ struct{} `type:"structure"` - - // Container element for a successful delete. It identifies the object that - // was successfully deleted. - Deleted []*DeletedObject `type:"list" flattened:"true"` - - // Container for a failed delete action that describes the object that Amazon - // S3 attempted to delete and the error it encountered. - Errors []*Error `locationName:"Error" type:"list" flattened:"true"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteObjectsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteObjectsOutput) GoString() string { - return s.String() -} - -// SetDeleted sets the Deleted field's value. -func (s *DeleteObjectsOutput) SetDeleted(v []*DeletedObject) *DeleteObjectsOutput { - s.Deleted = v - return s -} - -// SetErrors sets the Errors field's value. -func (s *DeleteObjectsOutput) SetErrors(v []*Error) *DeleteObjectsOutput { - s.Errors = v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *DeleteObjectsOutput) SetRequestCharged(v string) *DeleteObjectsOutput { - s.RequestCharged = &v - return s -} - -type DeletePublicAccessBlockInput struct { - _ struct{} `locationName:"DeletePublicAccessBlockRequest" type:"structure"` - - // The Amazon S3 bucket whose PublicAccessBlock configuration you want to delete. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeletePublicAccessBlockInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeletePublicAccessBlockInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePublicAccessBlockInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePublicAccessBlockInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *DeletePublicAccessBlockInput) SetBucket(v string) *DeletePublicAccessBlockInput { - s.Bucket = &v - return s -} - -func (s *DeletePublicAccessBlockInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *DeletePublicAccessBlockInput) SetExpectedBucketOwner(v string) *DeletePublicAccessBlockInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *DeletePublicAccessBlockInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *DeletePublicAccessBlockInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s DeletePublicAccessBlockInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type DeletePublicAccessBlockOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeletePublicAccessBlockOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeletePublicAccessBlockOutput) GoString() string { - return s.String() -} - -// Information about the deleted object. -type DeletedObject struct { - _ struct{} `type:"structure"` - - // Specifies whether the versioned object that was permanently deleted was (true) - // or was not (false) a delete marker. In a simple DELETE, this header indicates - // whether (true) or not (false) a delete marker was created. - DeleteMarker *bool `type:"boolean"` - - // The version ID of the delete marker created as a result of the DELETE operation. - // If you delete a specific object version, the value returned by this header - // is the version ID of the object version deleted. - DeleteMarkerVersionId *string `type:"string"` - - // The name of the deleted object. - Key *string `min:"1" type:"string"` - - // The version ID of the deleted object. - VersionId *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeletedObject) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeletedObject) GoString() string { - return s.String() -} - -// SetDeleteMarker sets the DeleteMarker field's value. -func (s *DeletedObject) SetDeleteMarker(v bool) *DeletedObject { - s.DeleteMarker = &v - return s -} - -// SetDeleteMarkerVersionId sets the DeleteMarkerVersionId field's value. -func (s *DeletedObject) SetDeleteMarkerVersionId(v string) *DeletedObject { - s.DeleteMarkerVersionId = &v - return s -} - -// SetKey sets the Key field's value. -func (s *DeletedObject) SetKey(v string) *DeletedObject { - s.Key = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *DeletedObject) SetVersionId(v string) *DeletedObject { - s.VersionId = &v - return s -} - -// Specifies information about where to publish analysis or configuration results -// for an Amazon S3 bucket and S3 Replication Time Control (S3 RTC). -type Destination struct { - _ struct{} `type:"structure"` - - // Specify this only in a cross-account scenario (where source and destination - // bucket owners are not the same), and you want to change replica ownership - // to the Amazon Web Services account that owns the destination bucket. If this - // is not specified in the replication configuration, the replicas are owned - // by same Amazon Web Services account that owns the source object. - AccessControlTranslation *AccessControlTranslation `type:"structure"` - - // Destination bucket owner account ID. In a cross-account scenario, if you - // direct Amazon S3 to change replica ownership to the Amazon Web Services account - // that owns the destination bucket by specifying the AccessControlTranslation - // property, this is the account ID of the destination bucket owner. For more - // information, see Replication Additional Configuration: Changing the Replica - // Owner (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-change-owner.html) - // in the Amazon S3 User Guide. - Account *string `type:"string"` - - // The Amazon Resource Name (ARN) of the bucket where you want Amazon S3 to - // store the results. - // - // Bucket is a required field - Bucket *string `type:"string" required:"true"` - - // A container that provides information about encryption. If SourceSelectionCriteria - // is specified, you must specify this element. - EncryptionConfiguration *EncryptionConfiguration `type:"structure"` - - // A container specifying replication metrics-related settings enabling replication - // metrics and events. - Metrics *Metrics `type:"structure"` - - // A container specifying S3 Replication Time Control (S3 RTC), including whether - // S3 RTC is enabled and the time when all objects and operations on objects - // must be replicated. Must be specified together with a Metrics block. - ReplicationTime *ReplicationTime `type:"structure"` - - // The storage class to use when replicating objects, such as S3 Standard or - // reduced redundancy. By default, Amazon S3 uses the storage class of the source - // object to create the object replica. - // - // For valid values, see the StorageClass element of the PUT Bucket replication - // (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTreplication.html) - // action in the Amazon S3 API Reference. - StorageClass *string `type:"string" enum:"StorageClass"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Destination) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Destination) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Destination) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Destination"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.AccessControlTranslation != nil { - if err := s.AccessControlTranslation.Validate(); err != nil { - invalidParams.AddNested("AccessControlTranslation", err.(request.ErrInvalidParams)) - } - } - if s.Metrics != nil { - if err := s.Metrics.Validate(); err != nil { - invalidParams.AddNested("Metrics", err.(request.ErrInvalidParams)) - } - } - if s.ReplicationTime != nil { - if err := s.ReplicationTime.Validate(); err != nil { - invalidParams.AddNested("ReplicationTime", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessControlTranslation sets the AccessControlTranslation field's value. -func (s *Destination) SetAccessControlTranslation(v *AccessControlTranslation) *Destination { - s.AccessControlTranslation = v - return s -} - -// SetAccount sets the Account field's value. -func (s *Destination) SetAccount(v string) *Destination { - s.Account = &v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *Destination) SetBucket(v string) *Destination { - s.Bucket = &v - return s -} - -func (s *Destination) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetEncryptionConfiguration sets the EncryptionConfiguration field's value. -func (s *Destination) SetEncryptionConfiguration(v *EncryptionConfiguration) *Destination { - s.EncryptionConfiguration = v - return s -} - -// SetMetrics sets the Metrics field's value. -func (s *Destination) SetMetrics(v *Metrics) *Destination { - s.Metrics = v - return s -} - -// SetReplicationTime sets the ReplicationTime field's value. -func (s *Destination) SetReplicationTime(v *ReplicationTime) *Destination { - s.ReplicationTime = v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *Destination) SetStorageClass(v string) *Destination { - s.StorageClass = &v - return s -} - -// Contains the type of server-side encryption used. -type Encryption struct { - _ struct{} `type:"structure"` - - // The server-side encryption algorithm used when storing job results in Amazon - // S3 (for example, AES256, aws:kms). - // - // EncryptionType is a required field - EncryptionType *string `type:"string" required:"true" enum:"ServerSideEncryption"` - - // If the encryption type is aws:kms, this optional value can be used to specify - // the encryption context for the restore results. - KMSContext *string `type:"string"` - - // If the encryption type is aws:kms, this optional value specifies the ID of - // the symmetric customer managed key to use for encryption of job results. - // Amazon S3 only supports symmetric keys. For more information, see Using symmetric - // and asymmetric keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) - // in the Amazon Web Services Key Management Service Developer Guide. - // - // KMSKeyId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by Encryption's - // String and GoString methods. - KMSKeyId *string `type:"string" sensitive:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Encryption) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Encryption) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Encryption) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Encryption"} - if s.EncryptionType == nil { - invalidParams.Add(request.NewErrParamRequired("EncryptionType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEncryptionType sets the EncryptionType field's value. -func (s *Encryption) SetEncryptionType(v string) *Encryption { - s.EncryptionType = &v - return s -} - -// SetKMSContext sets the KMSContext field's value. -func (s *Encryption) SetKMSContext(v string) *Encryption { - s.KMSContext = &v - return s -} - -// SetKMSKeyId sets the KMSKeyId field's value. -func (s *Encryption) SetKMSKeyId(v string) *Encryption { - s.KMSKeyId = &v - return s -} - -// Specifies encryption-related information for an Amazon S3 bucket that is -// a destination for replicated objects. -type EncryptionConfiguration struct { - _ struct{} `type:"structure"` - - // Specifies the ID (Key ARN or Alias ARN) of the customer managed Amazon Web - // Services KMS key stored in Amazon Web Services Key Management Service (KMS) - // for the destination bucket. Amazon S3 uses this key to encrypt replica objects. - // Amazon S3 only supports symmetric, customer managed KMS keys. For more information, - // see Using symmetric and asymmetric keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) - // in the Amazon Web Services Key Management Service Developer Guide. - ReplicaKmsKeyID *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EncryptionConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EncryptionConfiguration) GoString() string { - return s.String() -} - -// SetReplicaKmsKeyID sets the ReplicaKmsKeyID field's value. -func (s *EncryptionConfiguration) SetReplicaKmsKeyID(v string) *EncryptionConfiguration { - s.ReplicaKmsKeyID = &v - return s -} - -// A message that indicates the request is complete and no more messages will -// be sent. You should not assume that the request is complete until the client -// receives an EndEvent. -type EndEvent struct { - _ struct{} `locationName:"EndEvent" type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EndEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EndEvent) GoString() string { - return s.String() -} - -// The EndEvent is and event in the SelectObjectContentEventStream group of events. -func (s *EndEvent) eventSelectObjectContentEventStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the EndEvent value. -// This method is only used internally within the SDK's EventStream handling. -func (s *EndEvent) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *EndEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) - return msg, err -} - -// Container for all error elements. -type Error struct { - _ struct{} `type:"structure"` - - // The error code is a string that uniquely identifies an error condition. It - // is meant to be read and understood by programs that detect and handle errors - // by type. - // - // Amazon S3 error codes - // - // * Code: AccessDenied Description: Access Denied HTTP Status Code: 403 - // Forbidden SOAP Fault Code Prefix: Client - // - // * Code: AccountProblem Description: There is a problem with your Amazon - // Web Services account that prevents the action from completing successfully. - // Contact Amazon Web Services Support for further assistance. HTTP Status - // Code: 403 Forbidden SOAP Fault Code Prefix: Client - // - // * Code: AllAccessDisabled Description: All access to this Amazon S3 resource - // has been disabled. Contact Amazon Web Services Support for further assistance. - // HTTP Status Code: 403 Forbidden SOAP Fault Code Prefix: Client - // - // * Code: AmbiguousGrantByEmailAddress Description: The email address you - // provided is associated with more than one account. HTTP Status Code: 400 - // Bad Request SOAP Fault Code Prefix: Client - // - // * Code: AuthorizationHeaderMalformed Description: The authorization header - // you provided is invalid. HTTP Status Code: 400 Bad Request HTTP Status - // Code: N/A - // - // * Code: BadDigest Description: The Content-MD5 you specified did not match - // what we received. HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: - // Client - // - // * Code: BucketAlreadyExists Description: The requested bucket name is - // not available. The bucket namespace is shared by all users of the system. - // Please select a different name and try again. HTTP Status Code: 409 Conflict - // SOAP Fault Code Prefix: Client - // - // * Code: BucketAlreadyOwnedByYou Description: The bucket you tried to create - // already exists, and you own it. Amazon S3 returns this error in all Amazon - // Web Services Regions except in the North Virginia Region. For legacy compatibility, - // if you re-create an existing bucket that you already own in the North - // Virginia Region, Amazon S3 returns 200 OK and resets the bucket access - // control lists (ACLs). Code: 409 Conflict (in all Regions except the North - // Virginia Region) SOAP Fault Code Prefix: Client - // - // * Code: BucketNotEmpty Description: The bucket you tried to delete is - // not empty. HTTP Status Code: 409 Conflict SOAP Fault Code Prefix: Client - // - // * Code: CredentialsNotSupported Description: This request does not support - // credentials. HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: - // Client - // - // * Code: CrossLocationLoggingProhibited Description: Cross-location logging - // not allowed. Buckets in one geographic location cannot log information - // to a bucket in another location. HTTP Status Code: 403 Forbidden SOAP - // Fault Code Prefix: Client - // - // * Code: EntityTooSmall Description: Your proposed upload is smaller than - // the minimum allowed object size. HTTP Status Code: 400 Bad Request SOAP - // Fault Code Prefix: Client - // - // * Code: EntityTooLarge Description: Your proposed upload exceeds the maximum - // allowed object size. HTTP Status Code: 400 Bad Request SOAP Fault Code - // Prefix: Client - // - // * Code: ExpiredToken Description: The provided token has expired. HTTP - // Status Code: 400 Bad Request SOAP Fault Code Prefix: Client - // - // * Code: IllegalVersioningConfigurationException Description: Indicates - // that the versioning configuration specified in the request is invalid. - // HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client - // - // * Code: IncompleteBody Description: You did not provide the number of - // bytes specified by the Content-Length HTTP header HTTP Status Code: 400 - // Bad Request SOAP Fault Code Prefix: Client - // - // * Code: IncorrectNumberOfFilesInPostRequest Description: POST requires - // exactly one file upload per request. HTTP Status Code: 400 Bad Request - // SOAP Fault Code Prefix: Client - // - // * Code: InlineDataTooLarge Description: Inline data exceeds the maximum - // allowed size. HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: - // Client - // - // * Code: InternalError Description: We encountered an internal error. Please - // try again. HTTP Status Code: 500 Internal Server Error SOAP Fault Code - // Prefix: Server - // - // * Code: InvalidAccessKeyId Description: The Amazon Web Services access - // key ID you provided does not exist in our records. HTTP Status Code: 403 - // Forbidden SOAP Fault Code Prefix: Client - // - // * Code: InvalidAddressingHeader Description: You must specify the Anonymous - // role. HTTP Status Code: N/A SOAP Fault Code Prefix: Client - // - // * Code: InvalidArgument Description: Invalid Argument HTTP Status Code: - // 400 Bad Request SOAP Fault Code Prefix: Client - // - // * Code: InvalidBucketName Description: The specified bucket is not valid. - // HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client - // - // * Code: InvalidBucketState Description: The request is not valid with - // the current state of the bucket. HTTP Status Code: 409 Conflict SOAP Fault - // Code Prefix: Client - // - // * Code: InvalidDigest Description: The Content-MD5 you specified is not - // valid. HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client - // - // * Code: InvalidEncryptionAlgorithmError Description: The encryption request - // you specified is not valid. The valid value is AES256. HTTP Status Code: - // 400 Bad Request SOAP Fault Code Prefix: Client - // - // * Code: InvalidLocationConstraint Description: The specified location - // constraint is not valid. For more information about Regions, see How to - // Select a Region for Your Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingBucket.html#access-bucket-intro). - // HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client - // - // * Code: InvalidObjectState Description: The action is not valid for the - // current state of the object. HTTP Status Code: 403 Forbidden SOAP Fault - // Code Prefix: Client - // - // * Code: InvalidPart Description: One or more of the specified parts could - // not be found. The part might not have been uploaded, or the specified - // entity tag might not have matched the part's entity tag. HTTP Status Code: - // 400 Bad Request SOAP Fault Code Prefix: Client - // - // * Code: InvalidPartOrder Description: The list of parts was not in ascending - // order. Parts list must be specified in order by part number. HTTP Status - // Code: 400 Bad Request SOAP Fault Code Prefix: Client - // - // * Code: InvalidPayer Description: All access to this object has been disabled. - // Please contact Amazon Web Services Support for further assistance. HTTP - // Status Code: 403 Forbidden SOAP Fault Code Prefix: Client - // - // * Code: InvalidPolicyDocument Description: The content of the form does - // not meet the conditions specified in the policy document. HTTP Status - // Code: 400 Bad Request SOAP Fault Code Prefix: Client - // - // * Code: InvalidRange Description: The requested range cannot be satisfied. - // HTTP Status Code: 416 Requested Range Not Satisfiable SOAP Fault Code - // Prefix: Client - // - // * Code: InvalidRequest Description: Please use AWS4-HMAC-SHA256. HTTP - // Status Code: 400 Bad Request Code: N/A - // - // * Code: InvalidRequest Description: SOAP requests must be made over an - // HTTPS connection. HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: - // Client - // - // * Code: InvalidRequest Description: Amazon S3 Transfer Acceleration is - // not supported for buckets with non-DNS compliant names. HTTP Status Code: - // 400 Bad Request Code: N/A - // - // * Code: InvalidRequest Description: Amazon S3 Transfer Acceleration is - // not supported for buckets with periods (.) in their names. HTTP Status - // Code: 400 Bad Request Code: N/A - // - // * Code: InvalidRequest Description: Amazon S3 Transfer Accelerate endpoint - // only supports virtual style requests. HTTP Status Code: 400 Bad Request - // Code: N/A - // - // * Code: InvalidRequest Description: Amazon S3 Transfer Accelerate is not - // configured on this bucket. HTTP Status Code: 400 Bad Request Code: N/A - // - // * Code: InvalidRequest Description: Amazon S3 Transfer Accelerate is disabled - // on this bucket. HTTP Status Code: 400 Bad Request Code: N/A - // - // * Code: InvalidRequest Description: Amazon S3 Transfer Acceleration is - // not supported on this bucket. Contact Amazon Web Services Support for - // more information. HTTP Status Code: 400 Bad Request Code: N/A - // - // * Code: InvalidRequest Description: Amazon S3 Transfer Acceleration cannot - // be enabled on this bucket. Contact Amazon Web Services Support for more - // information. HTTP Status Code: 400 Bad Request Code: N/A - // - // * Code: InvalidSecurity Description: The provided security credentials - // are not valid. HTTP Status Code: 403 Forbidden SOAP Fault Code Prefix: - // Client - // - // * Code: InvalidSOAPRequest Description: The SOAP request body is invalid. - // HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client - // - // * Code: InvalidStorageClass Description: The storage class you specified - // is not valid. HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: - // Client - // - // * Code: InvalidTargetBucketForLogging Description: The target bucket for - // logging does not exist, is not owned by you, or does not have the appropriate - // grants for the log-delivery group. HTTP Status Code: 400 Bad Request SOAP - // Fault Code Prefix: Client - // - // * Code: InvalidToken Description: The provided token is malformed or otherwise - // invalid. HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client - // - // * Code: InvalidURI Description: Couldn't parse the specified URI. HTTP - // Status Code: 400 Bad Request SOAP Fault Code Prefix: Client - // - // * Code: KeyTooLongError Description: Your key is too long. HTTP Status - // Code: 400 Bad Request SOAP Fault Code Prefix: Client - // - // * Code: MalformedACLError Description: The XML you provided was not well-formed - // or did not validate against our published schema. HTTP Status Code: 400 - // Bad Request SOAP Fault Code Prefix: Client - // - // * Code: MalformedPOSTRequest Description: The body of your POST request - // is not well-formed multipart/form-data. HTTP Status Code: 400 Bad Request - // SOAP Fault Code Prefix: Client - // - // * Code: MalformedXML Description: This happens when the user sends malformed - // XML (XML that doesn't conform to the published XSD) for the configuration. - // The error message is, "The XML you provided was not well-formed or did - // not validate against our published schema." HTTP Status Code: 400 Bad - // Request SOAP Fault Code Prefix: Client - // - // * Code: MaxMessageLengthExceeded Description: Your request was too big. - // HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client - // - // * Code: MaxPostPreDataLengthExceededError Description: Your POST request - // fields preceding the upload file were too large. HTTP Status Code: 400 - // Bad Request SOAP Fault Code Prefix: Client - // - // * Code: MetadataTooLarge Description: Your metadata headers exceed the - // maximum allowed metadata size. HTTP Status Code: 400 Bad Request SOAP - // Fault Code Prefix: Client - // - // * Code: MethodNotAllowed Description: The specified method is not allowed - // against this resource. HTTP Status Code: 405 Method Not Allowed SOAP Fault - // Code Prefix: Client - // - // * Code: MissingAttachment Description: A SOAP attachment was expected, - // but none were found. HTTP Status Code: N/A SOAP Fault Code Prefix: Client - // - // * Code: MissingContentLength Description: You must provide the Content-Length - // HTTP header. HTTP Status Code: 411 Length Required SOAP Fault Code Prefix: - // Client - // - // * Code: MissingRequestBodyError Description: This happens when the user - // sends an empty XML document as a request. The error message is, "Request - // body is empty." HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: - // Client - // - // * Code: MissingSecurityElement Description: The SOAP 1.1 request is missing - // a security element. HTTP Status Code: 400 Bad Request SOAP Fault Code - // Prefix: Client - // - // * Code: MissingSecurityHeader Description: Your request is missing a required - // header. HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client - // - // * Code: NoLoggingStatusForKey Description: There is no such thing as a - // logging status subresource for a key. HTTP Status Code: 400 Bad Request - // SOAP Fault Code Prefix: Client - // - // * Code: NoSuchBucket Description: The specified bucket does not exist. - // HTTP Status Code: 404 Not Found SOAP Fault Code Prefix: Client - // - // * Code: NoSuchBucketPolicy Description: The specified bucket does not - // have a bucket policy. HTTP Status Code: 404 Not Found SOAP Fault Code - // Prefix: Client - // - // * Code: NoSuchKey Description: The specified key does not exist. HTTP - // Status Code: 404 Not Found SOAP Fault Code Prefix: Client - // - // * Code: NoSuchLifecycleConfiguration Description: The lifecycle configuration - // does not exist. HTTP Status Code: 404 Not Found SOAP Fault Code Prefix: - // Client - // - // * Code: NoSuchUpload Description: The specified multipart upload does - // not exist. The upload ID might be invalid, or the multipart upload might - // have been aborted or completed. HTTP Status Code: 404 Not Found SOAP Fault - // Code Prefix: Client - // - // * Code: NoSuchVersion Description: Indicates that the version ID specified - // in the request does not match an existing version. HTTP Status Code: 404 - // Not Found SOAP Fault Code Prefix: Client - // - // * Code: NotImplemented Description: A header you provided implies functionality - // that is not implemented. HTTP Status Code: 501 Not Implemented SOAP Fault - // Code Prefix: Server - // - // * Code: NotSignedUp Description: Your account is not signed up for the - // Amazon S3 service. You must sign up before you can use Amazon S3. You - // can sign up at the following URL: Amazon S3 (http://aws.amazon.com/s3) - // HTTP Status Code: 403 Forbidden SOAP Fault Code Prefix: Client - // - // * Code: OperationAborted Description: A conflicting conditional action - // is currently in progress against this resource. Try again. HTTP Status - // Code: 409 Conflict SOAP Fault Code Prefix: Client - // - // * Code: PermanentRedirect Description: The bucket you are attempting to - // access must be addressed using the specified endpoint. Send all future - // requests to this endpoint. HTTP Status Code: 301 Moved Permanently SOAP - // Fault Code Prefix: Client - // - // * Code: PreconditionFailed Description: At least one of the preconditions - // you specified did not hold. HTTP Status Code: 412 Precondition Failed - // SOAP Fault Code Prefix: Client - // - // * Code: Redirect Description: Temporary redirect. HTTP Status Code: 307 - // Moved Temporarily SOAP Fault Code Prefix: Client - // - // * Code: RestoreAlreadyInProgress Description: Object restore is already - // in progress. HTTP Status Code: 409 Conflict SOAP Fault Code Prefix: Client - // - // * Code: RequestIsNotMultiPartContent Description: Bucket POST must be - // of the enclosure-type multipart/form-data. HTTP Status Code: 400 Bad Request - // SOAP Fault Code Prefix: Client - // - // * Code: RequestTimeout Description: Your socket connection to the server - // was not read from or written to within the timeout period. HTTP Status - // Code: 400 Bad Request SOAP Fault Code Prefix: Client - // - // * Code: RequestTimeTooSkewed Description: The difference between the request - // time and the server's time is too large. HTTP Status Code: 403 Forbidden - // SOAP Fault Code Prefix: Client - // - // * Code: RequestTorrentOfBucketError Description: Requesting the torrent - // file of a bucket is not permitted. HTTP Status Code: 400 Bad Request SOAP - // Fault Code Prefix: Client - // - // * Code: SignatureDoesNotMatch Description: The request signature we calculated - // does not match the signature you provided. Check your Amazon Web Services - // secret access key and signing method. For more information, see REST Authentication - // (https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html) - // and SOAP Authentication (https://docs.aws.amazon.com/AmazonS3/latest/dev/SOAPAuthentication.html) - // for details. HTTP Status Code: 403 Forbidden SOAP Fault Code Prefix: Client - // - // * Code: ServiceUnavailable Description: Reduce your request rate. HTTP - // Status Code: 503 Service Unavailable SOAP Fault Code Prefix: Server - // - // * Code: SlowDown Description: Reduce your request rate. HTTP Status Code: - // 503 Slow Down SOAP Fault Code Prefix: Server - // - // * Code: TemporaryRedirect Description: You are being redirected to the - // bucket while DNS updates. HTTP Status Code: 307 Moved Temporarily SOAP - // Fault Code Prefix: Client - // - // * Code: TokenRefreshRequired Description: The provided token must be refreshed. - // HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client - // - // * Code: TooManyBuckets Description: You have attempted to create more - // buckets than allowed. HTTP Status Code: 400 Bad Request SOAP Fault Code - // Prefix: Client - // - // * Code: UnexpectedContent Description: This request does not support content. - // HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client - // - // * Code: UnresolvableGrantByEmailAddress Description: The email address - // you provided does not match any account on record. HTTP Status Code: 400 - // Bad Request SOAP Fault Code Prefix: Client - // - // * Code: UserKeyMustBeSpecified Description: The bucket POST must contain - // the specified field name. If it is specified, check the order of the fields. - // HTTP Status Code: 400 Bad Request SOAP Fault Code Prefix: Client - Code *string `type:"string"` - - // The error key. - Key *string `min:"1" type:"string"` - - // The error message contains a generic description of the error condition in - // English. It is intended for a human audience. Simple programs display the - // message directly to the end user if they encounter an error condition they - // don't know how or don't care to handle. Sophisticated programs with more - // exhaustive error handling and proper internationalization are more likely - // to ignore the error message. - Message *string `type:"string"` - - // The version ID of the error. - VersionId *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Error) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Error) GoString() string { - return s.String() -} - -// SetCode sets the Code field's value. -func (s *Error) SetCode(v string) *Error { - s.Code = &v - return s -} - -// SetKey sets the Key field's value. -func (s *Error) SetKey(v string) *Error { - s.Key = &v - return s -} - -// SetMessage sets the Message field's value. -func (s *Error) SetMessage(v string) *Error { - s.Message = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *Error) SetVersionId(v string) *Error { - s.VersionId = &v - return s -} - -// The error information. -type ErrorDocument struct { - _ struct{} `type:"structure"` - - // The object key name to use when a 4XX class error occurs. - // - // Replacement must be made for object keys containing special characters (such - // as carriage returns) when using XML requests. For more information, see XML - // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ErrorDocument) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ErrorDocument) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ErrorDocument) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ErrorDocument"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *ErrorDocument) SetKey(v string) *ErrorDocument { - s.Key = &v - return s -} - -// A container for specifying the configuration for Amazon EventBridge. -type EventBridgeConfiguration struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EventBridgeConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s EventBridgeConfiguration) GoString() string { - return s.String() -} - -// Optional configuration to replicate existing source bucket objects. For more -// information, see Replicating Existing Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-what-is-isnot-replicated.html#existing-object-replication) -// in the Amazon S3 User Guide. -type ExistingObjectReplication struct { - _ struct{} `type:"structure"` - - // Status is a required field - Status *string `type:"string" required:"true" enum:"ExistingObjectReplicationStatus"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ExistingObjectReplication) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ExistingObjectReplication) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ExistingObjectReplication) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ExistingObjectReplication"} - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStatus sets the Status field's value. -func (s *ExistingObjectReplication) SetStatus(v string) *ExistingObjectReplication { - s.Status = &v - return s -} - -// Specifies the Amazon S3 object key name to filter on and whether to filter -// on the suffix or prefix of the key name. -type FilterRule struct { - _ struct{} `type:"structure"` - - // The object key name prefix or suffix identifying one or more objects to which - // the filtering rule applies. The maximum length is 1,024 characters. Overlapping - // prefixes and suffixes are not supported. For more information, see Configuring - // Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - // in the Amazon S3 User Guide. - Name *string `type:"string" enum:"FilterRuleName"` - - // The value that the filter searches for in object key names. - Value *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s FilterRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s FilterRule) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *FilterRule) SetName(v string) *FilterRule { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *FilterRule) SetValue(v string) *FilterRule { - s.Value = &v - return s -} - -type GetBucketAccelerateConfigurationInput struct { - _ struct{} `locationName:"GetBucketAccelerateConfigurationRequest" type:"structure"` - - // The name of the bucket for which the accelerate configuration is retrieved. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketAccelerateConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketAccelerateConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketAccelerateConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketAccelerateConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketAccelerateConfigurationInput) SetBucket(v string) *GetBucketAccelerateConfigurationInput { - s.Bucket = &v - return s -} - -func (s *GetBucketAccelerateConfigurationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetBucketAccelerateConfigurationInput) SetExpectedBucketOwner(v string) *GetBucketAccelerateConfigurationInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *GetBucketAccelerateConfigurationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketAccelerateConfigurationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketAccelerateConfigurationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketAccelerateConfigurationOutput struct { - _ struct{} `type:"structure"` - - // The accelerate configuration of the bucket. - Status *string `type:"string" enum:"BucketAccelerateStatus"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketAccelerateConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketAccelerateConfigurationOutput) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *GetBucketAccelerateConfigurationOutput) SetStatus(v string) *GetBucketAccelerateConfigurationOutput { - s.Status = &v - return s -} - -type GetBucketAclInput struct { - _ struct{} `locationName:"GetBucketAclRequest" type:"structure"` - - // Specifies the S3 bucket whose ACL is being requested. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketAclInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketAclInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketAclInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketAclInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketAclInput) SetBucket(v string) *GetBucketAclInput { - s.Bucket = &v - return s -} - -func (s *GetBucketAclInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetBucketAclInput) SetExpectedBucketOwner(v string) *GetBucketAclInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *GetBucketAclInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketAclInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketAclInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketAclOutput struct { - _ struct{} `type:"structure"` - - // A list of grants. - Grants []*Grant `locationName:"AccessControlList" locationNameList:"Grant" type:"list"` - - // Container for the bucket owner's display name and ID. - Owner *Owner `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketAclOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketAclOutput) GoString() string { - return s.String() -} - -// SetGrants sets the Grants field's value. -func (s *GetBucketAclOutput) SetGrants(v []*Grant) *GetBucketAclOutput { - s.Grants = v - return s -} - -// SetOwner sets the Owner field's value. -func (s *GetBucketAclOutput) SetOwner(v *Owner) *GetBucketAclOutput { - s.Owner = v - return s -} - -type GetBucketAnalyticsConfigurationInput struct { - _ struct{} `locationName:"GetBucketAnalyticsConfigurationRequest" type:"structure"` - - // The name of the bucket from which an analytics configuration is retrieved. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The ID that identifies the analytics configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketAnalyticsConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketAnalyticsConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketAnalyticsConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketAnalyticsConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketAnalyticsConfigurationInput) SetBucket(v string) *GetBucketAnalyticsConfigurationInput { - s.Bucket = &v - return s -} - -func (s *GetBucketAnalyticsConfigurationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetBucketAnalyticsConfigurationInput) SetExpectedBucketOwner(v string) *GetBucketAnalyticsConfigurationInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetBucketAnalyticsConfigurationInput) SetId(v string) *GetBucketAnalyticsConfigurationInput { - s.Id = &v - return s -} - -func (s *GetBucketAnalyticsConfigurationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketAnalyticsConfigurationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketAnalyticsConfigurationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketAnalyticsConfigurationOutput struct { - _ struct{} `type:"structure" payload:"AnalyticsConfiguration"` - - // The configuration and any analyses for the analytics filter. - AnalyticsConfiguration *AnalyticsConfiguration `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketAnalyticsConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketAnalyticsConfigurationOutput) GoString() string { - return s.String() -} - -// SetAnalyticsConfiguration sets the AnalyticsConfiguration field's value. -func (s *GetBucketAnalyticsConfigurationOutput) SetAnalyticsConfiguration(v *AnalyticsConfiguration) *GetBucketAnalyticsConfigurationOutput { - s.AnalyticsConfiguration = v - return s -} - -type GetBucketCorsInput struct { - _ struct{} `locationName:"GetBucketCorsRequest" type:"structure"` - - // The bucket name for which to get the cors configuration. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketCorsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketCorsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketCorsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketCorsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketCorsInput) SetBucket(v string) *GetBucketCorsInput { - s.Bucket = &v - return s -} - -func (s *GetBucketCorsInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetBucketCorsInput) SetExpectedBucketOwner(v string) *GetBucketCorsInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *GetBucketCorsInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketCorsInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketCorsInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketCorsOutput struct { - _ struct{} `type:"structure"` - - // A set of origins and methods (cross-origin access that you want to allow). - // You can add up to 100 rules to the configuration. - CORSRules []*CORSRule `locationName:"CORSRule" type:"list" flattened:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketCorsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketCorsOutput) GoString() string { - return s.String() -} - -// SetCORSRules sets the CORSRules field's value. -func (s *GetBucketCorsOutput) SetCORSRules(v []*CORSRule) *GetBucketCorsOutput { - s.CORSRules = v - return s -} - -type GetBucketEncryptionInput struct { - _ struct{} `locationName:"GetBucketEncryptionRequest" type:"structure"` - - // The name of the bucket from which the server-side encryption configuration - // is retrieved. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketEncryptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketEncryptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketEncryptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketEncryptionInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketEncryptionInput) SetBucket(v string) *GetBucketEncryptionInput { - s.Bucket = &v - return s -} - -func (s *GetBucketEncryptionInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetBucketEncryptionInput) SetExpectedBucketOwner(v string) *GetBucketEncryptionInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *GetBucketEncryptionInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketEncryptionInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketEncryptionInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketEncryptionOutput struct { - _ struct{} `type:"structure" payload:"ServerSideEncryptionConfiguration"` - - // Specifies the default server-side-encryption configuration. - ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketEncryptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketEncryptionOutput) GoString() string { - return s.String() -} - -// SetServerSideEncryptionConfiguration sets the ServerSideEncryptionConfiguration field's value. -func (s *GetBucketEncryptionOutput) SetServerSideEncryptionConfiguration(v *ServerSideEncryptionConfiguration) *GetBucketEncryptionOutput { - s.ServerSideEncryptionConfiguration = v - return s -} - -type GetBucketIntelligentTieringConfigurationInput struct { - _ struct{} `locationName:"GetBucketIntelligentTieringConfigurationRequest" type:"structure"` - - // The name of the Amazon S3 bucket whose configuration you want to modify or - // retrieve. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The ID used to identify the S3 Intelligent-Tiering configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketIntelligentTieringConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketIntelligentTieringConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketIntelligentTieringConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketIntelligentTieringConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketIntelligentTieringConfigurationInput) SetBucket(v string) *GetBucketIntelligentTieringConfigurationInput { - s.Bucket = &v - return s -} - -func (s *GetBucketIntelligentTieringConfigurationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetId sets the Id field's value. -func (s *GetBucketIntelligentTieringConfigurationInput) SetId(v string) *GetBucketIntelligentTieringConfigurationInput { - s.Id = &v - return s -} - -func (s *GetBucketIntelligentTieringConfigurationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketIntelligentTieringConfigurationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketIntelligentTieringConfigurationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketIntelligentTieringConfigurationOutput struct { - _ struct{} `type:"structure" payload:"IntelligentTieringConfiguration"` - - // Container for S3 Intelligent-Tiering configuration. - IntelligentTieringConfiguration *IntelligentTieringConfiguration `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketIntelligentTieringConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketIntelligentTieringConfigurationOutput) GoString() string { - return s.String() -} - -// SetIntelligentTieringConfiguration sets the IntelligentTieringConfiguration field's value. -func (s *GetBucketIntelligentTieringConfigurationOutput) SetIntelligentTieringConfiguration(v *IntelligentTieringConfiguration) *GetBucketIntelligentTieringConfigurationOutput { - s.IntelligentTieringConfiguration = v - return s -} - -type GetBucketInventoryConfigurationInput struct { - _ struct{} `locationName:"GetBucketInventoryConfigurationRequest" type:"structure"` - - // The name of the bucket containing the inventory configuration to retrieve. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The ID used to identify the inventory configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketInventoryConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketInventoryConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketInventoryConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketInventoryConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketInventoryConfigurationInput) SetBucket(v string) *GetBucketInventoryConfigurationInput { - s.Bucket = &v - return s -} - -func (s *GetBucketInventoryConfigurationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetBucketInventoryConfigurationInput) SetExpectedBucketOwner(v string) *GetBucketInventoryConfigurationInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetBucketInventoryConfigurationInput) SetId(v string) *GetBucketInventoryConfigurationInput { - s.Id = &v - return s -} - -func (s *GetBucketInventoryConfigurationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketInventoryConfigurationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketInventoryConfigurationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketInventoryConfigurationOutput struct { - _ struct{} `type:"structure" payload:"InventoryConfiguration"` - - // Specifies the inventory configuration. - InventoryConfiguration *InventoryConfiguration `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketInventoryConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketInventoryConfigurationOutput) GoString() string { - return s.String() -} - -// SetInventoryConfiguration sets the InventoryConfiguration field's value. -func (s *GetBucketInventoryConfigurationOutput) SetInventoryConfiguration(v *InventoryConfiguration) *GetBucketInventoryConfigurationOutput { - s.InventoryConfiguration = v - return s -} - -type GetBucketLifecycleConfigurationInput struct { - _ struct{} `locationName:"GetBucketLifecycleConfigurationRequest" type:"structure"` - - // The name of the bucket for which to get the lifecycle information. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketLifecycleConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketLifecycleConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketLifecycleConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketLifecycleConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketLifecycleConfigurationInput) SetBucket(v string) *GetBucketLifecycleConfigurationInput { - s.Bucket = &v - return s -} - -func (s *GetBucketLifecycleConfigurationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetBucketLifecycleConfigurationInput) SetExpectedBucketOwner(v string) *GetBucketLifecycleConfigurationInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *GetBucketLifecycleConfigurationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketLifecycleConfigurationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketLifecycleConfigurationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketLifecycleConfigurationOutput struct { - _ struct{} `type:"structure"` - - // Container for a lifecycle rule. - Rules []*LifecycleRule `locationName:"Rule" type:"list" flattened:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketLifecycleConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketLifecycleConfigurationOutput) GoString() string { - return s.String() -} - -// SetRules sets the Rules field's value. -func (s *GetBucketLifecycleConfigurationOutput) SetRules(v []*LifecycleRule) *GetBucketLifecycleConfigurationOutput { - s.Rules = v - return s -} - -type GetBucketLifecycleInput struct { - _ struct{} `locationName:"GetBucketLifecycleRequest" type:"structure"` - - // The name of the bucket for which to get the lifecycle information. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketLifecycleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketLifecycleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketLifecycleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketLifecycleInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketLifecycleInput) SetBucket(v string) *GetBucketLifecycleInput { - s.Bucket = &v - return s -} - -func (s *GetBucketLifecycleInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetBucketLifecycleInput) SetExpectedBucketOwner(v string) *GetBucketLifecycleInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *GetBucketLifecycleInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketLifecycleInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketLifecycleInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketLifecycleOutput struct { - _ struct{} `type:"structure"` - - // Container for a lifecycle rule. - Rules []*Rule `locationName:"Rule" type:"list" flattened:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketLifecycleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketLifecycleOutput) GoString() string { - return s.String() -} - -// SetRules sets the Rules field's value. -func (s *GetBucketLifecycleOutput) SetRules(v []*Rule) *GetBucketLifecycleOutput { - s.Rules = v - return s -} - -type GetBucketLocationInput struct { - _ struct{} `locationName:"GetBucketLocationRequest" type:"structure"` - - // The name of the bucket for which to get the location. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketLocationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketLocationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketLocationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketLocationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketLocationInput) SetBucket(v string) *GetBucketLocationInput { - s.Bucket = &v - return s -} - -func (s *GetBucketLocationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetBucketLocationInput) SetExpectedBucketOwner(v string) *GetBucketLocationInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *GetBucketLocationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketLocationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketLocationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketLocationOutput struct { - _ struct{} `type:"structure"` - - // Specifies the Region where the bucket resides. For a list of all the Amazon - // S3 supported location constraints by Region, see Regions and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region). - // Buckets in Region us-east-1 have a LocationConstraint of null. - LocationConstraint *string `type:"string" enum:"BucketLocationConstraint"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketLocationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketLocationOutput) GoString() string { - return s.String() -} - -// SetLocationConstraint sets the LocationConstraint field's value. -func (s *GetBucketLocationOutput) SetLocationConstraint(v string) *GetBucketLocationOutput { - s.LocationConstraint = &v - return s -} - -type GetBucketLoggingInput struct { - _ struct{} `locationName:"GetBucketLoggingRequest" type:"structure"` - - // The bucket name for which to get the logging information. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketLoggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketLoggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketLoggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketLoggingInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketLoggingInput) SetBucket(v string) *GetBucketLoggingInput { - s.Bucket = &v - return s -} - -func (s *GetBucketLoggingInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetBucketLoggingInput) SetExpectedBucketOwner(v string) *GetBucketLoggingInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *GetBucketLoggingInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketLoggingInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketLoggingInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketLoggingOutput struct { - _ struct{} `type:"structure"` - - // Describes where logs are stored and the prefix that Amazon S3 assigns to - // all log object keys for a bucket. For more information, see PUT Bucket logging - // (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html) - // in the Amazon S3 API Reference. - LoggingEnabled *LoggingEnabled `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketLoggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketLoggingOutput) GoString() string { - return s.String() -} - -// SetLoggingEnabled sets the LoggingEnabled field's value. -func (s *GetBucketLoggingOutput) SetLoggingEnabled(v *LoggingEnabled) *GetBucketLoggingOutput { - s.LoggingEnabled = v - return s -} - -type GetBucketMetricsConfigurationInput struct { - _ struct{} `locationName:"GetBucketMetricsConfigurationRequest" type:"structure"` - - // The name of the bucket containing the metrics configuration to retrieve. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The ID used to identify the metrics configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketMetricsConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketMetricsConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketMetricsConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketMetricsConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketMetricsConfigurationInput) SetBucket(v string) *GetBucketMetricsConfigurationInput { - s.Bucket = &v - return s -} - -func (s *GetBucketMetricsConfigurationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetBucketMetricsConfigurationInput) SetExpectedBucketOwner(v string) *GetBucketMetricsConfigurationInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetId sets the Id field's value. -func (s *GetBucketMetricsConfigurationInput) SetId(v string) *GetBucketMetricsConfigurationInput { - s.Id = &v - return s -} - -func (s *GetBucketMetricsConfigurationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketMetricsConfigurationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketMetricsConfigurationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketMetricsConfigurationOutput struct { - _ struct{} `type:"structure" payload:"MetricsConfiguration"` - - // Specifies the metrics configuration. - MetricsConfiguration *MetricsConfiguration `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketMetricsConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketMetricsConfigurationOutput) GoString() string { - return s.String() -} - -// SetMetricsConfiguration sets the MetricsConfiguration field's value. -func (s *GetBucketMetricsConfigurationOutput) SetMetricsConfiguration(v *MetricsConfiguration) *GetBucketMetricsConfigurationOutput { - s.MetricsConfiguration = v - return s -} - -type GetBucketNotificationConfigurationRequest struct { - _ struct{} `locationName:"GetBucketNotificationConfigurationRequest" type:"structure"` - - // The name of the bucket for which to get the notification configuration. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketNotificationConfigurationRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketNotificationConfigurationRequest) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketNotificationConfigurationRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketNotificationConfigurationRequest"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketNotificationConfigurationRequest) SetBucket(v string) *GetBucketNotificationConfigurationRequest { - s.Bucket = &v - return s -} - -func (s *GetBucketNotificationConfigurationRequest) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetBucketNotificationConfigurationRequest) SetExpectedBucketOwner(v string) *GetBucketNotificationConfigurationRequest { - s.ExpectedBucketOwner = &v - return s -} - -func (s *GetBucketNotificationConfigurationRequest) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketNotificationConfigurationRequest) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketNotificationConfigurationRequest) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketOwnershipControlsInput struct { - _ struct{} `locationName:"GetBucketOwnershipControlsRequest" type:"structure"` - - // The name of the Amazon S3 bucket whose OwnershipControls you want to retrieve. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketOwnershipControlsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketOwnershipControlsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketOwnershipControlsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketOwnershipControlsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketOwnershipControlsInput) SetBucket(v string) *GetBucketOwnershipControlsInput { - s.Bucket = &v - return s -} - -func (s *GetBucketOwnershipControlsInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetBucketOwnershipControlsInput) SetExpectedBucketOwner(v string) *GetBucketOwnershipControlsInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *GetBucketOwnershipControlsInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketOwnershipControlsInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketOwnershipControlsInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketOwnershipControlsOutput struct { - _ struct{} `type:"structure" payload:"OwnershipControls"` - - // The OwnershipControls (BucketOwnerEnforced, BucketOwnerPreferred, or ObjectWriter) - // currently in effect for this Amazon S3 bucket. - OwnershipControls *OwnershipControls `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketOwnershipControlsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketOwnershipControlsOutput) GoString() string { - return s.String() -} - -// SetOwnershipControls sets the OwnershipControls field's value. -func (s *GetBucketOwnershipControlsOutput) SetOwnershipControls(v *OwnershipControls) *GetBucketOwnershipControlsOutput { - s.OwnershipControls = v - return s -} - -type GetBucketPolicyInput struct { - _ struct{} `locationName:"GetBucketPolicyRequest" type:"structure"` - - // The bucket name for which to get the bucket policy. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketPolicyInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketPolicyInput) SetBucket(v string) *GetBucketPolicyInput { - s.Bucket = &v - return s -} - -func (s *GetBucketPolicyInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetBucketPolicyInput) SetExpectedBucketOwner(v string) *GetBucketPolicyInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *GetBucketPolicyInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketPolicyInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketPolicyInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketPolicyOutput struct { - _ struct{} `type:"structure" payload:"Policy"` - - // The bucket policy as a JSON document. - Policy *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketPolicyOutput) GoString() string { - return s.String() -} - -// SetPolicy sets the Policy field's value. -func (s *GetBucketPolicyOutput) SetPolicy(v string) *GetBucketPolicyOutput { - s.Policy = &v - return s -} - -type GetBucketPolicyStatusInput struct { - _ struct{} `locationName:"GetBucketPolicyStatusRequest" type:"structure"` - - // The name of the Amazon S3 bucket whose policy status you want to retrieve. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketPolicyStatusInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketPolicyStatusInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketPolicyStatusInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketPolicyStatusInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketPolicyStatusInput) SetBucket(v string) *GetBucketPolicyStatusInput { - s.Bucket = &v - return s -} - -func (s *GetBucketPolicyStatusInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetBucketPolicyStatusInput) SetExpectedBucketOwner(v string) *GetBucketPolicyStatusInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *GetBucketPolicyStatusInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketPolicyStatusInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketPolicyStatusInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketPolicyStatusOutput struct { - _ struct{} `type:"structure" payload:"PolicyStatus"` - - // The policy status for the specified bucket. - PolicyStatus *PolicyStatus `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketPolicyStatusOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketPolicyStatusOutput) GoString() string { - return s.String() -} - -// SetPolicyStatus sets the PolicyStatus field's value. -func (s *GetBucketPolicyStatusOutput) SetPolicyStatus(v *PolicyStatus) *GetBucketPolicyStatusOutput { - s.PolicyStatus = v - return s -} - -type GetBucketReplicationInput struct { - _ struct{} `locationName:"GetBucketReplicationRequest" type:"structure"` - - // The bucket name for which to get the replication information. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketReplicationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketReplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketReplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketReplicationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketReplicationInput) SetBucket(v string) *GetBucketReplicationInput { - s.Bucket = &v - return s -} - -func (s *GetBucketReplicationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetBucketReplicationInput) SetExpectedBucketOwner(v string) *GetBucketReplicationInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *GetBucketReplicationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketReplicationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketReplicationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketReplicationOutput struct { - _ struct{} `type:"structure" payload:"ReplicationConfiguration"` - - // A container for replication rules. You can add up to 1,000 rules. The maximum - // size of a replication configuration is 2 MB. - ReplicationConfiguration *ReplicationConfiguration `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketReplicationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketReplicationOutput) GoString() string { - return s.String() -} - -// SetReplicationConfiguration sets the ReplicationConfiguration field's value. -func (s *GetBucketReplicationOutput) SetReplicationConfiguration(v *ReplicationConfiguration) *GetBucketReplicationOutput { - s.ReplicationConfiguration = v - return s -} - -type GetBucketRequestPaymentInput struct { - _ struct{} `locationName:"GetBucketRequestPaymentRequest" type:"structure"` - - // The name of the bucket for which to get the payment request configuration - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketRequestPaymentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketRequestPaymentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketRequestPaymentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketRequestPaymentInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketRequestPaymentInput) SetBucket(v string) *GetBucketRequestPaymentInput { - s.Bucket = &v - return s -} - -func (s *GetBucketRequestPaymentInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetBucketRequestPaymentInput) SetExpectedBucketOwner(v string) *GetBucketRequestPaymentInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *GetBucketRequestPaymentInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketRequestPaymentInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketRequestPaymentInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketRequestPaymentOutput struct { - _ struct{} `type:"structure"` - - // Specifies who pays for the download and request fees. - Payer *string `type:"string" enum:"Payer"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketRequestPaymentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketRequestPaymentOutput) GoString() string { - return s.String() -} - -// SetPayer sets the Payer field's value. -func (s *GetBucketRequestPaymentOutput) SetPayer(v string) *GetBucketRequestPaymentOutput { - s.Payer = &v - return s -} - -type GetBucketTaggingInput struct { - _ struct{} `locationName:"GetBucketTaggingRequest" type:"structure"` - - // The name of the bucket for which to get the tagging information. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketTaggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketTaggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketTaggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketTaggingInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketTaggingInput) SetBucket(v string) *GetBucketTaggingInput { - s.Bucket = &v - return s -} - -func (s *GetBucketTaggingInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetBucketTaggingInput) SetExpectedBucketOwner(v string) *GetBucketTaggingInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *GetBucketTaggingInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketTaggingInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketTaggingInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketTaggingOutput struct { - _ struct{} `type:"structure"` - - // Contains the tag set. - // - // TagSet is a required field - TagSet []*Tag `locationNameList:"Tag" type:"list" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketTaggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketTaggingOutput) GoString() string { - return s.String() -} - -// SetTagSet sets the TagSet field's value. -func (s *GetBucketTaggingOutput) SetTagSet(v []*Tag) *GetBucketTaggingOutput { - s.TagSet = v - return s -} - -type GetBucketVersioningInput struct { - _ struct{} `locationName:"GetBucketVersioningRequest" type:"structure"` - - // The name of the bucket for which to get the versioning information. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketVersioningInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketVersioningInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketVersioningInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketVersioningInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketVersioningInput) SetBucket(v string) *GetBucketVersioningInput { - s.Bucket = &v - return s -} - -func (s *GetBucketVersioningInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetBucketVersioningInput) SetExpectedBucketOwner(v string) *GetBucketVersioningInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *GetBucketVersioningInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketVersioningInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketVersioningInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketVersioningOutput struct { - _ struct{} `type:"structure"` - - // Specifies whether MFA delete is enabled in the bucket versioning configuration. - // This element is only returned if the bucket has been configured with MFA - // delete. If the bucket has never been so configured, this element is not returned. - MFADelete *string `locationName:"MfaDelete" type:"string" enum:"MFADeleteStatus"` - - // The versioning state of the bucket. - Status *string `type:"string" enum:"BucketVersioningStatus"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketVersioningOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketVersioningOutput) GoString() string { - return s.String() -} - -// SetMFADelete sets the MFADelete field's value. -func (s *GetBucketVersioningOutput) SetMFADelete(v string) *GetBucketVersioningOutput { - s.MFADelete = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *GetBucketVersioningOutput) SetStatus(v string) *GetBucketVersioningOutput { - s.Status = &v - return s -} - -type GetBucketWebsiteInput struct { - _ struct{} `locationName:"GetBucketWebsiteRequest" type:"structure"` - - // The bucket name for which to get the website configuration. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketWebsiteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketWebsiteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetBucketWebsiteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetBucketWebsiteInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetBucketWebsiteInput) SetBucket(v string) *GetBucketWebsiteInput { - s.Bucket = &v - return s -} - -func (s *GetBucketWebsiteInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetBucketWebsiteInput) SetExpectedBucketOwner(v string) *GetBucketWebsiteInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *GetBucketWebsiteInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetBucketWebsiteInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetBucketWebsiteInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetBucketWebsiteOutput struct { - _ struct{} `type:"structure"` - - // The object key name of the website error document to use for 4XX class errors. - ErrorDocument *ErrorDocument `type:"structure"` - - // The name of the index document for the website (for example index.html). - IndexDocument *IndexDocument `type:"structure"` - - // Specifies the redirect behavior of all requests to a website endpoint of - // an Amazon S3 bucket. - RedirectAllRequestsTo *RedirectAllRequestsTo `type:"structure"` - - // Rules that define when a redirect is applied and the redirect behavior. - RoutingRules []*RoutingRule `locationNameList:"RoutingRule" type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketWebsiteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetBucketWebsiteOutput) GoString() string { - return s.String() -} - -// SetErrorDocument sets the ErrorDocument field's value. -func (s *GetBucketWebsiteOutput) SetErrorDocument(v *ErrorDocument) *GetBucketWebsiteOutput { - s.ErrorDocument = v - return s -} - -// SetIndexDocument sets the IndexDocument field's value. -func (s *GetBucketWebsiteOutput) SetIndexDocument(v *IndexDocument) *GetBucketWebsiteOutput { - s.IndexDocument = v - return s -} - -// SetRedirectAllRequestsTo sets the RedirectAllRequestsTo field's value. -func (s *GetBucketWebsiteOutput) SetRedirectAllRequestsTo(v *RedirectAllRequestsTo) *GetBucketWebsiteOutput { - s.RedirectAllRequestsTo = v - return s -} - -// SetRoutingRules sets the RoutingRules field's value. -func (s *GetBucketWebsiteOutput) SetRoutingRules(v []*RoutingRule) *GetBucketWebsiteOutput { - s.RoutingRules = v - return s -} - -type GetObjectAclInput struct { - _ struct{} `locationName:"GetObjectAclRequest" type:"structure"` - - // The bucket name that contains the object for which to get the ACL information. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The key of the object for which to get the ACL information. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // VersionId used to reference a specific version of the object. - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectAclInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectAclInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetObjectAclInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetObjectAclInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetObjectAclInput) SetBucket(v string) *GetObjectAclInput { - s.Bucket = &v - return s -} - -func (s *GetObjectAclInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetObjectAclInput) SetExpectedBucketOwner(v string) *GetObjectAclInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetKey sets the Key field's value. -func (s *GetObjectAclInput) SetKey(v string) *GetObjectAclInput { - s.Key = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *GetObjectAclInput) SetRequestPayer(v string) *GetObjectAclInput { - s.RequestPayer = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *GetObjectAclInput) SetVersionId(v string) *GetObjectAclInput { - s.VersionId = &v - return s -} - -func (s *GetObjectAclInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetObjectAclInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetObjectAclInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetObjectAclOutput struct { - _ struct{} `type:"structure"` - - // A list of grants. - Grants []*Grant `locationName:"AccessControlList" locationNameList:"Grant" type:"list"` - - // Container for the bucket owner's display name and ID. - Owner *Owner `type:"structure"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectAclOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectAclOutput) GoString() string { - return s.String() -} - -// SetGrants sets the Grants field's value. -func (s *GetObjectAclOutput) SetGrants(v []*Grant) *GetObjectAclOutput { - s.Grants = v - return s -} - -// SetOwner sets the Owner field's value. -func (s *GetObjectAclOutput) SetOwner(v *Owner) *GetObjectAclOutput { - s.Owner = v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *GetObjectAclOutput) SetRequestCharged(v string) *GetObjectAclOutput { - s.RequestCharged = &v - return s -} - -type GetObjectAttributesInput struct { - _ struct{} `locationName:"GetObjectAttributesRequest" type:"structure"` - - // The name of the bucket that contains the object. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The object key. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Sets the maximum number of parts to return. - MaxParts *int64 `location:"header" locationName:"x-amz-max-parts" type:"integer"` - - // An XML header that specifies the fields at the root level that you want returned - // in the response. Fields that you do not specify are not returned. - // - // ObjectAttributes is a required field - ObjectAttributes []*string `location:"header" locationName:"x-amz-object-attributes" type:"list" required:"true" enum:"ObjectAttributes"` - - // Specifies the part after which listing should begin. Only parts with higher - // part numbers will be listed. - PartNumberMarker *int64 `location:"header" locationName:"x-amz-part-number-marker" type:"integer"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // Specifies the algorithm to use when encrypting the object (for example, AES256). - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting - // data. This value is used to store the object and then it is discarded; Amazon - // S3 does not store the encryption key. The key must be appropriate for use - // with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm - // header. - // - // SSECustomerKey is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetObjectAttributesInput's - // String and GoString methods. - SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` - - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure that the - // encryption key was transmitted without error. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // The version ID used to reference a specific version of the object. - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectAttributesInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectAttributesInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetObjectAttributesInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetObjectAttributesInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.ObjectAttributes == nil { - invalidParams.Add(request.NewErrParamRequired("ObjectAttributes")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetObjectAttributesInput) SetBucket(v string) *GetObjectAttributesInput { - s.Bucket = &v - return s -} - -func (s *GetObjectAttributesInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetObjectAttributesInput) SetExpectedBucketOwner(v string) *GetObjectAttributesInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetKey sets the Key field's value. -func (s *GetObjectAttributesInput) SetKey(v string) *GetObjectAttributesInput { - s.Key = &v - return s -} - -// SetMaxParts sets the MaxParts field's value. -func (s *GetObjectAttributesInput) SetMaxParts(v int64) *GetObjectAttributesInput { - s.MaxParts = &v - return s -} - -// SetObjectAttributes sets the ObjectAttributes field's value. -func (s *GetObjectAttributesInput) SetObjectAttributes(v []*string) *GetObjectAttributesInput { - s.ObjectAttributes = v - return s -} - -// SetPartNumberMarker sets the PartNumberMarker field's value. -func (s *GetObjectAttributesInput) SetPartNumberMarker(v int64) *GetObjectAttributesInput { - s.PartNumberMarker = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *GetObjectAttributesInput) SetRequestPayer(v string) *GetObjectAttributesInput { - s.RequestPayer = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *GetObjectAttributesInput) SetSSECustomerAlgorithm(v string) *GetObjectAttributesInput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKey sets the SSECustomerKey field's value. -func (s *GetObjectAttributesInput) SetSSECustomerKey(v string) *GetObjectAttributesInput { - s.SSECustomerKey = &v - return s -} - -func (s *GetObjectAttributesInput) getSSECustomerKey() (v string) { - if s.SSECustomerKey == nil { - return v - } - return *s.SSECustomerKey -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *GetObjectAttributesInput) SetSSECustomerKeyMD5(v string) *GetObjectAttributesInput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *GetObjectAttributesInput) SetVersionId(v string) *GetObjectAttributesInput { - s.VersionId = &v - return s -} - -func (s *GetObjectAttributesInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetObjectAttributesInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetObjectAttributesInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetObjectAttributesOutput struct { - _ struct{} `type:"structure"` - - // The checksum or digest of the object. - Checksum *Checksum `type:"structure"` - - // Specifies whether the object retrieved was (true) or was not (false) a delete - // marker. If false, this response header does not appear in the response. - DeleteMarker *bool `location:"header" locationName:"x-amz-delete-marker" type:"boolean"` - - // An ETag is an opaque identifier assigned by a web server to a specific version - // of a resource found at a URL. - ETag *string `type:"string"` - - // The creation date of the object. - LastModified *time.Time `location:"header" locationName:"Last-Modified" type:"timestamp"` - - // A collection of parts associated with a multipart upload. - ObjectParts *GetObjectAttributesParts `type:"structure"` - - // The size of the object in bytes. - ObjectSize *int64 `type:"long"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // Provides the storage class information of the object. Amazon S3 returns this - // header for all objects except for S3 Standard storage class objects. - // - // For more information, see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html). - StorageClass *string `type:"string" enum:"StorageClass"` - - // The version ID of the object. - VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectAttributesOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectAttributesOutput) GoString() string { - return s.String() -} - -// SetChecksum sets the Checksum field's value. -func (s *GetObjectAttributesOutput) SetChecksum(v *Checksum) *GetObjectAttributesOutput { - s.Checksum = v - return s -} - -// SetDeleteMarker sets the DeleteMarker field's value. -func (s *GetObjectAttributesOutput) SetDeleteMarker(v bool) *GetObjectAttributesOutput { - s.DeleteMarker = &v - return s -} - -// SetETag sets the ETag field's value. -func (s *GetObjectAttributesOutput) SetETag(v string) *GetObjectAttributesOutput { - s.ETag = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *GetObjectAttributesOutput) SetLastModified(v time.Time) *GetObjectAttributesOutput { - s.LastModified = &v - return s -} - -// SetObjectParts sets the ObjectParts field's value. -func (s *GetObjectAttributesOutput) SetObjectParts(v *GetObjectAttributesParts) *GetObjectAttributesOutput { - s.ObjectParts = v - return s -} - -// SetObjectSize sets the ObjectSize field's value. -func (s *GetObjectAttributesOutput) SetObjectSize(v int64) *GetObjectAttributesOutput { - s.ObjectSize = &v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *GetObjectAttributesOutput) SetRequestCharged(v string) *GetObjectAttributesOutput { - s.RequestCharged = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *GetObjectAttributesOutput) SetStorageClass(v string) *GetObjectAttributesOutput { - s.StorageClass = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *GetObjectAttributesOutput) SetVersionId(v string) *GetObjectAttributesOutput { - s.VersionId = &v - return s -} - -// A collection of parts associated with a multipart upload. -type GetObjectAttributesParts struct { - _ struct{} `type:"structure"` - - // Indicates whether the returned list of parts is truncated. A value of true - // indicates that the list was truncated. A list can be truncated if the number - // of parts exceeds the limit returned in the MaxParts element. - IsTruncated *bool `type:"boolean"` - - // The maximum number of parts allowed in the response. - MaxParts *int64 `type:"integer"` - - // When a list is truncated, this element specifies the last part in the list, - // as well as the value to use for the PartNumberMarker request parameter in - // a subsequent request. - NextPartNumberMarker *int64 `type:"integer"` - - // The marker for the current part. - PartNumberMarker *int64 `type:"integer"` - - // A container for elements related to a particular part. A response can contain - // zero or more Parts elements. - Parts []*ObjectPart `locationName:"Part" type:"list" flattened:"true"` - - // The total number of parts. - TotalPartsCount *int64 `locationName:"PartsCount" type:"integer"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectAttributesParts) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectAttributesParts) GoString() string { - return s.String() -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *GetObjectAttributesParts) SetIsTruncated(v bool) *GetObjectAttributesParts { - s.IsTruncated = &v - return s -} - -// SetMaxParts sets the MaxParts field's value. -func (s *GetObjectAttributesParts) SetMaxParts(v int64) *GetObjectAttributesParts { - s.MaxParts = &v - return s -} - -// SetNextPartNumberMarker sets the NextPartNumberMarker field's value. -func (s *GetObjectAttributesParts) SetNextPartNumberMarker(v int64) *GetObjectAttributesParts { - s.NextPartNumberMarker = &v - return s -} - -// SetPartNumberMarker sets the PartNumberMarker field's value. -func (s *GetObjectAttributesParts) SetPartNumberMarker(v int64) *GetObjectAttributesParts { - s.PartNumberMarker = &v - return s -} - -// SetParts sets the Parts field's value. -func (s *GetObjectAttributesParts) SetParts(v []*ObjectPart) *GetObjectAttributesParts { - s.Parts = v - return s -} - -// SetTotalPartsCount sets the TotalPartsCount field's value. -func (s *GetObjectAttributesParts) SetTotalPartsCount(v int64) *GetObjectAttributesParts { - s.TotalPartsCount = &v - return s -} - -type GetObjectInput struct { - _ struct{} `locationName:"GetObjectRequest" type:"structure"` - - // The bucket name containing the object. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using an Object Lambda access point the hostname takes the form AccessPointName-AccountId.s3-object-lambda.Region.amazonaws.com. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // To retrieve the checksum, this mode must be enabled. - // - // The AWS SDK for Go v1 does not support automatic response payload checksum - // validation. This feature is available in the AWS SDK for Go v2. - ChecksumMode *string `location:"header" locationName:"x-amz-checksum-mode" type:"string" enum:"ChecksumMode"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Return the object only if its entity tag (ETag) is the same as the one specified; - // otherwise, return a 412 (precondition failed) error. - IfMatch *string `location:"header" locationName:"If-Match" type:"string"` - - // Return the object only if it has been modified since the specified time; - // otherwise, return a 304 (not modified) error. - IfModifiedSince *time.Time `location:"header" locationName:"If-Modified-Since" type:"timestamp"` - - // Return the object only if its entity tag (ETag) is different from the one - // specified; otherwise, return a 304 (not modified) error. - IfNoneMatch *string `location:"header" locationName:"If-None-Match" type:"string"` - - // Return the object only if it has not been modified since the specified time; - // otherwise, return a 412 (precondition failed) error. - IfUnmodifiedSince *time.Time `location:"header" locationName:"If-Unmodified-Since" type:"timestamp"` - - // Key of the object to get. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Part number of the object being read. This is a positive integer between - // 1 and 10,000. Effectively performs a 'ranged' GET request for the part specified. - // Useful for downloading just a part of an object. - PartNumber *int64 `location:"querystring" locationName:"partNumber" type:"integer"` - - // Downloads the specified range bytes of an object. For more information about - // the HTTP Range header, see https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35 - // (https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35). - // - // Amazon S3 doesn't support retrieving multiple ranges of data per GET request. - Range *string `location:"header" locationName:"Range" type:"string"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // Sets the Cache-Control header of the response. - ResponseCacheControl *string `location:"querystring" locationName:"response-cache-control" type:"string"` - - // Sets the Content-Disposition header of the response - ResponseContentDisposition *string `location:"querystring" locationName:"response-content-disposition" type:"string"` - - // Sets the Content-Encoding header of the response. - ResponseContentEncoding *string `location:"querystring" locationName:"response-content-encoding" type:"string"` - - // Sets the Content-Language header of the response. - ResponseContentLanguage *string `location:"querystring" locationName:"response-content-language" type:"string"` - - // Sets the Content-Type header of the response. - ResponseContentType *string `location:"querystring" locationName:"response-content-type" type:"string"` - - // Sets the Expires header of the response. - ResponseExpires *time.Time `location:"querystring" locationName:"response-expires" type:"timestamp" timestampFormat:"rfc822"` - - // Specifies the algorithm to use to when decrypting the object (for example, - // AES256). - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // Specifies the customer-provided encryption key for Amazon S3 used to encrypt - // the data. This value is used to decrypt the object when recovering it and - // must match the one used when storing the data. The key must be appropriate - // for use with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm - // header. - // - // SSECustomerKey is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetObjectInput's - // String and GoString methods. - SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` - - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure that the - // encryption key was transmitted without error. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // VersionId used to reference a specific version of the object. - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetObjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetObjectInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetObjectInput) SetBucket(v string) *GetObjectInput { - s.Bucket = &v - return s -} - -func (s *GetObjectInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumMode sets the ChecksumMode field's value. -func (s *GetObjectInput) SetChecksumMode(v string) *GetObjectInput { - s.ChecksumMode = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetObjectInput) SetExpectedBucketOwner(v string) *GetObjectInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetIfMatch sets the IfMatch field's value. -func (s *GetObjectInput) SetIfMatch(v string) *GetObjectInput { - s.IfMatch = &v - return s -} - -// SetIfModifiedSince sets the IfModifiedSince field's value. -func (s *GetObjectInput) SetIfModifiedSince(v time.Time) *GetObjectInput { - s.IfModifiedSince = &v - return s -} - -// SetIfNoneMatch sets the IfNoneMatch field's value. -func (s *GetObjectInput) SetIfNoneMatch(v string) *GetObjectInput { - s.IfNoneMatch = &v - return s -} - -// SetIfUnmodifiedSince sets the IfUnmodifiedSince field's value. -func (s *GetObjectInput) SetIfUnmodifiedSince(v time.Time) *GetObjectInput { - s.IfUnmodifiedSince = &v - return s -} - -// SetKey sets the Key field's value. -func (s *GetObjectInput) SetKey(v string) *GetObjectInput { - s.Key = &v - return s -} - -// SetPartNumber sets the PartNumber field's value. -func (s *GetObjectInput) SetPartNumber(v int64) *GetObjectInput { - s.PartNumber = &v - return s -} - -// SetRange sets the Range field's value. -func (s *GetObjectInput) SetRange(v string) *GetObjectInput { - s.Range = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *GetObjectInput) SetRequestPayer(v string) *GetObjectInput { - s.RequestPayer = &v - return s -} - -// SetResponseCacheControl sets the ResponseCacheControl field's value. -func (s *GetObjectInput) SetResponseCacheControl(v string) *GetObjectInput { - s.ResponseCacheControl = &v - return s -} - -// SetResponseContentDisposition sets the ResponseContentDisposition field's value. -func (s *GetObjectInput) SetResponseContentDisposition(v string) *GetObjectInput { - s.ResponseContentDisposition = &v - return s -} - -// SetResponseContentEncoding sets the ResponseContentEncoding field's value. -func (s *GetObjectInput) SetResponseContentEncoding(v string) *GetObjectInput { - s.ResponseContentEncoding = &v - return s -} - -// SetResponseContentLanguage sets the ResponseContentLanguage field's value. -func (s *GetObjectInput) SetResponseContentLanguage(v string) *GetObjectInput { - s.ResponseContentLanguage = &v - return s -} - -// SetResponseContentType sets the ResponseContentType field's value. -func (s *GetObjectInput) SetResponseContentType(v string) *GetObjectInput { - s.ResponseContentType = &v - return s -} - -// SetResponseExpires sets the ResponseExpires field's value. -func (s *GetObjectInput) SetResponseExpires(v time.Time) *GetObjectInput { - s.ResponseExpires = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *GetObjectInput) SetSSECustomerAlgorithm(v string) *GetObjectInput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKey sets the SSECustomerKey field's value. -func (s *GetObjectInput) SetSSECustomerKey(v string) *GetObjectInput { - s.SSECustomerKey = &v - return s -} - -func (s *GetObjectInput) getSSECustomerKey() (v string) { - if s.SSECustomerKey == nil { - return v - } - return *s.SSECustomerKey -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *GetObjectInput) SetSSECustomerKeyMD5(v string) *GetObjectInput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *GetObjectInput) SetVersionId(v string) *GetObjectInput { - s.VersionId = &v - return s -} - -func (s *GetObjectInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetObjectInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetObjectInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetObjectLegalHoldInput struct { - _ struct{} `locationName:"GetObjectLegalHoldRequest" type:"structure"` - - // The bucket name containing the object whose legal hold status you want to - // retrieve. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The key name for the object whose legal hold status you want to retrieve. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // The version ID of the object whose legal hold status you want to retrieve. - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectLegalHoldInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectLegalHoldInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetObjectLegalHoldInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetObjectLegalHoldInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetObjectLegalHoldInput) SetBucket(v string) *GetObjectLegalHoldInput { - s.Bucket = &v - return s -} - -func (s *GetObjectLegalHoldInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetObjectLegalHoldInput) SetExpectedBucketOwner(v string) *GetObjectLegalHoldInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetKey sets the Key field's value. -func (s *GetObjectLegalHoldInput) SetKey(v string) *GetObjectLegalHoldInput { - s.Key = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *GetObjectLegalHoldInput) SetRequestPayer(v string) *GetObjectLegalHoldInput { - s.RequestPayer = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *GetObjectLegalHoldInput) SetVersionId(v string) *GetObjectLegalHoldInput { - s.VersionId = &v - return s -} - -func (s *GetObjectLegalHoldInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetObjectLegalHoldInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetObjectLegalHoldInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetObjectLegalHoldOutput struct { - _ struct{} `type:"structure" payload:"LegalHold"` - - // The current legal hold status for the specified object. - LegalHold *ObjectLockLegalHold `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectLegalHoldOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectLegalHoldOutput) GoString() string { - return s.String() -} - -// SetLegalHold sets the LegalHold field's value. -func (s *GetObjectLegalHoldOutput) SetLegalHold(v *ObjectLockLegalHold) *GetObjectLegalHoldOutput { - s.LegalHold = v - return s -} - -type GetObjectLockConfigurationInput struct { - _ struct{} `locationName:"GetObjectLockConfigurationRequest" type:"structure"` - - // The bucket whose Object Lock configuration you want to retrieve. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectLockConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectLockConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetObjectLockConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetObjectLockConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetObjectLockConfigurationInput) SetBucket(v string) *GetObjectLockConfigurationInput { - s.Bucket = &v - return s -} - -func (s *GetObjectLockConfigurationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetObjectLockConfigurationInput) SetExpectedBucketOwner(v string) *GetObjectLockConfigurationInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *GetObjectLockConfigurationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetObjectLockConfigurationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetObjectLockConfigurationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetObjectLockConfigurationOutput struct { - _ struct{} `type:"structure" payload:"ObjectLockConfiguration"` - - // The specified bucket's Object Lock configuration. - ObjectLockConfiguration *ObjectLockConfiguration `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectLockConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectLockConfigurationOutput) GoString() string { - return s.String() -} - -// SetObjectLockConfiguration sets the ObjectLockConfiguration field's value. -func (s *GetObjectLockConfigurationOutput) SetObjectLockConfiguration(v *ObjectLockConfiguration) *GetObjectLockConfigurationOutput { - s.ObjectLockConfiguration = v - return s -} - -type GetObjectOutput struct { - _ struct{} `type:"structure" payload:"Body"` - - // Indicates that a range of bytes was specified. - AcceptRanges *string `location:"header" locationName:"accept-ranges" type:"string"` - - // Object data. - Body io.ReadCloser `type:"blob"` - - // Indicates whether the object uses an S3 Bucket Key for server-side encryption - // with Amazon Web Services KMS (SSE-KMS). - BucketKeyEnabled *bool `location:"header" locationName:"x-amz-server-side-encryption-bucket-key-enabled" type:"boolean"` - - // Specifies caching behavior along the request/reply chain. - CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` - - // The base64-encoded, 32-bit CRC32 checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumCRC32 *string `location:"header" locationName:"x-amz-checksum-crc32" type:"string"` - - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumCRC32C *string `location:"header" locationName:"x-amz-checksum-crc32c" type:"string"` - - // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA1 *string `location:"header" locationName:"x-amz-checksum-sha1" type:"string"` - - // The base64-encoded, 256-bit SHA-256 digest of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA256 *string `location:"header" locationName:"x-amz-checksum-sha256" type:"string"` - - // Specifies presentational information for the object. - ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` - - // Specifies what content encodings have been applied to the object and thus - // what decoding mechanisms must be applied to obtain the media-type referenced - // by the Content-Type header field. - ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` - - // The language the content is in. - ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` - - // Size of the body in bytes. - ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` - - // The portion of the object returned in the response. - ContentRange *string `location:"header" locationName:"Content-Range" type:"string"` - - // A standard MIME type describing the format of the object data. - ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - - // Specifies whether the object retrieved was (true) or was not (false) a Delete - // Marker. If false, this response header does not appear in the response. - DeleteMarker *bool `location:"header" locationName:"x-amz-delete-marker" type:"boolean"` - - // An entity tag (ETag) is an opaque identifier assigned by a web server to - // a specific version of a resource found at a URL. - ETag *string `location:"header" locationName:"ETag" type:"string"` - - // If the object expiration is configured (see PUT Bucket lifecycle), the response - // includes this header. It includes the expiry-date and rule-id key-value pairs - // providing object expiration information. The value of the rule-id is URL-encoded. - Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` - - // The date and time at which the object is no longer cacheable. - Expires *string `location:"header" locationName:"Expires" type:"string"` - - // Creation date of the object. - LastModified *time.Time `location:"header" locationName:"Last-Modified" type:"timestamp"` - - // A map of metadata to store with the object in S3. - // - // By default unmarshaled keys are written as a map keys in following canonicalized format: - // the first letter and any letter following a hyphen will be capitalized, and the rest as lowercase. - // Set `aws.Config.LowerCaseHeaderMaps` to `true` to write unmarshaled keys to the map as lowercase. - Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` - - // This is set to the number of metadata entries not returned in x-amz-meta - // headers. This can happen if you create metadata using an API like SOAP that - // supports more flexible metadata than the REST API. For example, using SOAP, - // you can create metadata whose values are not legal HTTP headers. - MissingMeta *int64 `location:"header" locationName:"x-amz-missing-meta" type:"integer"` - - // Indicates whether this object has an active legal hold. This field is only - // returned if you have permission to view an object's legal hold status. - ObjectLockLegalHoldStatus *string `location:"header" locationName:"x-amz-object-lock-legal-hold" type:"string" enum:"ObjectLockLegalHoldStatus"` - - // The Object Lock mode currently in place for this object. - ObjectLockMode *string `location:"header" locationName:"x-amz-object-lock-mode" type:"string" enum:"ObjectLockMode"` - - // The date and time when this object's Object Lock will expire. - ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` - - // The count of parts this object has. This value is only returned if you specify - // partNumber in your request and the object was uploaded as a multipart upload. - PartsCount *int64 `location:"header" locationName:"x-amz-mp-parts-count" type:"integer"` - - // Amazon S3 can return this if your request involves a bucket that is either - // a source or destination in a replication rule. - ReplicationStatus *string `location:"header" locationName:"x-amz-replication-status" type:"string" enum:"ReplicationStatus"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // Provides information about object restoration action and expiration time - // of the restored object copy. - Restore *string `location:"header" locationName:"x-amz-restore" type:"string"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header confirming the encryption algorithm - // used. - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round-trip message integrity - // verification of the customer-provided encryption key. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // If present, specifies the ID of the Amazon Web Services Key Management Service - // (Amazon Web Services KMS) symmetric customer managed key that was used for - // the object. - // - // SSEKMSKeyId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by GetObjectOutput's - // String and GoString methods. - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - - // The server-side encryption algorithm used when storing this object in Amazon - // S3 (for example, AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - - // Provides storage class information of the object. Amazon S3 returns this - // header for all objects except for S3 Standard storage class objects. - StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` - - // The number of tags, if any, on the object. - TagCount *int64 `location:"header" locationName:"x-amz-tagging-count" type:"integer"` - - // Version of the object. - VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` - - // If the bucket is configured as a website, redirects requests for this object - // to another object in the same bucket or to an external URL. Amazon S3 stores - // the value of this header in the object metadata. - WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectOutput) GoString() string { - return s.String() -} - -// SetAcceptRanges sets the AcceptRanges field's value. -func (s *GetObjectOutput) SetAcceptRanges(v string) *GetObjectOutput { - s.AcceptRanges = &v - return s -} - -// SetBody sets the Body field's value. -func (s *GetObjectOutput) SetBody(v io.ReadCloser) *GetObjectOutput { - s.Body = v - return s -} - -// SetBucketKeyEnabled sets the BucketKeyEnabled field's value. -func (s *GetObjectOutput) SetBucketKeyEnabled(v bool) *GetObjectOutput { - s.BucketKeyEnabled = &v - return s -} - -// SetCacheControl sets the CacheControl field's value. -func (s *GetObjectOutput) SetCacheControl(v string) *GetObjectOutput { - s.CacheControl = &v - return s -} - -// SetChecksumCRC32 sets the ChecksumCRC32 field's value. -func (s *GetObjectOutput) SetChecksumCRC32(v string) *GetObjectOutput { - s.ChecksumCRC32 = &v - return s -} - -// SetChecksumCRC32C sets the ChecksumCRC32C field's value. -func (s *GetObjectOutput) SetChecksumCRC32C(v string) *GetObjectOutput { - s.ChecksumCRC32C = &v - return s -} - -// SetChecksumSHA1 sets the ChecksumSHA1 field's value. -func (s *GetObjectOutput) SetChecksumSHA1(v string) *GetObjectOutput { - s.ChecksumSHA1 = &v - return s -} - -// SetChecksumSHA256 sets the ChecksumSHA256 field's value. -func (s *GetObjectOutput) SetChecksumSHA256(v string) *GetObjectOutput { - s.ChecksumSHA256 = &v - return s -} - -// SetContentDisposition sets the ContentDisposition field's value. -func (s *GetObjectOutput) SetContentDisposition(v string) *GetObjectOutput { - s.ContentDisposition = &v - return s -} - -// SetContentEncoding sets the ContentEncoding field's value. -func (s *GetObjectOutput) SetContentEncoding(v string) *GetObjectOutput { - s.ContentEncoding = &v - return s -} - -// SetContentLanguage sets the ContentLanguage field's value. -func (s *GetObjectOutput) SetContentLanguage(v string) *GetObjectOutput { - s.ContentLanguage = &v - return s -} - -// SetContentLength sets the ContentLength field's value. -func (s *GetObjectOutput) SetContentLength(v int64) *GetObjectOutput { - s.ContentLength = &v - return s -} - -// SetContentRange sets the ContentRange field's value. -func (s *GetObjectOutput) SetContentRange(v string) *GetObjectOutput { - s.ContentRange = &v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *GetObjectOutput) SetContentType(v string) *GetObjectOutput { - s.ContentType = &v - return s -} - -// SetDeleteMarker sets the DeleteMarker field's value. -func (s *GetObjectOutput) SetDeleteMarker(v bool) *GetObjectOutput { - s.DeleteMarker = &v - return s -} - -// SetETag sets the ETag field's value. -func (s *GetObjectOutput) SetETag(v string) *GetObjectOutput { - s.ETag = &v - return s -} - -// SetExpiration sets the Expiration field's value. -func (s *GetObjectOutput) SetExpiration(v string) *GetObjectOutput { - s.Expiration = &v - return s -} - -// SetExpires sets the Expires field's value. -func (s *GetObjectOutput) SetExpires(v string) *GetObjectOutput { - s.Expires = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *GetObjectOutput) SetLastModified(v time.Time) *GetObjectOutput { - s.LastModified = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *GetObjectOutput) SetMetadata(v map[string]*string) *GetObjectOutput { - s.Metadata = v - return s -} - -// SetMissingMeta sets the MissingMeta field's value. -func (s *GetObjectOutput) SetMissingMeta(v int64) *GetObjectOutput { - s.MissingMeta = &v - return s -} - -// SetObjectLockLegalHoldStatus sets the ObjectLockLegalHoldStatus field's value. -func (s *GetObjectOutput) SetObjectLockLegalHoldStatus(v string) *GetObjectOutput { - s.ObjectLockLegalHoldStatus = &v - return s -} - -// SetObjectLockMode sets the ObjectLockMode field's value. -func (s *GetObjectOutput) SetObjectLockMode(v string) *GetObjectOutput { - s.ObjectLockMode = &v - return s -} - -// SetObjectLockRetainUntilDate sets the ObjectLockRetainUntilDate field's value. -func (s *GetObjectOutput) SetObjectLockRetainUntilDate(v time.Time) *GetObjectOutput { - s.ObjectLockRetainUntilDate = &v - return s -} - -// SetPartsCount sets the PartsCount field's value. -func (s *GetObjectOutput) SetPartsCount(v int64) *GetObjectOutput { - s.PartsCount = &v - return s -} - -// SetReplicationStatus sets the ReplicationStatus field's value. -func (s *GetObjectOutput) SetReplicationStatus(v string) *GetObjectOutput { - s.ReplicationStatus = &v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *GetObjectOutput) SetRequestCharged(v string) *GetObjectOutput { - s.RequestCharged = &v - return s -} - -// SetRestore sets the Restore field's value. -func (s *GetObjectOutput) SetRestore(v string) *GetObjectOutput { - s.Restore = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *GetObjectOutput) SetSSECustomerAlgorithm(v string) *GetObjectOutput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *GetObjectOutput) SetSSECustomerKeyMD5(v string) *GetObjectOutput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *GetObjectOutput) SetSSEKMSKeyId(v string) *GetObjectOutput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *GetObjectOutput) SetServerSideEncryption(v string) *GetObjectOutput { - s.ServerSideEncryption = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *GetObjectOutput) SetStorageClass(v string) *GetObjectOutput { - s.StorageClass = &v - return s -} - -// SetTagCount sets the TagCount field's value. -func (s *GetObjectOutput) SetTagCount(v int64) *GetObjectOutput { - s.TagCount = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *GetObjectOutput) SetVersionId(v string) *GetObjectOutput { - s.VersionId = &v - return s -} - -// SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. -func (s *GetObjectOutput) SetWebsiteRedirectLocation(v string) *GetObjectOutput { - s.WebsiteRedirectLocation = &v - return s -} - -type GetObjectRetentionInput struct { - _ struct{} `locationName:"GetObjectRetentionRequest" type:"structure"` - - // The bucket name containing the object whose retention settings you want to - // retrieve. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The key name for the object whose retention settings you want to retrieve. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // The version ID for the object whose retention settings you want to retrieve. - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectRetentionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectRetentionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetObjectRetentionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetObjectRetentionInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetObjectRetentionInput) SetBucket(v string) *GetObjectRetentionInput { - s.Bucket = &v - return s -} - -func (s *GetObjectRetentionInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetObjectRetentionInput) SetExpectedBucketOwner(v string) *GetObjectRetentionInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetKey sets the Key field's value. -func (s *GetObjectRetentionInput) SetKey(v string) *GetObjectRetentionInput { - s.Key = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *GetObjectRetentionInput) SetRequestPayer(v string) *GetObjectRetentionInput { - s.RequestPayer = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *GetObjectRetentionInput) SetVersionId(v string) *GetObjectRetentionInput { - s.VersionId = &v - return s -} - -func (s *GetObjectRetentionInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetObjectRetentionInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetObjectRetentionInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetObjectRetentionOutput struct { - _ struct{} `type:"structure" payload:"Retention"` - - // The container element for an object's retention settings. - Retention *ObjectLockRetention `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectRetentionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectRetentionOutput) GoString() string { - return s.String() -} - -// SetRetention sets the Retention field's value. -func (s *GetObjectRetentionOutput) SetRetention(v *ObjectLockRetention) *GetObjectRetentionOutput { - s.Retention = v - return s -} - -type GetObjectTaggingInput struct { - _ struct{} `locationName:"GetObjectTaggingRequest" type:"structure"` - - // The bucket name containing the object for which to get the tagging information. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Object key for which to get the tagging information. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // The versionId of the object for which to get the tagging information. - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectTaggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectTaggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetObjectTaggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetObjectTaggingInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetObjectTaggingInput) SetBucket(v string) *GetObjectTaggingInput { - s.Bucket = &v - return s -} - -func (s *GetObjectTaggingInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetObjectTaggingInput) SetExpectedBucketOwner(v string) *GetObjectTaggingInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetKey sets the Key field's value. -func (s *GetObjectTaggingInput) SetKey(v string) *GetObjectTaggingInput { - s.Key = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *GetObjectTaggingInput) SetRequestPayer(v string) *GetObjectTaggingInput { - s.RequestPayer = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *GetObjectTaggingInput) SetVersionId(v string) *GetObjectTaggingInput { - s.VersionId = &v - return s -} - -func (s *GetObjectTaggingInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetObjectTaggingInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetObjectTaggingInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetObjectTaggingOutput struct { - _ struct{} `type:"structure"` - - // Contains the tag set. - // - // TagSet is a required field - TagSet []*Tag `locationNameList:"Tag" type:"list" required:"true"` - - // The versionId of the object for which you got the tagging information. - VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectTaggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectTaggingOutput) GoString() string { - return s.String() -} - -// SetTagSet sets the TagSet field's value. -func (s *GetObjectTaggingOutput) SetTagSet(v []*Tag) *GetObjectTaggingOutput { - s.TagSet = v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *GetObjectTaggingOutput) SetVersionId(v string) *GetObjectTaggingOutput { - s.VersionId = &v - return s -} - -type GetObjectTorrentInput struct { - _ struct{} `locationName:"GetObjectTorrentRequest" type:"structure"` - - // The name of the bucket containing the object for which to get the torrent - // files. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The object key for which to get the information. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectTorrentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectTorrentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetObjectTorrentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetObjectTorrentInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetObjectTorrentInput) SetBucket(v string) *GetObjectTorrentInput { - s.Bucket = &v - return s -} - -func (s *GetObjectTorrentInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetObjectTorrentInput) SetExpectedBucketOwner(v string) *GetObjectTorrentInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetKey sets the Key field's value. -func (s *GetObjectTorrentInput) SetKey(v string) *GetObjectTorrentInput { - s.Key = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *GetObjectTorrentInput) SetRequestPayer(v string) *GetObjectTorrentInput { - s.RequestPayer = &v - return s -} - -func (s *GetObjectTorrentInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetObjectTorrentInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetObjectTorrentInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetObjectTorrentOutput struct { - _ struct{} `type:"structure" payload:"Body"` - - // A Bencoded dictionary as defined by the BitTorrent specification - Body io.ReadCloser `type:"blob"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectTorrentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetObjectTorrentOutput) GoString() string { - return s.String() -} - -// SetBody sets the Body field's value. -func (s *GetObjectTorrentOutput) SetBody(v io.ReadCloser) *GetObjectTorrentOutput { - s.Body = v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *GetObjectTorrentOutput) SetRequestCharged(v string) *GetObjectTorrentOutput { - s.RequestCharged = &v - return s -} - -type GetPublicAccessBlockInput struct { - _ struct{} `locationName:"GetPublicAccessBlockRequest" type:"structure"` - - // The name of the Amazon S3 bucket whose PublicAccessBlock configuration you - // want to retrieve. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetPublicAccessBlockInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetPublicAccessBlockInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GetPublicAccessBlockInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GetPublicAccessBlockInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *GetPublicAccessBlockInput) SetBucket(v string) *GetPublicAccessBlockInput { - s.Bucket = &v - return s -} - -func (s *GetPublicAccessBlockInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *GetPublicAccessBlockInput) SetExpectedBucketOwner(v string) *GetPublicAccessBlockInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *GetPublicAccessBlockInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *GetPublicAccessBlockInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s GetPublicAccessBlockInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type GetPublicAccessBlockOutput struct { - _ struct{} `type:"structure" payload:"PublicAccessBlockConfiguration"` - - // The PublicAccessBlock configuration currently in effect for this Amazon S3 - // bucket. - PublicAccessBlockConfiguration *PublicAccessBlockConfiguration `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetPublicAccessBlockOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GetPublicAccessBlockOutput) GoString() string { - return s.String() -} - -// SetPublicAccessBlockConfiguration sets the PublicAccessBlockConfiguration field's value. -func (s *GetPublicAccessBlockOutput) SetPublicAccessBlockConfiguration(v *PublicAccessBlockConfiguration) *GetPublicAccessBlockOutput { - s.PublicAccessBlockConfiguration = v - return s -} - -// Container for S3 Glacier job parameters. -type GlacierJobParameters struct { - _ struct{} `type:"structure"` - - // Retrieval tier at which the restore will be processed. - // - // Tier is a required field - Tier *string `type:"string" required:"true" enum:"Tier"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GlacierJobParameters) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s GlacierJobParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *GlacierJobParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "GlacierJobParameters"} - if s.Tier == nil { - invalidParams.Add(request.NewErrParamRequired("Tier")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTier sets the Tier field's value. -func (s *GlacierJobParameters) SetTier(v string) *GlacierJobParameters { - s.Tier = &v - return s -} - -// Container for grant information. -type Grant struct { - _ struct{} `type:"structure"` - - // The person being granted permissions. - Grantee *Grantee `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"` - - // Specifies the permission given to the grantee. - Permission *string `type:"string" enum:"Permission"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Grant) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Grant) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Grant) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Grant"} - if s.Grantee != nil { - if err := s.Grantee.Validate(); err != nil { - invalidParams.AddNested("Grantee", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGrantee sets the Grantee field's value. -func (s *Grant) SetGrantee(v *Grantee) *Grant { - s.Grantee = v - return s -} - -// SetPermission sets the Permission field's value. -func (s *Grant) SetPermission(v string) *Grant { - s.Permission = &v - return s -} - -// Container for the person being granted permissions. -type Grantee struct { - _ struct{} `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"` - - // Screen name of the grantee. - DisplayName *string `type:"string"` - - // Email address of the grantee. - // - // Using email addresses to specify a grantee is only supported in the following - // Amazon Web Services Regions: - // - // * US East (N. Virginia) - // - // * US West (N. California) - // - // * US West (Oregon) - // - // * Asia Pacific (Singapore) - // - // * Asia Pacific (Sydney) - // - // * Asia Pacific (Tokyo) - // - // * Europe (Ireland) - // - // * South America (São Paulo) - // - // For a list of all the Amazon S3 supported Regions and endpoints, see Regions - // and Endpoints (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) - // in the Amazon Web Services General Reference. - EmailAddress *string `type:"string"` - - // The canonical user ID of the grantee. - ID *string `type:"string"` - - // Type of grantee - // - // Type is a required field - Type *string `locationName:"xsi:type" type:"string" xmlAttribute:"true" required:"true" enum:"Type"` - - // URI of the grantee group. - URI *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Grantee) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Grantee) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Grantee) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Grantee"} - if s.Type == nil { - invalidParams.Add(request.NewErrParamRequired("Type")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDisplayName sets the DisplayName field's value. -func (s *Grantee) SetDisplayName(v string) *Grantee { - s.DisplayName = &v - return s -} - -// SetEmailAddress sets the EmailAddress field's value. -func (s *Grantee) SetEmailAddress(v string) *Grantee { - s.EmailAddress = &v - return s -} - -// SetID sets the ID field's value. -func (s *Grantee) SetID(v string) *Grantee { - s.ID = &v - return s -} - -// SetType sets the Type field's value. -func (s *Grantee) SetType(v string) *Grantee { - s.Type = &v - return s -} - -// SetURI sets the URI field's value. -func (s *Grantee) SetURI(v string) *Grantee { - s.URI = &v - return s -} - -type HeadBucketInput struct { - _ struct{} `locationName:"HeadBucketRequest" type:"structure"` - - // The bucket name. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s HeadBucketInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s HeadBucketInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *HeadBucketInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HeadBucketInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *HeadBucketInput) SetBucket(v string) *HeadBucketInput { - s.Bucket = &v - return s -} - -func (s *HeadBucketInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *HeadBucketInput) SetExpectedBucketOwner(v string) *HeadBucketInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *HeadBucketInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *HeadBucketInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s HeadBucketInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type HeadBucketOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s HeadBucketOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s HeadBucketOutput) GoString() string { - return s.String() -} - -type HeadObjectInput struct { - _ struct{} `locationName:"HeadObjectRequest" type:"structure"` - - // The name of the bucket containing the object. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // To retrieve the checksum, this parameter must be enabled. - // - // In addition, if you enable ChecksumMode and the object is encrypted with - // Amazon Web Services Key Management Service (Amazon Web Services KMS), you - // must have permission to use the kms:Decrypt action for the request to succeed. - ChecksumMode *string `location:"header" locationName:"x-amz-checksum-mode" type:"string" enum:"ChecksumMode"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Return the object only if its entity tag (ETag) is the same as the one specified; - // otherwise, return a 412 (precondition failed) error. - IfMatch *string `location:"header" locationName:"If-Match" type:"string"` - - // Return the object only if it has been modified since the specified time; - // otherwise, return a 304 (not modified) error. - IfModifiedSince *time.Time `location:"header" locationName:"If-Modified-Since" type:"timestamp"` - - // Return the object only if its entity tag (ETag) is different from the one - // specified; otherwise, return a 304 (not modified) error. - IfNoneMatch *string `location:"header" locationName:"If-None-Match" type:"string"` - - // Return the object only if it has not been modified since the specified time; - // otherwise, return a 412 (precondition failed) error. - IfUnmodifiedSince *time.Time `location:"header" locationName:"If-Unmodified-Since" type:"timestamp"` - - // The object key. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Part number of the object being read. This is a positive integer between - // 1 and 10,000. Effectively performs a 'ranged' HEAD request for the part specified. - // Useful querying about the size of the part and the number of parts in this - // object. - PartNumber *int64 `location:"querystring" locationName:"partNumber" type:"integer"` - - // Because HeadObject returns only the metadata for an object, this parameter - // has no effect. - Range *string `location:"header" locationName:"Range" type:"string"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // Specifies the algorithm to use to when encrypting the object (for example, - // AES256). - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting - // data. This value is used to store the object and then it is discarded; Amazon - // S3 does not store the encryption key. The key must be appropriate for use - // with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm - // header. - // - // SSECustomerKey is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by HeadObjectInput's - // String and GoString methods. - SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` - - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure that the - // encryption key was transmitted without error. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // VersionId used to reference a specific version of the object. - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s HeadObjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s HeadObjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *HeadObjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "HeadObjectInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *HeadObjectInput) SetBucket(v string) *HeadObjectInput { - s.Bucket = &v - return s -} - -func (s *HeadObjectInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumMode sets the ChecksumMode field's value. -func (s *HeadObjectInput) SetChecksumMode(v string) *HeadObjectInput { - s.ChecksumMode = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *HeadObjectInput) SetExpectedBucketOwner(v string) *HeadObjectInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetIfMatch sets the IfMatch field's value. -func (s *HeadObjectInput) SetIfMatch(v string) *HeadObjectInput { - s.IfMatch = &v - return s -} - -// SetIfModifiedSince sets the IfModifiedSince field's value. -func (s *HeadObjectInput) SetIfModifiedSince(v time.Time) *HeadObjectInput { - s.IfModifiedSince = &v - return s -} - -// SetIfNoneMatch sets the IfNoneMatch field's value. -func (s *HeadObjectInput) SetIfNoneMatch(v string) *HeadObjectInput { - s.IfNoneMatch = &v - return s -} - -// SetIfUnmodifiedSince sets the IfUnmodifiedSince field's value. -func (s *HeadObjectInput) SetIfUnmodifiedSince(v time.Time) *HeadObjectInput { - s.IfUnmodifiedSince = &v - return s -} - -// SetKey sets the Key field's value. -func (s *HeadObjectInput) SetKey(v string) *HeadObjectInput { - s.Key = &v - return s -} - -// SetPartNumber sets the PartNumber field's value. -func (s *HeadObjectInput) SetPartNumber(v int64) *HeadObjectInput { - s.PartNumber = &v - return s -} - -// SetRange sets the Range field's value. -func (s *HeadObjectInput) SetRange(v string) *HeadObjectInput { - s.Range = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *HeadObjectInput) SetRequestPayer(v string) *HeadObjectInput { - s.RequestPayer = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *HeadObjectInput) SetSSECustomerAlgorithm(v string) *HeadObjectInput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKey sets the SSECustomerKey field's value. -func (s *HeadObjectInput) SetSSECustomerKey(v string) *HeadObjectInput { - s.SSECustomerKey = &v - return s -} - -func (s *HeadObjectInput) getSSECustomerKey() (v string) { - if s.SSECustomerKey == nil { - return v - } - return *s.SSECustomerKey -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *HeadObjectInput) SetSSECustomerKeyMD5(v string) *HeadObjectInput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *HeadObjectInput) SetVersionId(v string) *HeadObjectInput { - s.VersionId = &v - return s -} - -func (s *HeadObjectInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *HeadObjectInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s HeadObjectInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type HeadObjectOutput struct { - _ struct{} `type:"structure"` - - // Indicates that a range of bytes was specified. - AcceptRanges *string `location:"header" locationName:"accept-ranges" type:"string"` - - // The archive state of the head object. - ArchiveStatus *string `location:"header" locationName:"x-amz-archive-status" type:"string" enum:"ArchiveStatus"` - - // Indicates whether the object uses an S3 Bucket Key for server-side encryption - // with Amazon Web Services KMS (SSE-KMS). - BucketKeyEnabled *bool `location:"header" locationName:"x-amz-server-side-encryption-bucket-key-enabled" type:"boolean"` - - // Specifies caching behavior along the request/reply chain. - CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` - - // The base64-encoded, 32-bit CRC32 checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumCRC32 *string `location:"header" locationName:"x-amz-checksum-crc32" type:"string"` - - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumCRC32C *string `location:"header" locationName:"x-amz-checksum-crc32c" type:"string"` - - // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA1 *string `location:"header" locationName:"x-amz-checksum-sha1" type:"string"` - - // The base64-encoded, 256-bit SHA-256 digest of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA256 *string `location:"header" locationName:"x-amz-checksum-sha256" type:"string"` - - // Specifies presentational information for the object. - ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` - - // Specifies what content encodings have been applied to the object and thus - // what decoding mechanisms must be applied to obtain the media-type referenced - // by the Content-Type header field. - ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` - - // The language the content is in. - ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` - - // Size of the body in bytes. - ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` - - // A standard MIME type describing the format of the object data. - ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - - // Specifies whether the object retrieved was (true) or was not (false) a Delete - // Marker. If false, this response header does not appear in the response. - DeleteMarker *bool `location:"header" locationName:"x-amz-delete-marker" type:"boolean"` - - // An entity tag (ETag) is an opaque identifier assigned by a web server to - // a specific version of a resource found at a URL. - ETag *string `location:"header" locationName:"ETag" type:"string"` - - // If the object expiration is configured (see PUT Bucket lifecycle), the response - // includes this header. It includes the expiry-date and rule-id key-value pairs - // providing object expiration information. The value of the rule-id is URL-encoded. - Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` - - // The date and time at which the object is no longer cacheable. - Expires *string `location:"header" locationName:"Expires" type:"string"` - - // Creation date of the object. - LastModified *time.Time `location:"header" locationName:"Last-Modified" type:"timestamp"` - - // A map of metadata to store with the object in S3. - // - // By default unmarshaled keys are written as a map keys in following canonicalized format: - // the first letter and any letter following a hyphen will be capitalized, and the rest as lowercase. - // Set `aws.Config.LowerCaseHeaderMaps` to `true` to write unmarshaled keys to the map as lowercase. - Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` - - // This is set to the number of metadata entries not returned in x-amz-meta - // headers. This can happen if you create metadata using an API like SOAP that - // supports more flexible metadata than the REST API. For example, using SOAP, - // you can create metadata whose values are not legal HTTP headers. - MissingMeta *int64 `location:"header" locationName:"x-amz-missing-meta" type:"integer"` - - // Specifies whether a legal hold is in effect for this object. This header - // is only returned if the requester has the s3:GetObjectLegalHold permission. - // This header is not returned if the specified version of this object has never - // had a legal hold applied. For more information about S3 Object Lock, see - // Object Lock (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). - ObjectLockLegalHoldStatus *string `location:"header" locationName:"x-amz-object-lock-legal-hold" type:"string" enum:"ObjectLockLegalHoldStatus"` - - // The Object Lock mode, if any, that's in effect for this object. This header - // is only returned if the requester has the s3:GetObjectRetention permission. - // For more information about S3 Object Lock, see Object Lock (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). - ObjectLockMode *string `location:"header" locationName:"x-amz-object-lock-mode" type:"string" enum:"ObjectLockMode"` - - // The date and time when the Object Lock retention period expires. This header - // is only returned if the requester has the s3:GetObjectRetention permission. - ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` - - // The count of parts this object has. This value is only returned if you specify - // partNumber in your request and the object was uploaded as a multipart upload. - PartsCount *int64 `location:"header" locationName:"x-amz-mp-parts-count" type:"integer"` - - // Amazon S3 can return this header if your request involves a bucket that is - // either a source or a destination in a replication rule. - // - // In replication, you have a source bucket on which you configure replication - // and destination bucket or buckets where Amazon S3 stores object replicas. - // When you request an object (GetObject) or object metadata (HeadObject) from - // these buckets, Amazon S3 will return the x-amz-replication-status header - // in the response as follows: - // - // * If requesting an object from the source bucket, Amazon S3 will return - // the x-amz-replication-status header if the object in your request is eligible - // for replication. For example, suppose that in your replication configuration, - // you specify object prefix TaxDocs requesting Amazon S3 to replicate objects - // with key prefix TaxDocs. Any objects you upload with this key name prefix, - // for example TaxDocs/document1.pdf, are eligible for replication. For any - // object request with this key name prefix, Amazon S3 will return the x-amz-replication-status - // header with value PENDING, COMPLETED or FAILED indicating object replication - // status. - // - // * If requesting an object from a destination bucket, Amazon S3 will return - // the x-amz-replication-status header with value REPLICA if the object in - // your request is a replica that Amazon S3 created and there is no replica - // modification replication in progress. - // - // * When replicating objects to multiple destination buckets, the x-amz-replication-status - // header acts differently. The header of the source object will only return - // a value of COMPLETED when replication is successful to all destinations. - // The header will remain at value PENDING until replication has completed - // for all destinations. If one or more destinations fails replication the - // header will return FAILED. - // - // For more information, see Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html). - ReplicationStatus *string `location:"header" locationName:"x-amz-replication-status" type:"string" enum:"ReplicationStatus"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // If the object is an archived object (an object whose storage class is GLACIER), - // the response includes this header if either the archive restoration is in - // progress (see RestoreObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html) - // or an archive copy is already restored. - // - // If an archive copy is already restored, the header value indicates when Amazon - // S3 is scheduled to delete the object copy. For example: - // - // x-amz-restore: ongoing-request="false", expiry-date="Fri, 21 Dec 2012 00:00:00 - // GMT" - // - // If the object restoration is in progress, the header returns the value ongoing-request="true". - // - // For more information about archiving objects, see Transitioning Objects: - // General Considerations (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html#lifecycle-transition-general-considerations). - Restore *string `location:"header" locationName:"x-amz-restore" type:"string"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header confirming the encryption algorithm - // used. - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round-trip message integrity - // verification of the customer-provided encryption key. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // If present, specifies the ID of the Amazon Web Services Key Management Service - // (Amazon Web Services KMS) symmetric customer managed key that was used for - // the object. - // - // SSEKMSKeyId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by HeadObjectOutput's - // String and GoString methods. - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - - // If the object is stored using server-side encryption either with an Amazon - // Web Services KMS key or an Amazon S3-managed encryption key, the response - // includes this header with the value of the server-side encryption algorithm - // used when storing this object in Amazon S3 (for example, AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - - // Provides storage class information of the object. Amazon S3 returns this - // header for all objects except for S3 Standard storage class objects. - // - // For more information, see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html). - StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` - - // Version of the object. - VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` - - // If the bucket is configured as a website, redirects requests for this object - // to another object in the same bucket or to an external URL. Amazon S3 stores - // the value of this header in the object metadata. - WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s HeadObjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s HeadObjectOutput) GoString() string { - return s.String() -} - -// SetAcceptRanges sets the AcceptRanges field's value. -func (s *HeadObjectOutput) SetAcceptRanges(v string) *HeadObjectOutput { - s.AcceptRanges = &v - return s -} - -// SetArchiveStatus sets the ArchiveStatus field's value. -func (s *HeadObjectOutput) SetArchiveStatus(v string) *HeadObjectOutput { - s.ArchiveStatus = &v - return s -} - -// SetBucketKeyEnabled sets the BucketKeyEnabled field's value. -func (s *HeadObjectOutput) SetBucketKeyEnabled(v bool) *HeadObjectOutput { - s.BucketKeyEnabled = &v - return s -} - -// SetCacheControl sets the CacheControl field's value. -func (s *HeadObjectOutput) SetCacheControl(v string) *HeadObjectOutput { - s.CacheControl = &v - return s -} - -// SetChecksumCRC32 sets the ChecksumCRC32 field's value. -func (s *HeadObjectOutput) SetChecksumCRC32(v string) *HeadObjectOutput { - s.ChecksumCRC32 = &v - return s -} - -// SetChecksumCRC32C sets the ChecksumCRC32C field's value. -func (s *HeadObjectOutput) SetChecksumCRC32C(v string) *HeadObjectOutput { - s.ChecksumCRC32C = &v - return s -} - -// SetChecksumSHA1 sets the ChecksumSHA1 field's value. -func (s *HeadObjectOutput) SetChecksumSHA1(v string) *HeadObjectOutput { - s.ChecksumSHA1 = &v - return s -} - -// SetChecksumSHA256 sets the ChecksumSHA256 field's value. -func (s *HeadObjectOutput) SetChecksumSHA256(v string) *HeadObjectOutput { - s.ChecksumSHA256 = &v - return s -} - -// SetContentDisposition sets the ContentDisposition field's value. -func (s *HeadObjectOutput) SetContentDisposition(v string) *HeadObjectOutput { - s.ContentDisposition = &v - return s -} - -// SetContentEncoding sets the ContentEncoding field's value. -func (s *HeadObjectOutput) SetContentEncoding(v string) *HeadObjectOutput { - s.ContentEncoding = &v - return s -} - -// SetContentLanguage sets the ContentLanguage field's value. -func (s *HeadObjectOutput) SetContentLanguage(v string) *HeadObjectOutput { - s.ContentLanguage = &v - return s -} - -// SetContentLength sets the ContentLength field's value. -func (s *HeadObjectOutput) SetContentLength(v int64) *HeadObjectOutput { - s.ContentLength = &v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *HeadObjectOutput) SetContentType(v string) *HeadObjectOutput { - s.ContentType = &v - return s -} - -// SetDeleteMarker sets the DeleteMarker field's value. -func (s *HeadObjectOutput) SetDeleteMarker(v bool) *HeadObjectOutput { - s.DeleteMarker = &v - return s -} - -// SetETag sets the ETag field's value. -func (s *HeadObjectOutput) SetETag(v string) *HeadObjectOutput { - s.ETag = &v - return s -} - -// SetExpiration sets the Expiration field's value. -func (s *HeadObjectOutput) SetExpiration(v string) *HeadObjectOutput { - s.Expiration = &v - return s -} - -// SetExpires sets the Expires field's value. -func (s *HeadObjectOutput) SetExpires(v string) *HeadObjectOutput { - s.Expires = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *HeadObjectOutput) SetLastModified(v time.Time) *HeadObjectOutput { - s.LastModified = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *HeadObjectOutput) SetMetadata(v map[string]*string) *HeadObjectOutput { - s.Metadata = v - return s -} - -// SetMissingMeta sets the MissingMeta field's value. -func (s *HeadObjectOutput) SetMissingMeta(v int64) *HeadObjectOutput { - s.MissingMeta = &v - return s -} - -// SetObjectLockLegalHoldStatus sets the ObjectLockLegalHoldStatus field's value. -func (s *HeadObjectOutput) SetObjectLockLegalHoldStatus(v string) *HeadObjectOutput { - s.ObjectLockLegalHoldStatus = &v - return s -} - -// SetObjectLockMode sets the ObjectLockMode field's value. -func (s *HeadObjectOutput) SetObjectLockMode(v string) *HeadObjectOutput { - s.ObjectLockMode = &v - return s -} - -// SetObjectLockRetainUntilDate sets the ObjectLockRetainUntilDate field's value. -func (s *HeadObjectOutput) SetObjectLockRetainUntilDate(v time.Time) *HeadObjectOutput { - s.ObjectLockRetainUntilDate = &v - return s -} - -// SetPartsCount sets the PartsCount field's value. -func (s *HeadObjectOutput) SetPartsCount(v int64) *HeadObjectOutput { - s.PartsCount = &v - return s -} - -// SetReplicationStatus sets the ReplicationStatus field's value. -func (s *HeadObjectOutput) SetReplicationStatus(v string) *HeadObjectOutput { - s.ReplicationStatus = &v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *HeadObjectOutput) SetRequestCharged(v string) *HeadObjectOutput { - s.RequestCharged = &v - return s -} - -// SetRestore sets the Restore field's value. -func (s *HeadObjectOutput) SetRestore(v string) *HeadObjectOutput { - s.Restore = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *HeadObjectOutput) SetSSECustomerAlgorithm(v string) *HeadObjectOutput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *HeadObjectOutput) SetSSECustomerKeyMD5(v string) *HeadObjectOutput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *HeadObjectOutput) SetSSEKMSKeyId(v string) *HeadObjectOutput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *HeadObjectOutput) SetServerSideEncryption(v string) *HeadObjectOutput { - s.ServerSideEncryption = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *HeadObjectOutput) SetStorageClass(v string) *HeadObjectOutput { - s.StorageClass = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *HeadObjectOutput) SetVersionId(v string) *HeadObjectOutput { - s.VersionId = &v - return s -} - -// SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. -func (s *HeadObjectOutput) SetWebsiteRedirectLocation(v string) *HeadObjectOutput { - s.WebsiteRedirectLocation = &v - return s -} - -// Container for the Suffix element. -type IndexDocument struct { - _ struct{} `type:"structure"` - - // A suffix that is appended to a request that is for a directory on the website - // endpoint (for example,if the suffix is index.html and you make a request - // to samplebucket/images/ the data that is returned will be for the object - // with the key name images/index.html) The suffix must not be empty and must - // not include a slash character. - // - // Replacement must be made for object keys containing special characters (such - // as carriage returns) when using XML requests. For more information, see XML - // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). - // - // Suffix is a required field - Suffix *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s IndexDocument) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s IndexDocument) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *IndexDocument) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IndexDocument"} - if s.Suffix == nil { - invalidParams.Add(request.NewErrParamRequired("Suffix")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSuffix sets the Suffix field's value. -func (s *IndexDocument) SetSuffix(v string) *IndexDocument { - s.Suffix = &v - return s -} - -// Container element that identifies who initiated the multipart upload. -type Initiator struct { - _ struct{} `type:"structure"` - - // Name of the Principal. - DisplayName *string `type:"string"` - - // If the principal is an Amazon Web Services account, it provides the Canonical - // User ID. If the principal is an IAM User, it provides a user ARN value. - ID *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Initiator) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Initiator) GoString() string { - return s.String() -} - -// SetDisplayName sets the DisplayName field's value. -func (s *Initiator) SetDisplayName(v string) *Initiator { - s.DisplayName = &v - return s -} - -// SetID sets the ID field's value. -func (s *Initiator) SetID(v string) *Initiator { - s.ID = &v - return s -} - -// Describes the serialization format of the object. -type InputSerialization struct { - _ struct{} `type:"structure"` - - // Describes the serialization of a CSV-encoded object. - CSV *CSVInput `type:"structure"` - - // Specifies object's compression format. Valid values: NONE, GZIP, BZIP2. Default - // Value: NONE. - CompressionType *string `type:"string" enum:"CompressionType"` - - // Specifies JSON as object's input serialization format. - JSON *JSONInput `type:"structure"` - - // Specifies Parquet as object's input serialization format. - Parquet *ParquetInput `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InputSerialization) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InputSerialization) GoString() string { - return s.String() -} - -// SetCSV sets the CSV field's value. -func (s *InputSerialization) SetCSV(v *CSVInput) *InputSerialization { - s.CSV = v - return s -} - -// SetCompressionType sets the CompressionType field's value. -func (s *InputSerialization) SetCompressionType(v string) *InputSerialization { - s.CompressionType = &v - return s -} - -// SetJSON sets the JSON field's value. -func (s *InputSerialization) SetJSON(v *JSONInput) *InputSerialization { - s.JSON = v - return s -} - -// SetParquet sets the Parquet field's value. -func (s *InputSerialization) SetParquet(v *ParquetInput) *InputSerialization { - s.Parquet = v - return s -} - -// A container for specifying S3 Intelligent-Tiering filters. The filters determine -// the subset of objects to which the rule applies. -type IntelligentTieringAndOperator struct { - _ struct{} `type:"structure"` - - // An object key name prefix that identifies the subset of objects to which - // the configuration applies. - Prefix *string `type:"string"` - - // All of these tags must exist in the object's tag set in order for the configuration - // to apply. - Tags []*Tag `locationName:"Tag" locationNameList:"Tag" type:"list" flattened:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s IntelligentTieringAndOperator) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s IntelligentTieringAndOperator) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *IntelligentTieringAndOperator) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IntelligentTieringAndOperator"} - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPrefix sets the Prefix field's value. -func (s *IntelligentTieringAndOperator) SetPrefix(v string) *IntelligentTieringAndOperator { - s.Prefix = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *IntelligentTieringAndOperator) SetTags(v []*Tag) *IntelligentTieringAndOperator { - s.Tags = v - return s -} - -// Specifies the S3 Intelligent-Tiering configuration for an Amazon S3 bucket. -// -// For information about the S3 Intelligent-Tiering storage class, see Storage -// class for automatically optimizing frequently and infrequently accessed objects -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access). -type IntelligentTieringConfiguration struct { - _ struct{} `type:"structure"` - - // Specifies a bucket filter. The configuration only includes objects that meet - // the filter's criteria. - Filter *IntelligentTieringFilter `type:"structure"` - - // The ID used to identify the S3 Intelligent-Tiering configuration. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // Specifies the status of the configuration. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"IntelligentTieringStatus"` - - // Specifies the S3 Intelligent-Tiering storage class tier of the configuration. - // - // Tierings is a required field - Tierings []*Tiering `locationName:"Tiering" type:"list" flattened:"true" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s IntelligentTieringConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s IntelligentTieringConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *IntelligentTieringConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IntelligentTieringConfiguration"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - if s.Tierings == nil { - invalidParams.Add(request.NewErrParamRequired("Tierings")) - } - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - if s.Tierings != nil { - for i, v := range s.Tierings { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tierings", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *IntelligentTieringConfiguration) SetFilter(v *IntelligentTieringFilter) *IntelligentTieringConfiguration { - s.Filter = v - return s -} - -// SetId sets the Id field's value. -func (s *IntelligentTieringConfiguration) SetId(v string) *IntelligentTieringConfiguration { - s.Id = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *IntelligentTieringConfiguration) SetStatus(v string) *IntelligentTieringConfiguration { - s.Status = &v - return s -} - -// SetTierings sets the Tierings field's value. -func (s *IntelligentTieringConfiguration) SetTierings(v []*Tiering) *IntelligentTieringConfiguration { - s.Tierings = v - return s -} - -// The Filter is used to identify objects that the S3 Intelligent-Tiering configuration -// applies to. -type IntelligentTieringFilter struct { - _ struct{} `type:"structure"` - - // A conjunction (logical AND) of predicates, which is used in evaluating a - // metrics filter. The operator must have at least two predicates, and an object - // must match all of the predicates in order for the filter to apply. - And *IntelligentTieringAndOperator `type:"structure"` - - // An object key name prefix that identifies the subset of objects to which - // the rule applies. - // - // Replacement must be made for object keys containing special characters (such - // as carriage returns) when using XML requests. For more information, see XML - // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). - Prefix *string `type:"string"` - - // A container of a key value name pair. - Tag *Tag `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s IntelligentTieringFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s IntelligentTieringFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *IntelligentTieringFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "IntelligentTieringFilter"} - if s.And != nil { - if err := s.And.Validate(); err != nil { - invalidParams.AddNested("And", err.(request.ErrInvalidParams)) - } - } - if s.Tag != nil { - if err := s.Tag.Validate(); err != nil { - invalidParams.AddNested("Tag", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnd sets the And field's value. -func (s *IntelligentTieringFilter) SetAnd(v *IntelligentTieringAndOperator) *IntelligentTieringFilter { - s.And = v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *IntelligentTieringFilter) SetPrefix(v string) *IntelligentTieringFilter { - s.Prefix = &v - return s -} - -// SetTag sets the Tag field's value. -func (s *IntelligentTieringFilter) SetTag(v *Tag) *IntelligentTieringFilter { - s.Tag = v - return s -} - -// Specifies the inventory configuration for an Amazon S3 bucket. For more information, -// see GET Bucket inventory (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETInventoryConfig.html) -// in the Amazon S3 API Reference. -type InventoryConfiguration struct { - _ struct{} `type:"structure"` - - // Contains information about where to publish the inventory results. - // - // Destination is a required field - Destination *InventoryDestination `type:"structure" required:"true"` - - // Specifies an inventory filter. The inventory only includes objects that meet - // the filter's criteria. - Filter *InventoryFilter `type:"structure"` - - // The ID used to identify the inventory configuration. - // - // Id is a required field - Id *string `type:"string" required:"true"` - - // Object versions to include in the inventory list. If set to All, the list - // includes all the object versions, which adds the version-related fields VersionId, - // IsLatest, and DeleteMarker to the list. If set to Current, the list does - // not contain these version-related fields. - // - // IncludedObjectVersions is a required field - IncludedObjectVersions *string `type:"string" required:"true" enum:"InventoryIncludedObjectVersions"` - - // Specifies whether the inventory is enabled or disabled. If set to True, an - // inventory list is generated. If set to False, no inventory list is generated. - // - // IsEnabled is a required field - IsEnabled *bool `type:"boolean" required:"true"` - - // Contains the optional fields that are included in the inventory results. - OptionalFields []*string `locationNameList:"Field" type:"list" enum:"InventoryOptionalField"` - - // Specifies the schedule for generating inventory results. - // - // Schedule is a required field - Schedule *InventorySchedule `type:"structure" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InventoryConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InventoryConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InventoryConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InventoryConfiguration"} - if s.Destination == nil { - invalidParams.Add(request.NewErrParamRequired("Destination")) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.IncludedObjectVersions == nil { - invalidParams.Add(request.NewErrParamRequired("IncludedObjectVersions")) - } - if s.IsEnabled == nil { - invalidParams.Add(request.NewErrParamRequired("IsEnabled")) - } - if s.Schedule == nil { - invalidParams.Add(request.NewErrParamRequired("Schedule")) - } - if s.Destination != nil { - if err := s.Destination.Validate(); err != nil { - invalidParams.AddNested("Destination", err.(request.ErrInvalidParams)) - } - } - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - if s.Schedule != nil { - if err := s.Schedule.Validate(); err != nil { - invalidParams.AddNested("Schedule", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestination sets the Destination field's value. -func (s *InventoryConfiguration) SetDestination(v *InventoryDestination) *InventoryConfiguration { - s.Destination = v - return s -} - -// SetFilter sets the Filter field's value. -func (s *InventoryConfiguration) SetFilter(v *InventoryFilter) *InventoryConfiguration { - s.Filter = v - return s -} - -// SetId sets the Id field's value. -func (s *InventoryConfiguration) SetId(v string) *InventoryConfiguration { - s.Id = &v - return s -} - -// SetIncludedObjectVersions sets the IncludedObjectVersions field's value. -func (s *InventoryConfiguration) SetIncludedObjectVersions(v string) *InventoryConfiguration { - s.IncludedObjectVersions = &v - return s -} - -// SetIsEnabled sets the IsEnabled field's value. -func (s *InventoryConfiguration) SetIsEnabled(v bool) *InventoryConfiguration { - s.IsEnabled = &v - return s -} - -// SetOptionalFields sets the OptionalFields field's value. -func (s *InventoryConfiguration) SetOptionalFields(v []*string) *InventoryConfiguration { - s.OptionalFields = v - return s -} - -// SetSchedule sets the Schedule field's value. -func (s *InventoryConfiguration) SetSchedule(v *InventorySchedule) *InventoryConfiguration { - s.Schedule = v - return s -} - -// Specifies the inventory configuration for an Amazon S3 bucket. -type InventoryDestination struct { - _ struct{} `type:"structure"` - - // Contains the bucket name, file format, bucket owner (optional), and prefix - // (optional) where inventory results are published. - // - // S3BucketDestination is a required field - S3BucketDestination *InventoryS3BucketDestination `type:"structure" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InventoryDestination) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InventoryDestination) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InventoryDestination) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InventoryDestination"} - if s.S3BucketDestination == nil { - invalidParams.Add(request.NewErrParamRequired("S3BucketDestination")) - } - if s.S3BucketDestination != nil { - if err := s.S3BucketDestination.Validate(); err != nil { - invalidParams.AddNested("S3BucketDestination", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3BucketDestination sets the S3BucketDestination field's value. -func (s *InventoryDestination) SetS3BucketDestination(v *InventoryS3BucketDestination) *InventoryDestination { - s.S3BucketDestination = v - return s -} - -// Contains the type of server-side encryption used to encrypt the inventory -// results. -type InventoryEncryption struct { - _ struct{} `type:"structure"` - - // Specifies the use of SSE-KMS to encrypt delivered inventory reports. - SSEKMS *SSEKMS `locationName:"SSE-KMS" type:"structure"` - - // Specifies the use of SSE-S3 to encrypt delivered inventory reports. - SSES3 *SSES3 `locationName:"SSE-S3" type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InventoryEncryption) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InventoryEncryption) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InventoryEncryption) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InventoryEncryption"} - if s.SSEKMS != nil { - if err := s.SSEKMS.Validate(); err != nil { - invalidParams.AddNested("SSEKMS", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetSSEKMS sets the SSEKMS field's value. -func (s *InventoryEncryption) SetSSEKMS(v *SSEKMS) *InventoryEncryption { - s.SSEKMS = v - return s -} - -// SetSSES3 sets the SSES3 field's value. -func (s *InventoryEncryption) SetSSES3(v *SSES3) *InventoryEncryption { - s.SSES3 = v - return s -} - -// Specifies an inventory filter. The inventory only includes objects that meet -// the filter's criteria. -type InventoryFilter struct { - _ struct{} `type:"structure"` - - // The prefix that an object must have to be included in the inventory results. - // - // Prefix is a required field - Prefix *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InventoryFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InventoryFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InventoryFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InventoryFilter"} - if s.Prefix == nil { - invalidParams.Add(request.NewErrParamRequired("Prefix")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPrefix sets the Prefix field's value. -func (s *InventoryFilter) SetPrefix(v string) *InventoryFilter { - s.Prefix = &v - return s -} - -// Contains the bucket name, file format, bucket owner (optional), and prefix -// (optional) where inventory results are published. -type InventoryS3BucketDestination struct { - _ struct{} `type:"structure"` - - // The account ID that owns the destination S3 bucket. If no account ID is provided, - // the owner is not validated before exporting data. - // - // Although this value is optional, we strongly recommend that you set it to - // help prevent problems if the destination bucket ownership changes. - AccountId *string `type:"string"` - - // The Amazon Resource Name (ARN) of the bucket where inventory results will - // be published. - // - // Bucket is a required field - Bucket *string `type:"string" required:"true"` - - // Contains the type of server-side encryption used to encrypt the inventory - // results. - Encryption *InventoryEncryption `type:"structure"` - - // Specifies the output format of the inventory results. - // - // Format is a required field - Format *string `type:"string" required:"true" enum:"InventoryFormat"` - - // The prefix that is prepended to all inventory results. - Prefix *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InventoryS3BucketDestination) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InventoryS3BucketDestination) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InventoryS3BucketDestination) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InventoryS3BucketDestination"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Format == nil { - invalidParams.Add(request.NewErrParamRequired("Format")) - } - if s.Encryption != nil { - if err := s.Encryption.Validate(); err != nil { - invalidParams.AddNested("Encryption", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccountId sets the AccountId field's value. -func (s *InventoryS3BucketDestination) SetAccountId(v string) *InventoryS3BucketDestination { - s.AccountId = &v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *InventoryS3BucketDestination) SetBucket(v string) *InventoryS3BucketDestination { - s.Bucket = &v - return s -} - -func (s *InventoryS3BucketDestination) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetEncryption sets the Encryption field's value. -func (s *InventoryS3BucketDestination) SetEncryption(v *InventoryEncryption) *InventoryS3BucketDestination { - s.Encryption = v - return s -} - -// SetFormat sets the Format field's value. -func (s *InventoryS3BucketDestination) SetFormat(v string) *InventoryS3BucketDestination { - s.Format = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *InventoryS3BucketDestination) SetPrefix(v string) *InventoryS3BucketDestination { - s.Prefix = &v - return s -} - -// Specifies the schedule for generating inventory results. -type InventorySchedule struct { - _ struct{} `type:"structure"` - - // Specifies how frequently inventory results are produced. - // - // Frequency is a required field - Frequency *string `type:"string" required:"true" enum:"InventoryFrequency"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InventorySchedule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s InventorySchedule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *InventorySchedule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "InventorySchedule"} - if s.Frequency == nil { - invalidParams.Add(request.NewErrParamRequired("Frequency")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFrequency sets the Frequency field's value. -func (s *InventorySchedule) SetFrequency(v string) *InventorySchedule { - s.Frequency = &v - return s -} - -// Specifies JSON as object's input serialization format. -type JSONInput struct { - _ struct{} `type:"structure"` - - // The type of JSON. Valid values: Document, Lines. - Type *string `type:"string" enum:"JSONType"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s JSONInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s JSONInput) GoString() string { - return s.String() -} - -// SetType sets the Type field's value. -func (s *JSONInput) SetType(v string) *JSONInput { - s.Type = &v - return s -} - -// Specifies JSON as request's output serialization format. -type JSONOutput struct { - _ struct{} `type:"structure"` - - // The value used to separate individual records in the output. If no value - // is specified, Amazon S3 uses a newline character ('\n'). - RecordDelimiter *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s JSONOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s JSONOutput) GoString() string { - return s.String() -} - -// SetRecordDelimiter sets the RecordDelimiter field's value. -func (s *JSONOutput) SetRecordDelimiter(v string) *JSONOutput { - s.RecordDelimiter = &v - return s -} - -// A container for object key name prefix and suffix filtering rules. -type KeyFilter struct { - _ struct{} `type:"structure"` - - // A list of containers for the key-value pair that defines the criteria for - // the filter rule. - FilterRules []*FilterRule `locationName:"FilterRule" type:"list" flattened:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s KeyFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s KeyFilter) GoString() string { - return s.String() -} - -// SetFilterRules sets the FilterRules field's value. -func (s *KeyFilter) SetFilterRules(v []*FilterRule) *KeyFilter { - s.FilterRules = v - return s -} - -// A container for specifying the configuration for Lambda notifications. -type LambdaFunctionConfiguration struct { - _ struct{} `type:"structure"` - - // The Amazon S3 bucket event for which to invoke the Lambda function. For more - // information, see Supported Event Types (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - // in the Amazon S3 User Guide. - // - // Events is a required field - Events []*string `locationName:"Event" type:"list" flattened:"true" required:"true" enum:"Event"` - - // Specifies object key name filtering rules. For information about key name - // filtering, see Configuring Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - // in the Amazon S3 User Guide. - Filter *NotificationConfigurationFilter `type:"structure"` - - // An optional unique identifier for configurations in a notification configuration. - // If you don't provide one, Amazon S3 will assign an ID. - Id *string `type:"string"` - - // The Amazon Resource Name (ARN) of the Lambda function that Amazon S3 invokes - // when the specified event type occurs. - // - // LambdaFunctionArn is a required field - LambdaFunctionArn *string `locationName:"CloudFunction" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LambdaFunctionConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LambdaFunctionConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LambdaFunctionConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LambdaFunctionConfiguration"} - if s.Events == nil { - invalidParams.Add(request.NewErrParamRequired("Events")) - } - if s.LambdaFunctionArn == nil { - invalidParams.Add(request.NewErrParamRequired("LambdaFunctionArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEvents sets the Events field's value. -func (s *LambdaFunctionConfiguration) SetEvents(v []*string) *LambdaFunctionConfiguration { - s.Events = v - return s -} - -// SetFilter sets the Filter field's value. -func (s *LambdaFunctionConfiguration) SetFilter(v *NotificationConfigurationFilter) *LambdaFunctionConfiguration { - s.Filter = v - return s -} - -// SetId sets the Id field's value. -func (s *LambdaFunctionConfiguration) SetId(v string) *LambdaFunctionConfiguration { - s.Id = &v - return s -} - -// SetLambdaFunctionArn sets the LambdaFunctionArn field's value. -func (s *LambdaFunctionConfiguration) SetLambdaFunctionArn(v string) *LambdaFunctionConfiguration { - s.LambdaFunctionArn = &v - return s -} - -// Container for lifecycle rules. You can add as many as 1000 rules. -type LifecycleConfiguration struct { - _ struct{} `type:"structure"` - - // Specifies lifecycle configuration rules for an Amazon S3 bucket. - // - // Rules is a required field - Rules []*Rule `locationName:"Rule" type:"list" flattened:"true" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LifecycleConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LifecycleConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LifecycleConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LifecycleConfiguration"} - if s.Rules == nil { - invalidParams.Add(request.NewErrParamRequired("Rules")) - } - if s.Rules != nil { - for i, v := range s.Rules { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRules sets the Rules field's value. -func (s *LifecycleConfiguration) SetRules(v []*Rule) *LifecycleConfiguration { - s.Rules = v - return s -} - -// Container for the expiration for the lifecycle of the object. -type LifecycleExpiration struct { - _ struct{} `type:"structure"` - - // Indicates at what date the object is to be moved or deleted. Should be in - // GMT ISO 8601 Format. - Date *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Indicates the lifetime, in days, of the objects that are subject to the rule. - // The value must be a non-zero positive integer. - Days *int64 `type:"integer"` - - // Indicates whether Amazon S3 will remove a delete marker with no noncurrent - // versions. If set to true, the delete marker will be expired; if set to false - // the policy takes no action. This cannot be specified with Days or Date in - // a Lifecycle Expiration Policy. - ExpiredObjectDeleteMarker *bool `type:"boolean"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LifecycleExpiration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LifecycleExpiration) GoString() string { - return s.String() -} - -// SetDate sets the Date field's value. -func (s *LifecycleExpiration) SetDate(v time.Time) *LifecycleExpiration { - s.Date = &v - return s -} - -// SetDays sets the Days field's value. -func (s *LifecycleExpiration) SetDays(v int64) *LifecycleExpiration { - s.Days = &v - return s -} - -// SetExpiredObjectDeleteMarker sets the ExpiredObjectDeleteMarker field's value. -func (s *LifecycleExpiration) SetExpiredObjectDeleteMarker(v bool) *LifecycleExpiration { - s.ExpiredObjectDeleteMarker = &v - return s -} - -// A lifecycle rule for individual objects in an Amazon S3 bucket. -type LifecycleRule struct { - _ struct{} `type:"structure"` - - // Specifies the days since the initiation of an incomplete multipart upload - // that Amazon S3 will wait before permanently removing all parts of the upload. - // For more information, see Aborting Incomplete Multipart Uploads Using a Bucket - // Lifecycle Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config) - // in the Amazon S3 User Guide. - AbortIncompleteMultipartUpload *AbortIncompleteMultipartUpload `type:"structure"` - - // Specifies the expiration for the lifecycle of the object in the form of date, - // days and, whether the object has a delete marker. - Expiration *LifecycleExpiration `type:"structure"` - - // The Filter is used to identify objects that a Lifecycle Rule applies to. - // A Filter must have exactly one of Prefix, Tag, or And specified. Filter is - // required if the LifecycleRule does not contain a Prefix element. - Filter *LifecycleRuleFilter `type:"structure"` - - // Unique identifier for the rule. The value cannot be longer than 255 characters. - ID *string `type:"string"` - - // Specifies when noncurrent object versions expire. Upon expiration, Amazon - // S3 permanently deletes the noncurrent object versions. You set this lifecycle - // configuration action on a bucket that has versioning enabled (or suspended) - // to request that Amazon S3 delete noncurrent object versions at a specific - // period in the object's lifetime. - NoncurrentVersionExpiration *NoncurrentVersionExpiration `type:"structure"` - - // Specifies the transition rule for the lifecycle rule that describes when - // noncurrent objects transition to a specific storage class. If your bucket - // is versioning-enabled (or versioning is suspended), you can set this action - // to request that Amazon S3 transition noncurrent object versions to a specific - // storage class at a set period in the object's lifetime. - NoncurrentVersionTransitions []*NoncurrentVersionTransition `locationName:"NoncurrentVersionTransition" type:"list" flattened:"true"` - - // Prefix identifying one or more objects to which the rule applies. This is - // no longer used; use Filter instead. - // - // Replacement must be made for object keys containing special characters (such - // as carriage returns) when using XML requests. For more information, see XML - // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). - // - // Deprecated: Prefix has been deprecated - Prefix *string `deprecated:"true" type:"string"` - - // If 'Enabled', the rule is currently being applied. If 'Disabled', the rule - // is not currently being applied. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"ExpirationStatus"` - - // Specifies when an Amazon S3 object transitions to a specified storage class. - Transitions []*Transition `locationName:"Transition" type:"list" flattened:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LifecycleRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LifecycleRule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LifecycleRule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LifecycleRule"} - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAbortIncompleteMultipartUpload sets the AbortIncompleteMultipartUpload field's value. -func (s *LifecycleRule) SetAbortIncompleteMultipartUpload(v *AbortIncompleteMultipartUpload) *LifecycleRule { - s.AbortIncompleteMultipartUpload = v - return s -} - -// SetExpiration sets the Expiration field's value. -func (s *LifecycleRule) SetExpiration(v *LifecycleExpiration) *LifecycleRule { - s.Expiration = v - return s -} - -// SetFilter sets the Filter field's value. -func (s *LifecycleRule) SetFilter(v *LifecycleRuleFilter) *LifecycleRule { - s.Filter = v - return s -} - -// SetID sets the ID field's value. -func (s *LifecycleRule) SetID(v string) *LifecycleRule { - s.ID = &v - return s -} - -// SetNoncurrentVersionExpiration sets the NoncurrentVersionExpiration field's value. -func (s *LifecycleRule) SetNoncurrentVersionExpiration(v *NoncurrentVersionExpiration) *LifecycleRule { - s.NoncurrentVersionExpiration = v - return s -} - -// SetNoncurrentVersionTransitions sets the NoncurrentVersionTransitions field's value. -func (s *LifecycleRule) SetNoncurrentVersionTransitions(v []*NoncurrentVersionTransition) *LifecycleRule { - s.NoncurrentVersionTransitions = v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *LifecycleRule) SetPrefix(v string) *LifecycleRule { - s.Prefix = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *LifecycleRule) SetStatus(v string) *LifecycleRule { - s.Status = &v - return s -} - -// SetTransitions sets the Transitions field's value. -func (s *LifecycleRule) SetTransitions(v []*Transition) *LifecycleRule { - s.Transitions = v - return s -} - -// This is used in a Lifecycle Rule Filter to apply a logical AND to two or -// more predicates. The Lifecycle Rule will apply to any object matching all -// of the predicates configured inside the And operator. -type LifecycleRuleAndOperator struct { - _ struct{} `type:"structure"` - - // Minimum object size to which the rule applies. - ObjectSizeGreaterThan *int64 `type:"long"` - - // Maximum object size to which the rule applies. - ObjectSizeLessThan *int64 `type:"long"` - - // Prefix identifying one or more objects to which the rule applies. - Prefix *string `type:"string"` - - // All of these tags must exist in the object's tag set in order for the rule - // to apply. - Tags []*Tag `locationName:"Tag" locationNameList:"Tag" type:"list" flattened:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LifecycleRuleAndOperator) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LifecycleRuleAndOperator) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LifecycleRuleAndOperator) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LifecycleRuleAndOperator"} - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetObjectSizeGreaterThan sets the ObjectSizeGreaterThan field's value. -func (s *LifecycleRuleAndOperator) SetObjectSizeGreaterThan(v int64) *LifecycleRuleAndOperator { - s.ObjectSizeGreaterThan = &v - return s -} - -// SetObjectSizeLessThan sets the ObjectSizeLessThan field's value. -func (s *LifecycleRuleAndOperator) SetObjectSizeLessThan(v int64) *LifecycleRuleAndOperator { - s.ObjectSizeLessThan = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *LifecycleRuleAndOperator) SetPrefix(v string) *LifecycleRuleAndOperator { - s.Prefix = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *LifecycleRuleAndOperator) SetTags(v []*Tag) *LifecycleRuleAndOperator { - s.Tags = v - return s -} - -// The Filter is used to identify objects that a Lifecycle Rule applies to. -// A Filter must have exactly one of Prefix, Tag, or And specified. -type LifecycleRuleFilter struct { - _ struct{} `type:"structure"` - - // This is used in a Lifecycle Rule Filter to apply a logical AND to two or - // more predicates. The Lifecycle Rule will apply to any object matching all - // of the predicates configured inside the And operator. - And *LifecycleRuleAndOperator `type:"structure"` - - // Minimum object size to which the rule applies. - ObjectSizeGreaterThan *int64 `type:"long"` - - // Maximum object size to which the rule applies. - ObjectSizeLessThan *int64 `type:"long"` - - // Prefix identifying one or more objects to which the rule applies. - // - // Replacement must be made for object keys containing special characters (such - // as carriage returns) when using XML requests. For more information, see XML - // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). - Prefix *string `type:"string"` - - // This tag must exist in the object's tag set in order for the rule to apply. - Tag *Tag `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LifecycleRuleFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LifecycleRuleFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LifecycleRuleFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LifecycleRuleFilter"} - if s.And != nil { - if err := s.And.Validate(); err != nil { - invalidParams.AddNested("And", err.(request.ErrInvalidParams)) - } - } - if s.Tag != nil { - if err := s.Tag.Validate(); err != nil { - invalidParams.AddNested("Tag", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnd sets the And field's value. -func (s *LifecycleRuleFilter) SetAnd(v *LifecycleRuleAndOperator) *LifecycleRuleFilter { - s.And = v - return s -} - -// SetObjectSizeGreaterThan sets the ObjectSizeGreaterThan field's value. -func (s *LifecycleRuleFilter) SetObjectSizeGreaterThan(v int64) *LifecycleRuleFilter { - s.ObjectSizeGreaterThan = &v - return s -} - -// SetObjectSizeLessThan sets the ObjectSizeLessThan field's value. -func (s *LifecycleRuleFilter) SetObjectSizeLessThan(v int64) *LifecycleRuleFilter { - s.ObjectSizeLessThan = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *LifecycleRuleFilter) SetPrefix(v string) *LifecycleRuleFilter { - s.Prefix = &v - return s -} - -// SetTag sets the Tag field's value. -func (s *LifecycleRuleFilter) SetTag(v *Tag) *LifecycleRuleFilter { - s.Tag = v - return s -} - -type ListBucketAnalyticsConfigurationsInput struct { - _ struct{} `locationName:"ListBucketAnalyticsConfigurationsRequest" type:"structure"` - - // The name of the bucket from which analytics configurations are retrieved. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The ContinuationToken that represents a placeholder from where this request - // should begin. - ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListBucketAnalyticsConfigurationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListBucketAnalyticsConfigurationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListBucketAnalyticsConfigurationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListBucketAnalyticsConfigurationsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *ListBucketAnalyticsConfigurationsInput) SetBucket(v string) *ListBucketAnalyticsConfigurationsInput { - s.Bucket = &v - return s -} - -func (s *ListBucketAnalyticsConfigurationsInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *ListBucketAnalyticsConfigurationsInput) SetContinuationToken(v string) *ListBucketAnalyticsConfigurationsInput { - s.ContinuationToken = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *ListBucketAnalyticsConfigurationsInput) SetExpectedBucketOwner(v string) *ListBucketAnalyticsConfigurationsInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *ListBucketAnalyticsConfigurationsInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *ListBucketAnalyticsConfigurationsInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s ListBucketAnalyticsConfigurationsInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type ListBucketAnalyticsConfigurationsOutput struct { - _ struct{} `type:"structure"` - - // The list of analytics configurations for a bucket. - AnalyticsConfigurationList []*AnalyticsConfiguration `locationName:"AnalyticsConfiguration" type:"list" flattened:"true"` - - // The marker that is used as a starting point for this analytics configuration - // list response. This value is present if it was sent in the request. - ContinuationToken *string `type:"string"` - - // Indicates whether the returned list of analytics configurations is complete. - // A value of true indicates that the list is not complete and the NextContinuationToken - // will be provided for a subsequent request. - IsTruncated *bool `type:"boolean"` - - // NextContinuationToken is sent when isTruncated is true, which indicates that - // there are more analytics configurations to list. The next request must include - // this NextContinuationToken. The token is obfuscated and is not a usable value. - NextContinuationToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListBucketAnalyticsConfigurationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListBucketAnalyticsConfigurationsOutput) GoString() string { - return s.String() -} - -// SetAnalyticsConfigurationList sets the AnalyticsConfigurationList field's value. -func (s *ListBucketAnalyticsConfigurationsOutput) SetAnalyticsConfigurationList(v []*AnalyticsConfiguration) *ListBucketAnalyticsConfigurationsOutput { - s.AnalyticsConfigurationList = v - return s -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *ListBucketAnalyticsConfigurationsOutput) SetContinuationToken(v string) *ListBucketAnalyticsConfigurationsOutput { - s.ContinuationToken = &v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListBucketAnalyticsConfigurationsOutput) SetIsTruncated(v bool) *ListBucketAnalyticsConfigurationsOutput { - s.IsTruncated = &v - return s -} - -// SetNextContinuationToken sets the NextContinuationToken field's value. -func (s *ListBucketAnalyticsConfigurationsOutput) SetNextContinuationToken(v string) *ListBucketAnalyticsConfigurationsOutput { - s.NextContinuationToken = &v - return s -} - -type ListBucketIntelligentTieringConfigurationsInput struct { - _ struct{} `locationName:"ListBucketIntelligentTieringConfigurationsRequest" type:"structure"` - - // The name of the Amazon S3 bucket whose configuration you want to modify or - // retrieve. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The ContinuationToken that represents a placeholder from where this request - // should begin. - ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListBucketIntelligentTieringConfigurationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListBucketIntelligentTieringConfigurationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListBucketIntelligentTieringConfigurationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListBucketIntelligentTieringConfigurationsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *ListBucketIntelligentTieringConfigurationsInput) SetBucket(v string) *ListBucketIntelligentTieringConfigurationsInput { - s.Bucket = &v - return s -} - -func (s *ListBucketIntelligentTieringConfigurationsInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *ListBucketIntelligentTieringConfigurationsInput) SetContinuationToken(v string) *ListBucketIntelligentTieringConfigurationsInput { - s.ContinuationToken = &v - return s -} - -func (s *ListBucketIntelligentTieringConfigurationsInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *ListBucketIntelligentTieringConfigurationsInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s ListBucketIntelligentTieringConfigurationsInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type ListBucketIntelligentTieringConfigurationsOutput struct { - _ struct{} `type:"structure"` - - // The ContinuationToken that represents a placeholder from where this request - // should begin. - ContinuationToken *string `type:"string"` - - // The list of S3 Intelligent-Tiering configurations for a bucket. - IntelligentTieringConfigurationList []*IntelligentTieringConfiguration `locationName:"IntelligentTieringConfiguration" type:"list" flattened:"true"` - - // Indicates whether the returned list of analytics configurations is complete. - // A value of true indicates that the list is not complete and the NextContinuationToken - // will be provided for a subsequent request. - IsTruncated *bool `type:"boolean"` - - // The marker used to continue this inventory configuration listing. Use the - // NextContinuationToken from this response to continue the listing in a subsequent - // request. The continuation token is an opaque value that Amazon S3 understands. - NextContinuationToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListBucketIntelligentTieringConfigurationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListBucketIntelligentTieringConfigurationsOutput) GoString() string { - return s.String() -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *ListBucketIntelligentTieringConfigurationsOutput) SetContinuationToken(v string) *ListBucketIntelligentTieringConfigurationsOutput { - s.ContinuationToken = &v - return s -} - -// SetIntelligentTieringConfigurationList sets the IntelligentTieringConfigurationList field's value. -func (s *ListBucketIntelligentTieringConfigurationsOutput) SetIntelligentTieringConfigurationList(v []*IntelligentTieringConfiguration) *ListBucketIntelligentTieringConfigurationsOutput { - s.IntelligentTieringConfigurationList = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListBucketIntelligentTieringConfigurationsOutput) SetIsTruncated(v bool) *ListBucketIntelligentTieringConfigurationsOutput { - s.IsTruncated = &v - return s -} - -// SetNextContinuationToken sets the NextContinuationToken field's value. -func (s *ListBucketIntelligentTieringConfigurationsOutput) SetNextContinuationToken(v string) *ListBucketIntelligentTieringConfigurationsOutput { - s.NextContinuationToken = &v - return s -} - -type ListBucketInventoryConfigurationsInput struct { - _ struct{} `locationName:"ListBucketInventoryConfigurationsRequest" type:"structure"` - - // The name of the bucket containing the inventory configurations to retrieve. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The marker used to continue an inventory configuration listing that has been - // truncated. Use the NextContinuationToken from a previously truncated list - // response to continue the listing. The continuation token is an opaque value - // that Amazon S3 understands. - ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListBucketInventoryConfigurationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListBucketInventoryConfigurationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListBucketInventoryConfigurationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListBucketInventoryConfigurationsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *ListBucketInventoryConfigurationsInput) SetBucket(v string) *ListBucketInventoryConfigurationsInput { - s.Bucket = &v - return s -} - -func (s *ListBucketInventoryConfigurationsInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *ListBucketInventoryConfigurationsInput) SetContinuationToken(v string) *ListBucketInventoryConfigurationsInput { - s.ContinuationToken = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *ListBucketInventoryConfigurationsInput) SetExpectedBucketOwner(v string) *ListBucketInventoryConfigurationsInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *ListBucketInventoryConfigurationsInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *ListBucketInventoryConfigurationsInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s ListBucketInventoryConfigurationsInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type ListBucketInventoryConfigurationsOutput struct { - _ struct{} `type:"structure"` - - // If sent in the request, the marker that is used as a starting point for this - // inventory configuration list response. - ContinuationToken *string `type:"string"` - - // The list of inventory configurations for a bucket. - InventoryConfigurationList []*InventoryConfiguration `locationName:"InventoryConfiguration" type:"list" flattened:"true"` - - // Tells whether the returned list of inventory configurations is complete. - // A value of true indicates that the list is not complete and the NextContinuationToken - // is provided for a subsequent request. - IsTruncated *bool `type:"boolean"` - - // The marker used to continue this inventory configuration listing. Use the - // NextContinuationToken from this response to continue the listing in a subsequent - // request. The continuation token is an opaque value that Amazon S3 understands. - NextContinuationToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListBucketInventoryConfigurationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListBucketInventoryConfigurationsOutput) GoString() string { - return s.String() -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *ListBucketInventoryConfigurationsOutput) SetContinuationToken(v string) *ListBucketInventoryConfigurationsOutput { - s.ContinuationToken = &v - return s -} - -// SetInventoryConfigurationList sets the InventoryConfigurationList field's value. -func (s *ListBucketInventoryConfigurationsOutput) SetInventoryConfigurationList(v []*InventoryConfiguration) *ListBucketInventoryConfigurationsOutput { - s.InventoryConfigurationList = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListBucketInventoryConfigurationsOutput) SetIsTruncated(v bool) *ListBucketInventoryConfigurationsOutput { - s.IsTruncated = &v - return s -} - -// SetNextContinuationToken sets the NextContinuationToken field's value. -func (s *ListBucketInventoryConfigurationsOutput) SetNextContinuationToken(v string) *ListBucketInventoryConfigurationsOutput { - s.NextContinuationToken = &v - return s -} - -type ListBucketMetricsConfigurationsInput struct { - _ struct{} `locationName:"ListBucketMetricsConfigurationsRequest" type:"structure"` - - // The name of the bucket containing the metrics configurations to retrieve. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The marker that is used to continue a metrics configuration listing that - // has been truncated. Use the NextContinuationToken from a previously truncated - // list response to continue the listing. The continuation token is an opaque - // value that Amazon S3 understands. - ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListBucketMetricsConfigurationsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListBucketMetricsConfigurationsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListBucketMetricsConfigurationsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListBucketMetricsConfigurationsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *ListBucketMetricsConfigurationsInput) SetBucket(v string) *ListBucketMetricsConfigurationsInput { - s.Bucket = &v - return s -} - -func (s *ListBucketMetricsConfigurationsInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *ListBucketMetricsConfigurationsInput) SetContinuationToken(v string) *ListBucketMetricsConfigurationsInput { - s.ContinuationToken = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *ListBucketMetricsConfigurationsInput) SetExpectedBucketOwner(v string) *ListBucketMetricsConfigurationsInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *ListBucketMetricsConfigurationsInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *ListBucketMetricsConfigurationsInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s ListBucketMetricsConfigurationsInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type ListBucketMetricsConfigurationsOutput struct { - _ struct{} `type:"structure"` - - // The marker that is used as a starting point for this metrics configuration - // list response. This value is present if it was sent in the request. - ContinuationToken *string `type:"string"` - - // Indicates whether the returned list of metrics configurations is complete. - // A value of true indicates that the list is not complete and the NextContinuationToken - // will be provided for a subsequent request. - IsTruncated *bool `type:"boolean"` - - // The list of metrics configurations for a bucket. - MetricsConfigurationList []*MetricsConfiguration `locationName:"MetricsConfiguration" type:"list" flattened:"true"` - - // The marker used to continue a metrics configuration listing that has been - // truncated. Use the NextContinuationToken from a previously truncated list - // response to continue the listing. The continuation token is an opaque value - // that Amazon S3 understands. - NextContinuationToken *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListBucketMetricsConfigurationsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListBucketMetricsConfigurationsOutput) GoString() string { - return s.String() -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *ListBucketMetricsConfigurationsOutput) SetContinuationToken(v string) *ListBucketMetricsConfigurationsOutput { - s.ContinuationToken = &v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListBucketMetricsConfigurationsOutput) SetIsTruncated(v bool) *ListBucketMetricsConfigurationsOutput { - s.IsTruncated = &v - return s -} - -// SetMetricsConfigurationList sets the MetricsConfigurationList field's value. -func (s *ListBucketMetricsConfigurationsOutput) SetMetricsConfigurationList(v []*MetricsConfiguration) *ListBucketMetricsConfigurationsOutput { - s.MetricsConfigurationList = v - return s -} - -// SetNextContinuationToken sets the NextContinuationToken field's value. -func (s *ListBucketMetricsConfigurationsOutput) SetNextContinuationToken(v string) *ListBucketMetricsConfigurationsOutput { - s.NextContinuationToken = &v - return s -} - -type ListBucketsInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListBucketsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListBucketsInput) GoString() string { - return s.String() -} - -type ListBucketsOutput struct { - _ struct{} `type:"structure"` - - // The list of buckets owned by the requester. - Buckets []*Bucket `locationNameList:"Bucket" type:"list"` - - // The owner of the buckets listed. - Owner *Owner `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListBucketsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListBucketsOutput) GoString() string { - return s.String() -} - -// SetBuckets sets the Buckets field's value. -func (s *ListBucketsOutput) SetBuckets(v []*Bucket) *ListBucketsOutput { - s.Buckets = v - return s -} - -// SetOwner sets the Owner field's value. -func (s *ListBucketsOutput) SetOwner(v *Owner) *ListBucketsOutput { - s.Owner = v - return s -} - -type ListMultipartUploadsInput struct { - _ struct{} `locationName:"ListMultipartUploadsRequest" type:"structure"` - - // The name of the bucket to which the multipart upload was initiated. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Character you use to group keys. - // - // All keys that contain the same string between the prefix, if specified, and - // the first occurrence of the delimiter after the prefix are grouped under - // a single result element, CommonPrefixes. If you don't specify the prefix - // parameter, then the substring starts at the beginning of the key. The keys - // that are grouped under CommonPrefixes result element are not returned elsewhere - // in the response. - Delimiter *string `location:"querystring" locationName:"delimiter" type:"string"` - - // Requests Amazon S3 to encode the object keys in the response and specifies - // the encoding method to use. An object key may contain any Unicode character; - // however, XML 1.0 parser cannot parse some characters, such as characters - // with an ASCII value from 0 to 10. For characters that are not supported in - // XML 1.0, you can add this parameter to request that Amazon S3 encode the - // keys in the response. - EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Together with upload-id-marker, this parameter specifies the multipart upload - // after which listing should begin. - // - // If upload-id-marker is not specified, only the keys lexicographically greater - // than the specified key-marker will be included in the list. - // - // If upload-id-marker is specified, any multipart uploads for a key equal to - // the key-marker might also be included, provided those multipart uploads have - // upload IDs lexicographically greater than the specified upload-id-marker. - KeyMarker *string `location:"querystring" locationName:"key-marker" type:"string"` - - // Sets the maximum number of multipart uploads, from 1 to 1,000, to return - // in the response body. 1,000 is the maximum number of uploads that can be - // returned in a response. - MaxUploads *int64 `location:"querystring" locationName:"max-uploads" type:"integer"` - - // Lists in-progress uploads only for those keys that begin with the specified - // prefix. You can use prefixes to separate a bucket into different grouping - // of keys. (You can think of using prefix to make groups in the same way you'd - // use a folder in a file system.) - Prefix *string `location:"querystring" locationName:"prefix" type:"string"` - - // Together with key-marker, specifies the multipart upload after which listing - // should begin. If key-marker is not specified, the upload-id-marker parameter - // is ignored. Otherwise, any multipart uploads for a key equal to the key-marker - // might be included in the list only if they have an upload ID lexicographically - // greater than the specified upload-id-marker. - UploadIdMarker *string `location:"querystring" locationName:"upload-id-marker" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListMultipartUploadsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListMultipartUploadsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListMultipartUploadsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListMultipartUploadsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *ListMultipartUploadsInput) SetBucket(v string) *ListMultipartUploadsInput { - s.Bucket = &v - return s -} - -func (s *ListMultipartUploadsInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetDelimiter sets the Delimiter field's value. -func (s *ListMultipartUploadsInput) SetDelimiter(v string) *ListMultipartUploadsInput { - s.Delimiter = &v - return s -} - -// SetEncodingType sets the EncodingType field's value. -func (s *ListMultipartUploadsInput) SetEncodingType(v string) *ListMultipartUploadsInput { - s.EncodingType = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *ListMultipartUploadsInput) SetExpectedBucketOwner(v string) *ListMultipartUploadsInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetKeyMarker sets the KeyMarker field's value. -func (s *ListMultipartUploadsInput) SetKeyMarker(v string) *ListMultipartUploadsInput { - s.KeyMarker = &v - return s -} - -// SetMaxUploads sets the MaxUploads field's value. -func (s *ListMultipartUploadsInput) SetMaxUploads(v int64) *ListMultipartUploadsInput { - s.MaxUploads = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ListMultipartUploadsInput) SetPrefix(v string) *ListMultipartUploadsInput { - s.Prefix = &v - return s -} - -// SetUploadIdMarker sets the UploadIdMarker field's value. -func (s *ListMultipartUploadsInput) SetUploadIdMarker(v string) *ListMultipartUploadsInput { - s.UploadIdMarker = &v - return s -} - -func (s *ListMultipartUploadsInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *ListMultipartUploadsInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s ListMultipartUploadsInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type ListMultipartUploadsOutput struct { - _ struct{} `type:"structure"` - - // The name of the bucket to which the multipart upload was initiated. Does - // not return the access point ARN or access point alias if used. - Bucket *string `type:"string"` - - // If you specify a delimiter in the request, then the result returns each distinct - // key prefix containing the delimiter in a CommonPrefixes element. The distinct - // key prefixes are returned in the Prefix child element. - CommonPrefixes []*CommonPrefix `type:"list" flattened:"true"` - - // Contains the delimiter you specified in the request. If you don't specify - // a delimiter in your request, this element is absent from the response. - Delimiter *string `type:"string"` - - // Encoding type used by Amazon S3 to encode object keys in the response. - // - // If you specify encoding-type request parameter, Amazon S3 includes this element - // in the response, and returns encoded key name values in the following response - // elements: - // - // Delimiter, KeyMarker, Prefix, NextKeyMarker, Key. - EncodingType *string `type:"string" enum:"EncodingType"` - - // Indicates whether the returned list of multipart uploads is truncated. A - // value of true indicates that the list was truncated. The list can be truncated - // if the number of multipart uploads exceeds the limit allowed or specified - // by max uploads. - IsTruncated *bool `type:"boolean"` - - // The key at or after which the listing began. - KeyMarker *string `type:"string"` - - // Maximum number of multipart uploads that could have been included in the - // response. - MaxUploads *int64 `type:"integer"` - - // When a list is truncated, this element specifies the value that should be - // used for the key-marker request parameter in a subsequent request. - NextKeyMarker *string `type:"string"` - - // When a list is truncated, this element specifies the value that should be - // used for the upload-id-marker request parameter in a subsequent request. - NextUploadIdMarker *string `type:"string"` - - // When a prefix is provided in the request, this field contains the specified - // prefix. The result contains only keys starting with the specified prefix. - Prefix *string `type:"string"` - - // Upload ID after which listing began. - UploadIdMarker *string `type:"string"` - - // Container for elements related to a particular multipart upload. A response - // can contain zero or more Upload elements. - Uploads []*MultipartUpload `locationName:"Upload" type:"list" flattened:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListMultipartUploadsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListMultipartUploadsOutput) GoString() string { - return s.String() -} - -// SetBucket sets the Bucket field's value. -func (s *ListMultipartUploadsOutput) SetBucket(v string) *ListMultipartUploadsOutput { - s.Bucket = &v - return s -} - -func (s *ListMultipartUploadsOutput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetCommonPrefixes sets the CommonPrefixes field's value. -func (s *ListMultipartUploadsOutput) SetCommonPrefixes(v []*CommonPrefix) *ListMultipartUploadsOutput { - s.CommonPrefixes = v - return s -} - -// SetDelimiter sets the Delimiter field's value. -func (s *ListMultipartUploadsOutput) SetDelimiter(v string) *ListMultipartUploadsOutput { - s.Delimiter = &v - return s -} - -// SetEncodingType sets the EncodingType field's value. -func (s *ListMultipartUploadsOutput) SetEncodingType(v string) *ListMultipartUploadsOutput { - s.EncodingType = &v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListMultipartUploadsOutput) SetIsTruncated(v bool) *ListMultipartUploadsOutput { - s.IsTruncated = &v - return s -} - -// SetKeyMarker sets the KeyMarker field's value. -func (s *ListMultipartUploadsOutput) SetKeyMarker(v string) *ListMultipartUploadsOutput { - s.KeyMarker = &v - return s -} - -// SetMaxUploads sets the MaxUploads field's value. -func (s *ListMultipartUploadsOutput) SetMaxUploads(v int64) *ListMultipartUploadsOutput { - s.MaxUploads = &v - return s -} - -// SetNextKeyMarker sets the NextKeyMarker field's value. -func (s *ListMultipartUploadsOutput) SetNextKeyMarker(v string) *ListMultipartUploadsOutput { - s.NextKeyMarker = &v - return s -} - -// SetNextUploadIdMarker sets the NextUploadIdMarker field's value. -func (s *ListMultipartUploadsOutput) SetNextUploadIdMarker(v string) *ListMultipartUploadsOutput { - s.NextUploadIdMarker = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ListMultipartUploadsOutput) SetPrefix(v string) *ListMultipartUploadsOutput { - s.Prefix = &v - return s -} - -// SetUploadIdMarker sets the UploadIdMarker field's value. -func (s *ListMultipartUploadsOutput) SetUploadIdMarker(v string) *ListMultipartUploadsOutput { - s.UploadIdMarker = &v - return s -} - -// SetUploads sets the Uploads field's value. -func (s *ListMultipartUploadsOutput) SetUploads(v []*MultipartUpload) *ListMultipartUploadsOutput { - s.Uploads = v - return s -} - -type ListObjectVersionsInput struct { - _ struct{} `locationName:"ListObjectVersionsRequest" type:"structure"` - - // The bucket name that contains the objects. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // A delimiter is a character that you specify to group keys. All keys that - // contain the same string between the prefix and the first occurrence of the - // delimiter are grouped under a single result element in CommonPrefixes. These - // groups are counted as one result against the max-keys limitation. These keys - // are not returned elsewhere in the response. - Delimiter *string `location:"querystring" locationName:"delimiter" type:"string"` - - // Requests Amazon S3 to encode the object keys in the response and specifies - // the encoding method to use. An object key may contain any Unicode character; - // however, XML 1.0 parser cannot parse some characters, such as characters - // with an ASCII value from 0 to 10. For characters that are not supported in - // XML 1.0, you can add this parameter to request that Amazon S3 encode the - // keys in the response. - EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Specifies the key to start with when listing objects in a bucket. - KeyMarker *string `location:"querystring" locationName:"key-marker" type:"string"` - - // Sets the maximum number of keys returned in the response. By default the - // action returns up to 1,000 key names. The response might contain fewer keys - // but will never contain more. If additional keys satisfy the search criteria, - // but were not returned because max-keys was exceeded, the response contains - // true. To return the additional keys, see key-marker - // and version-id-marker. - MaxKeys *int64 `location:"querystring" locationName:"max-keys" type:"integer"` - - // Use this parameter to select only those keys that begin with the specified - // prefix. You can use prefixes to separate a bucket into different groupings - // of keys. (You can think of using prefix to make groups in the same way you'd - // use a folder in a file system.) You can use prefix with delimiter to roll - // up numerous objects into a single result under CommonPrefixes. - Prefix *string `location:"querystring" locationName:"prefix" type:"string"` - - // Specifies the object version you want to start listing from. - VersionIdMarker *string `location:"querystring" locationName:"version-id-marker" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListObjectVersionsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListObjectVersionsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListObjectVersionsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListObjectVersionsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *ListObjectVersionsInput) SetBucket(v string) *ListObjectVersionsInput { - s.Bucket = &v - return s -} - -func (s *ListObjectVersionsInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetDelimiter sets the Delimiter field's value. -func (s *ListObjectVersionsInput) SetDelimiter(v string) *ListObjectVersionsInput { - s.Delimiter = &v - return s -} - -// SetEncodingType sets the EncodingType field's value. -func (s *ListObjectVersionsInput) SetEncodingType(v string) *ListObjectVersionsInput { - s.EncodingType = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *ListObjectVersionsInput) SetExpectedBucketOwner(v string) *ListObjectVersionsInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetKeyMarker sets the KeyMarker field's value. -func (s *ListObjectVersionsInput) SetKeyMarker(v string) *ListObjectVersionsInput { - s.KeyMarker = &v - return s -} - -// SetMaxKeys sets the MaxKeys field's value. -func (s *ListObjectVersionsInput) SetMaxKeys(v int64) *ListObjectVersionsInput { - s.MaxKeys = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ListObjectVersionsInput) SetPrefix(v string) *ListObjectVersionsInput { - s.Prefix = &v - return s -} - -// SetVersionIdMarker sets the VersionIdMarker field's value. -func (s *ListObjectVersionsInput) SetVersionIdMarker(v string) *ListObjectVersionsInput { - s.VersionIdMarker = &v - return s -} - -func (s *ListObjectVersionsInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *ListObjectVersionsInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s ListObjectVersionsInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type ListObjectVersionsOutput struct { - _ struct{} `type:"structure"` - - // All of the keys rolled up into a common prefix count as a single return when - // calculating the number of returns. - CommonPrefixes []*CommonPrefix `type:"list" flattened:"true"` - - // Container for an object that is a delete marker. - DeleteMarkers []*DeleteMarkerEntry `locationName:"DeleteMarker" type:"list" flattened:"true"` - - // The delimiter grouping the included keys. A delimiter is a character that - // you specify to group keys. All keys that contain the same string between - // the prefix and the first occurrence of the delimiter are grouped under a - // single result element in CommonPrefixes. These groups are counted as one - // result against the max-keys limitation. These keys are not returned elsewhere - // in the response. - Delimiter *string `type:"string"` - - // Encoding type used by Amazon S3 to encode object key names in the XML response. - // - // If you specify encoding-type request parameter, Amazon S3 includes this element - // in the response, and returns encoded key name values in the following response - // elements: - // - // KeyMarker, NextKeyMarker, Prefix, Key, and Delimiter. - EncodingType *string `type:"string" enum:"EncodingType"` - - // A flag that indicates whether Amazon S3 returned all of the results that - // satisfied the search criteria. If your results were truncated, you can make - // a follow-up paginated request using the NextKeyMarker and NextVersionIdMarker - // response parameters as a starting place in another request to return the - // rest of the results. - IsTruncated *bool `type:"boolean"` - - // Marks the last key returned in a truncated response. - KeyMarker *string `type:"string"` - - // Specifies the maximum number of objects to return. - MaxKeys *int64 `type:"integer"` - - // The bucket name. - Name *string `type:"string"` - - // When the number of responses exceeds the value of MaxKeys, NextKeyMarker - // specifies the first key not returned that satisfies the search criteria. - // Use this value for the key-marker request parameter in a subsequent request. - NextKeyMarker *string `type:"string"` - - // When the number of responses exceeds the value of MaxKeys, NextVersionIdMarker - // specifies the first object version not returned that satisfies the search - // criteria. Use this value for the version-id-marker request parameter in a - // subsequent request. - NextVersionIdMarker *string `type:"string"` - - // Selects objects that start with the value supplied by this parameter. - Prefix *string `type:"string"` - - // Marks the last version of the key returned in a truncated response. - VersionIdMarker *string `type:"string"` - - // Container for version information. - Versions []*ObjectVersion `locationName:"Version" type:"list" flattened:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListObjectVersionsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListObjectVersionsOutput) GoString() string { - return s.String() -} - -// SetCommonPrefixes sets the CommonPrefixes field's value. -func (s *ListObjectVersionsOutput) SetCommonPrefixes(v []*CommonPrefix) *ListObjectVersionsOutput { - s.CommonPrefixes = v - return s -} - -// SetDeleteMarkers sets the DeleteMarkers field's value. -func (s *ListObjectVersionsOutput) SetDeleteMarkers(v []*DeleteMarkerEntry) *ListObjectVersionsOutput { - s.DeleteMarkers = v - return s -} - -// SetDelimiter sets the Delimiter field's value. -func (s *ListObjectVersionsOutput) SetDelimiter(v string) *ListObjectVersionsOutput { - s.Delimiter = &v - return s -} - -// SetEncodingType sets the EncodingType field's value. -func (s *ListObjectVersionsOutput) SetEncodingType(v string) *ListObjectVersionsOutput { - s.EncodingType = &v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListObjectVersionsOutput) SetIsTruncated(v bool) *ListObjectVersionsOutput { - s.IsTruncated = &v - return s -} - -// SetKeyMarker sets the KeyMarker field's value. -func (s *ListObjectVersionsOutput) SetKeyMarker(v string) *ListObjectVersionsOutput { - s.KeyMarker = &v - return s -} - -// SetMaxKeys sets the MaxKeys field's value. -func (s *ListObjectVersionsOutput) SetMaxKeys(v int64) *ListObjectVersionsOutput { - s.MaxKeys = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListObjectVersionsOutput) SetName(v string) *ListObjectVersionsOutput { - s.Name = &v - return s -} - -// SetNextKeyMarker sets the NextKeyMarker field's value. -func (s *ListObjectVersionsOutput) SetNextKeyMarker(v string) *ListObjectVersionsOutput { - s.NextKeyMarker = &v - return s -} - -// SetNextVersionIdMarker sets the NextVersionIdMarker field's value. -func (s *ListObjectVersionsOutput) SetNextVersionIdMarker(v string) *ListObjectVersionsOutput { - s.NextVersionIdMarker = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ListObjectVersionsOutput) SetPrefix(v string) *ListObjectVersionsOutput { - s.Prefix = &v - return s -} - -// SetVersionIdMarker sets the VersionIdMarker field's value. -func (s *ListObjectVersionsOutput) SetVersionIdMarker(v string) *ListObjectVersionsOutput { - s.VersionIdMarker = &v - return s -} - -// SetVersions sets the Versions field's value. -func (s *ListObjectVersionsOutput) SetVersions(v []*ObjectVersion) *ListObjectVersionsOutput { - s.Versions = v - return s -} - -type ListObjectsInput struct { - _ struct{} `locationName:"ListObjectsRequest" type:"structure"` - - // The name of the bucket containing the objects. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // A delimiter is a character you use to group keys. - Delimiter *string `location:"querystring" locationName:"delimiter" type:"string"` - - // Requests Amazon S3 to encode the object keys in the response and specifies - // the encoding method to use. An object key may contain any Unicode character; - // however, XML 1.0 parser cannot parse some characters, such as characters - // with an ASCII value from 0 to 10. For characters that are not supported in - // XML 1.0, you can add this parameter to request that Amazon S3 encode the - // keys in the response. - EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Marker is where you want Amazon S3 to start listing from. Amazon S3 starts - // listing after this specified key. Marker can be any key in the bucket. - Marker *string `location:"querystring" locationName:"marker" type:"string"` - - // Sets the maximum number of keys returned in the response. By default the - // action returns up to 1,000 key names. The response might contain fewer keys - // but will never contain more. - MaxKeys *int64 `location:"querystring" locationName:"max-keys" type:"integer"` - - // Limits the response to keys that begin with the specified prefix. - Prefix *string `location:"querystring" locationName:"prefix" type:"string"` - - // Confirms that the requester knows that she or he will be charged for the - // list objects request. Bucket owners need not specify this parameter in their - // requests. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListObjectsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListObjectsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListObjectsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListObjectsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *ListObjectsInput) SetBucket(v string) *ListObjectsInput { - s.Bucket = &v - return s -} - -func (s *ListObjectsInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetDelimiter sets the Delimiter field's value. -func (s *ListObjectsInput) SetDelimiter(v string) *ListObjectsInput { - s.Delimiter = &v - return s -} - -// SetEncodingType sets the EncodingType field's value. -func (s *ListObjectsInput) SetEncodingType(v string) *ListObjectsInput { - s.EncodingType = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *ListObjectsInput) SetExpectedBucketOwner(v string) *ListObjectsInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListObjectsInput) SetMarker(v string) *ListObjectsInput { - s.Marker = &v - return s -} - -// SetMaxKeys sets the MaxKeys field's value. -func (s *ListObjectsInput) SetMaxKeys(v int64) *ListObjectsInput { - s.MaxKeys = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ListObjectsInput) SetPrefix(v string) *ListObjectsInput { - s.Prefix = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *ListObjectsInput) SetRequestPayer(v string) *ListObjectsInput { - s.RequestPayer = &v - return s -} - -func (s *ListObjectsInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *ListObjectsInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s ListObjectsInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type ListObjectsOutput struct { - _ struct{} `type:"structure"` - - // All of the keys (up to 1,000) rolled up in a common prefix count as a single - // return when calculating the number of returns. - // - // A response can contain CommonPrefixes only if you specify a delimiter. - // - // CommonPrefixes contains all (if there are any) keys between Prefix and the - // next occurrence of the string specified by the delimiter. - // - // CommonPrefixes lists keys that act like subdirectories in the directory specified - // by Prefix. - // - // For example, if the prefix is notes/ and the delimiter is a slash (/) as - // in notes/summer/july, the common prefix is notes/summer/. All of the keys - // that roll up into a common prefix count as a single return when calculating - // the number of returns. - CommonPrefixes []*CommonPrefix `type:"list" flattened:"true"` - - // Metadata about each object returned. - Contents []*Object `type:"list" flattened:"true"` - - // Causes keys that contain the same string between the prefix and the first - // occurrence of the delimiter to be rolled up into a single result element - // in the CommonPrefixes collection. These rolled-up keys are not returned elsewhere - // in the response. Each rolled-up result counts as only one return against - // the MaxKeys value. - Delimiter *string `type:"string"` - - // Encoding type used by Amazon S3 to encode object keys in the response. - EncodingType *string `type:"string" enum:"EncodingType"` - - // A flag that indicates whether Amazon S3 returned all of the results that - // satisfied the search criteria. - IsTruncated *bool `type:"boolean"` - - // Indicates where in the bucket listing begins. Marker is included in the response - // if it was sent with the request. - Marker *string `type:"string"` - - // The maximum number of keys returned in the response body. - MaxKeys *int64 `type:"integer"` - - // The bucket name. - Name *string `type:"string"` - - // When response is truncated (the IsTruncated element value in the response - // is true), you can use the key name in this field as marker in the subsequent - // request to get next set of objects. Amazon S3 lists objects in alphabetical - // order Note: This element is returned only if you have delimiter request parameter - // specified. If response does not include the NextMarker and it is truncated, - // you can use the value of the last Key in the response as the marker in the - // subsequent request to get the next set of object keys. - NextMarker *string `type:"string"` - - // Keys that begin with the indicated prefix. - Prefix *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListObjectsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListObjectsOutput) GoString() string { - return s.String() -} - -// SetCommonPrefixes sets the CommonPrefixes field's value. -func (s *ListObjectsOutput) SetCommonPrefixes(v []*CommonPrefix) *ListObjectsOutput { - s.CommonPrefixes = v - return s -} - -// SetContents sets the Contents field's value. -func (s *ListObjectsOutput) SetContents(v []*Object) *ListObjectsOutput { - s.Contents = v - return s -} - -// SetDelimiter sets the Delimiter field's value. -func (s *ListObjectsOutput) SetDelimiter(v string) *ListObjectsOutput { - s.Delimiter = &v - return s -} - -// SetEncodingType sets the EncodingType field's value. -func (s *ListObjectsOutput) SetEncodingType(v string) *ListObjectsOutput { - s.EncodingType = &v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListObjectsOutput) SetIsTruncated(v bool) *ListObjectsOutput { - s.IsTruncated = &v - return s -} - -// SetMarker sets the Marker field's value. -func (s *ListObjectsOutput) SetMarker(v string) *ListObjectsOutput { - s.Marker = &v - return s -} - -// SetMaxKeys sets the MaxKeys field's value. -func (s *ListObjectsOutput) SetMaxKeys(v int64) *ListObjectsOutput { - s.MaxKeys = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListObjectsOutput) SetName(v string) *ListObjectsOutput { - s.Name = &v - return s -} - -// SetNextMarker sets the NextMarker field's value. -func (s *ListObjectsOutput) SetNextMarker(v string) *ListObjectsOutput { - s.NextMarker = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ListObjectsOutput) SetPrefix(v string) *ListObjectsOutput { - s.Prefix = &v - return s -} - -type ListObjectsV2Input struct { - _ struct{} `locationName:"ListObjectsV2Request" type:"structure"` - - // Bucket name to list. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // ContinuationToken indicates Amazon S3 that the list is being continued on - // this bucket with a token. ContinuationToken is obfuscated and is not a real - // key. - ContinuationToken *string `location:"querystring" locationName:"continuation-token" type:"string"` - - // A delimiter is a character you use to group keys. - Delimiter *string `location:"querystring" locationName:"delimiter" type:"string"` - - // Encoding type used by Amazon S3 to encode object keys in the response. - EncodingType *string `location:"querystring" locationName:"encoding-type" type:"string" enum:"EncodingType"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The owner field is not present in listV2 by default, if you want to return - // owner field with each key in the result then set the fetch owner field to - // true. - FetchOwner *bool `location:"querystring" locationName:"fetch-owner" type:"boolean"` - - // Sets the maximum number of keys returned in the response. By default the - // action returns up to 1,000 key names. The response might contain fewer keys - // but will never contain more. - MaxKeys *int64 `location:"querystring" locationName:"max-keys" type:"integer"` - - // Limits the response to keys that begin with the specified prefix. - Prefix *string `location:"querystring" locationName:"prefix" type:"string"` - - // Confirms that the requester knows that she or he will be charged for the - // list objects request in V2 style. Bucket owners need not specify this parameter - // in their requests. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // StartAfter is where you want Amazon S3 to start listing from. Amazon S3 starts - // listing after this specified key. StartAfter can be any key in the bucket. - StartAfter *string `location:"querystring" locationName:"start-after" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListObjectsV2Input) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListObjectsV2Input) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListObjectsV2Input) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListObjectsV2Input"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *ListObjectsV2Input) SetBucket(v string) *ListObjectsV2Input { - s.Bucket = &v - return s -} - -func (s *ListObjectsV2Input) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *ListObjectsV2Input) SetContinuationToken(v string) *ListObjectsV2Input { - s.ContinuationToken = &v - return s -} - -// SetDelimiter sets the Delimiter field's value. -func (s *ListObjectsV2Input) SetDelimiter(v string) *ListObjectsV2Input { - s.Delimiter = &v - return s -} - -// SetEncodingType sets the EncodingType field's value. -func (s *ListObjectsV2Input) SetEncodingType(v string) *ListObjectsV2Input { - s.EncodingType = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *ListObjectsV2Input) SetExpectedBucketOwner(v string) *ListObjectsV2Input { - s.ExpectedBucketOwner = &v - return s -} - -// SetFetchOwner sets the FetchOwner field's value. -func (s *ListObjectsV2Input) SetFetchOwner(v bool) *ListObjectsV2Input { - s.FetchOwner = &v - return s -} - -// SetMaxKeys sets the MaxKeys field's value. -func (s *ListObjectsV2Input) SetMaxKeys(v int64) *ListObjectsV2Input { - s.MaxKeys = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ListObjectsV2Input) SetPrefix(v string) *ListObjectsV2Input { - s.Prefix = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *ListObjectsV2Input) SetRequestPayer(v string) *ListObjectsV2Input { - s.RequestPayer = &v - return s -} - -// SetStartAfter sets the StartAfter field's value. -func (s *ListObjectsV2Input) SetStartAfter(v string) *ListObjectsV2Input { - s.StartAfter = &v - return s -} - -func (s *ListObjectsV2Input) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *ListObjectsV2Input) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s ListObjectsV2Input) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type ListObjectsV2Output struct { - _ struct{} `type:"structure"` - - // All of the keys (up to 1,000) rolled up into a common prefix count as a single - // return when calculating the number of returns. - // - // A response can contain CommonPrefixes only if you specify a delimiter. - // - // CommonPrefixes contains all (if there are any) keys between Prefix and the - // next occurrence of the string specified by a delimiter. - // - // CommonPrefixes lists keys that act like subdirectories in the directory specified - // by Prefix. - // - // For example, if the prefix is notes/ and the delimiter is a slash (/) as - // in notes/summer/july, the common prefix is notes/summer/. All of the keys - // that roll up into a common prefix count as a single return when calculating - // the number of returns. - CommonPrefixes []*CommonPrefix `type:"list" flattened:"true"` - - // Metadata about each object returned. - Contents []*Object `type:"list" flattened:"true"` - - // If ContinuationToken was sent with the request, it is included in the response. - ContinuationToken *string `type:"string"` - - // Causes keys that contain the same string between the prefix and the first - // occurrence of the delimiter to be rolled up into a single result element - // in the CommonPrefixes collection. These rolled-up keys are not returned elsewhere - // in the response. Each rolled-up result counts as only one return against - // the MaxKeys value. - Delimiter *string `type:"string"` - - // Encoding type used by Amazon S3 to encode object key names in the XML response. - // - // If you specify the encoding-type request parameter, Amazon S3 includes this - // element in the response, and returns encoded key name values in the following - // response elements: - // - // Delimiter, Prefix, Key, and StartAfter. - EncodingType *string `type:"string" enum:"EncodingType"` - - // Set to false if all of the results were returned. Set to true if more keys - // are available to return. If the number of results exceeds that specified - // by MaxKeys, all of the results might not be returned. - IsTruncated *bool `type:"boolean"` - - // KeyCount is the number of keys returned with this request. KeyCount will - // always be less than or equals to MaxKeys field. Say you ask for 50 keys, - // your result will include less than equals 50 keys - KeyCount *int64 `type:"integer"` - - // Sets the maximum number of keys returned in the response. By default the - // action returns up to 1,000 key names. The response might contain fewer keys - // but will never contain more. - MaxKeys *int64 `type:"integer"` - - // The bucket name. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - Name *string `type:"string"` - - // NextContinuationToken is sent when isTruncated is true, which means there - // are more keys in the bucket that can be listed. The next list requests to - // Amazon S3 can be continued with this NextContinuationToken. NextContinuationToken - // is obfuscated and is not a real key - NextContinuationToken *string `type:"string"` - - // Keys that begin with the indicated prefix. - Prefix *string `type:"string"` - - // If StartAfter was sent with the request, it is included in the response. - StartAfter *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListObjectsV2Output) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListObjectsV2Output) GoString() string { - return s.String() -} - -// SetCommonPrefixes sets the CommonPrefixes field's value. -func (s *ListObjectsV2Output) SetCommonPrefixes(v []*CommonPrefix) *ListObjectsV2Output { - s.CommonPrefixes = v - return s -} - -// SetContents sets the Contents field's value. -func (s *ListObjectsV2Output) SetContents(v []*Object) *ListObjectsV2Output { - s.Contents = v - return s -} - -// SetContinuationToken sets the ContinuationToken field's value. -func (s *ListObjectsV2Output) SetContinuationToken(v string) *ListObjectsV2Output { - s.ContinuationToken = &v - return s -} - -// SetDelimiter sets the Delimiter field's value. -func (s *ListObjectsV2Output) SetDelimiter(v string) *ListObjectsV2Output { - s.Delimiter = &v - return s -} - -// SetEncodingType sets the EncodingType field's value. -func (s *ListObjectsV2Output) SetEncodingType(v string) *ListObjectsV2Output { - s.EncodingType = &v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListObjectsV2Output) SetIsTruncated(v bool) *ListObjectsV2Output { - s.IsTruncated = &v - return s -} - -// SetKeyCount sets the KeyCount field's value. -func (s *ListObjectsV2Output) SetKeyCount(v int64) *ListObjectsV2Output { - s.KeyCount = &v - return s -} - -// SetMaxKeys sets the MaxKeys field's value. -func (s *ListObjectsV2Output) SetMaxKeys(v int64) *ListObjectsV2Output { - s.MaxKeys = &v - return s -} - -// SetName sets the Name field's value. -func (s *ListObjectsV2Output) SetName(v string) *ListObjectsV2Output { - s.Name = &v - return s -} - -// SetNextContinuationToken sets the NextContinuationToken field's value. -func (s *ListObjectsV2Output) SetNextContinuationToken(v string) *ListObjectsV2Output { - s.NextContinuationToken = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ListObjectsV2Output) SetPrefix(v string) *ListObjectsV2Output { - s.Prefix = &v - return s -} - -// SetStartAfter sets the StartAfter field's value. -func (s *ListObjectsV2Output) SetStartAfter(v string) *ListObjectsV2Output { - s.StartAfter = &v - return s -} - -type ListPartsInput struct { - _ struct{} `locationName:"ListPartsRequest" type:"structure"` - - // The name of the bucket to which the parts are being uploaded. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Object key for which the multipart upload was initiated. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Sets the maximum number of parts to return. - MaxParts *int64 `location:"querystring" locationName:"max-parts" type:"integer"` - - // Specifies the part after which listing should begin. Only parts with higher - // part numbers will be listed. - PartNumberMarker *int64 `location:"querystring" locationName:"part-number-marker" type:"integer"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // The server-side encryption (SSE) algorithm used to encrypt the object. This - // parameter is needed only when the object was created using a checksum algorithm. - // For more information, see Protecting data using SSE-C keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) - // in the Amazon S3 User Guide. - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // The server-side encryption (SSE) customer managed key. This parameter is - // needed only when the object was created using a checksum algorithm. For more - // information, see Protecting data using SSE-C keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) - // in the Amazon S3 User Guide. - // - // SSECustomerKey is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ListPartsInput's - // String and GoString methods. - SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` - - // The MD5 server-side encryption (SSE) customer managed key. This parameter - // is needed only when the object was created using a checksum algorithm. For - // more information, see Protecting data using SSE-C keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) - // in the Amazon S3 User Guide. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // Upload ID identifying the multipart upload whose parts are being listed. - // - // UploadId is a required field - UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListPartsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListPartsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ListPartsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ListPartsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *ListPartsInput) SetBucket(v string) *ListPartsInput { - s.Bucket = &v - return s -} - -func (s *ListPartsInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *ListPartsInput) SetExpectedBucketOwner(v string) *ListPartsInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetKey sets the Key field's value. -func (s *ListPartsInput) SetKey(v string) *ListPartsInput { - s.Key = &v - return s -} - -// SetMaxParts sets the MaxParts field's value. -func (s *ListPartsInput) SetMaxParts(v int64) *ListPartsInput { - s.MaxParts = &v - return s -} - -// SetPartNumberMarker sets the PartNumberMarker field's value. -func (s *ListPartsInput) SetPartNumberMarker(v int64) *ListPartsInput { - s.PartNumberMarker = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *ListPartsInput) SetRequestPayer(v string) *ListPartsInput { - s.RequestPayer = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *ListPartsInput) SetSSECustomerAlgorithm(v string) *ListPartsInput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKey sets the SSECustomerKey field's value. -func (s *ListPartsInput) SetSSECustomerKey(v string) *ListPartsInput { - s.SSECustomerKey = &v - return s -} - -func (s *ListPartsInput) getSSECustomerKey() (v string) { - if s.SSECustomerKey == nil { - return v - } - return *s.SSECustomerKey -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *ListPartsInput) SetSSECustomerKeyMD5(v string) *ListPartsInput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *ListPartsInput) SetUploadId(v string) *ListPartsInput { - s.UploadId = &v - return s -} - -func (s *ListPartsInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *ListPartsInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s ListPartsInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type ListPartsOutput struct { - _ struct{} `type:"structure"` - - // If the bucket has a lifecycle rule configured with an action to abort incomplete - // multipart uploads and the prefix in the lifecycle rule matches the object - // name in the request, then the response includes this header indicating when - // the initiated multipart upload will become eligible for abort operation. - // For more information, see Aborting Incomplete Multipart Uploads Using a Bucket - // Lifecycle Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config). - // - // The response will also include the x-amz-abort-rule-id header that will provide - // the ID of the lifecycle configuration rule that defines this action. - AbortDate *time.Time `location:"header" locationName:"x-amz-abort-date" type:"timestamp"` - - // This header is returned along with the x-amz-abort-date header. It identifies - // applicable lifecycle configuration rule that defines the action to abort - // incomplete multipart uploads. - AbortRuleId *string `location:"header" locationName:"x-amz-abort-rule-id" type:"string"` - - // The name of the bucket to which the multipart upload was initiated. Does - // not return the access point ARN or access point alias if used. - Bucket *string `type:"string"` - - // The algorithm that was used to create a checksum of the object. - ChecksumAlgorithm *string `type:"string" enum:"ChecksumAlgorithm"` - - // Container element that identifies who initiated the multipart upload. If - // the initiator is an Amazon Web Services account, this element provides the - // same information as the Owner element. If the initiator is an IAM User, this - // element provides the user ARN and display name. - Initiator *Initiator `type:"structure"` - - // Indicates whether the returned list of parts is truncated. A true value indicates - // that the list was truncated. A list can be truncated if the number of parts - // exceeds the limit returned in the MaxParts element. - IsTruncated *bool `type:"boolean"` - - // Object key for which the multipart upload was initiated. - Key *string `min:"1" type:"string"` - - // Maximum number of parts that were allowed in the response. - MaxParts *int64 `type:"integer"` - - // When a list is truncated, this element specifies the last part in the list, - // as well as the value to use for the part-number-marker request parameter - // in a subsequent request. - NextPartNumberMarker *int64 `type:"integer"` - - // Container element that identifies the object owner, after the object is created. - // If multipart upload is initiated by an IAM user, this element provides the - // parent account ID and display name. - Owner *Owner `type:"structure"` - - // When a list is truncated, this element specifies the last part in the list, - // as well as the value to use for the part-number-marker request parameter - // in a subsequent request. - PartNumberMarker *int64 `type:"integer"` - - // Container for elements related to a particular part. A response can contain - // zero or more Part elements. - Parts []*Part `locationName:"Part" type:"list" flattened:"true"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // Class of storage (STANDARD or REDUCED_REDUNDANCY) used to store the uploaded - // object. - StorageClass *string `type:"string" enum:"StorageClass"` - - // Upload ID identifying the multipart upload whose parts are being listed. - UploadId *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListPartsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ListPartsOutput) GoString() string { - return s.String() -} - -// SetAbortDate sets the AbortDate field's value. -func (s *ListPartsOutput) SetAbortDate(v time.Time) *ListPartsOutput { - s.AbortDate = &v - return s -} - -// SetAbortRuleId sets the AbortRuleId field's value. -func (s *ListPartsOutput) SetAbortRuleId(v string) *ListPartsOutput { - s.AbortRuleId = &v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *ListPartsOutput) SetBucket(v string) *ListPartsOutput { - s.Bucket = &v - return s -} - -func (s *ListPartsOutput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *ListPartsOutput) SetChecksumAlgorithm(v string) *ListPartsOutput { - s.ChecksumAlgorithm = &v - return s -} - -// SetInitiator sets the Initiator field's value. -func (s *ListPartsOutput) SetInitiator(v *Initiator) *ListPartsOutput { - s.Initiator = v - return s -} - -// SetIsTruncated sets the IsTruncated field's value. -func (s *ListPartsOutput) SetIsTruncated(v bool) *ListPartsOutput { - s.IsTruncated = &v - return s -} - -// SetKey sets the Key field's value. -func (s *ListPartsOutput) SetKey(v string) *ListPartsOutput { - s.Key = &v - return s -} - -// SetMaxParts sets the MaxParts field's value. -func (s *ListPartsOutput) SetMaxParts(v int64) *ListPartsOutput { - s.MaxParts = &v - return s -} - -// SetNextPartNumberMarker sets the NextPartNumberMarker field's value. -func (s *ListPartsOutput) SetNextPartNumberMarker(v int64) *ListPartsOutput { - s.NextPartNumberMarker = &v - return s -} - -// SetOwner sets the Owner field's value. -func (s *ListPartsOutput) SetOwner(v *Owner) *ListPartsOutput { - s.Owner = v - return s -} - -// SetPartNumberMarker sets the PartNumberMarker field's value. -func (s *ListPartsOutput) SetPartNumberMarker(v int64) *ListPartsOutput { - s.PartNumberMarker = &v - return s -} - -// SetParts sets the Parts field's value. -func (s *ListPartsOutput) SetParts(v []*Part) *ListPartsOutput { - s.Parts = v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *ListPartsOutput) SetRequestCharged(v string) *ListPartsOutput { - s.RequestCharged = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *ListPartsOutput) SetStorageClass(v string) *ListPartsOutput { - s.StorageClass = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *ListPartsOutput) SetUploadId(v string) *ListPartsOutput { - s.UploadId = &v - return s -} - -// Describes an Amazon S3 location that will receive the results of the restore -// request. -type Location struct { - _ struct{} `type:"structure"` - - // A list of grants that control access to the staged results. - AccessControlList []*Grant `locationNameList:"Grant" type:"list"` - - // The name of the bucket where the restore results will be placed. - // - // BucketName is a required field - BucketName *string `type:"string" required:"true"` - - // The canned ACL to apply to the restore results. - CannedACL *string `type:"string" enum:"ObjectCannedACL"` - - // Contains the type of server-side encryption used. - Encryption *Encryption `type:"structure"` - - // The prefix that is prepended to the restore results for this request. - // - // Prefix is a required field - Prefix *string `type:"string" required:"true"` - - // The class of storage used to store the restore results. - StorageClass *string `type:"string" enum:"StorageClass"` - - // The tag-set that is applied to the restore results. - Tagging *Tagging `type:"structure"` - - // A list of metadata to store with the restore results in S3. - UserMetadata []*MetadataEntry `locationNameList:"MetadataEntry" type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Location) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Location) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Location) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Location"} - if s.BucketName == nil { - invalidParams.Add(request.NewErrParamRequired("BucketName")) - } - if s.Prefix == nil { - invalidParams.Add(request.NewErrParamRequired("Prefix")) - } - if s.AccessControlList != nil { - for i, v := range s.AccessControlList { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "AccessControlList", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Encryption != nil { - if err := s.Encryption.Validate(); err != nil { - invalidParams.AddNested("Encryption", err.(request.ErrInvalidParams)) - } - } - if s.Tagging != nil { - if err := s.Tagging.Validate(); err != nil { - invalidParams.AddNested("Tagging", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessControlList sets the AccessControlList field's value. -func (s *Location) SetAccessControlList(v []*Grant) *Location { - s.AccessControlList = v - return s -} - -// SetBucketName sets the BucketName field's value. -func (s *Location) SetBucketName(v string) *Location { - s.BucketName = &v - return s -} - -// SetCannedACL sets the CannedACL field's value. -func (s *Location) SetCannedACL(v string) *Location { - s.CannedACL = &v - return s -} - -// SetEncryption sets the Encryption field's value. -func (s *Location) SetEncryption(v *Encryption) *Location { - s.Encryption = v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *Location) SetPrefix(v string) *Location { - s.Prefix = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *Location) SetStorageClass(v string) *Location { - s.StorageClass = &v - return s -} - -// SetTagging sets the Tagging field's value. -func (s *Location) SetTagging(v *Tagging) *Location { - s.Tagging = v - return s -} - -// SetUserMetadata sets the UserMetadata field's value. -func (s *Location) SetUserMetadata(v []*MetadataEntry) *Location { - s.UserMetadata = v - return s -} - -// Describes where logs are stored and the prefix that Amazon S3 assigns to -// all log object keys for a bucket. For more information, see PUT Bucket logging -// (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlogging.html) -// in the Amazon S3 API Reference. -type LoggingEnabled struct { - _ struct{} `type:"structure"` - - // Specifies the bucket where you want Amazon S3 to store server access logs. - // You can have your logs delivered to any bucket that you own, including the - // same bucket that is being logged. You can also configure multiple buckets - // to deliver their logs to the same target bucket. In this case, you should - // choose a different TargetPrefix for each source bucket so that the delivered - // log files can be distinguished by key. - // - // TargetBucket is a required field - TargetBucket *string `type:"string" required:"true"` - - // Container for granting information. - // - // Buckets that use the bucket owner enforced setting for Object Ownership don't - // support target grants. For more information, see Permissions for server access - // log delivery (https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html#grant-log-delivery-permissions-general) - // in the Amazon S3 User Guide. - TargetGrants []*TargetGrant `locationNameList:"Grant" type:"list"` - - // A prefix for all log object keys. If you store log files from multiple Amazon - // S3 buckets in a single bucket, you can use a prefix to distinguish which - // log files came from which bucket. - // - // TargetPrefix is a required field - TargetPrefix *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LoggingEnabled) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s LoggingEnabled) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *LoggingEnabled) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "LoggingEnabled"} - if s.TargetBucket == nil { - invalidParams.Add(request.NewErrParamRequired("TargetBucket")) - } - if s.TargetPrefix == nil { - invalidParams.Add(request.NewErrParamRequired("TargetPrefix")) - } - if s.TargetGrants != nil { - for i, v := range s.TargetGrants { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TargetGrants", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTargetBucket sets the TargetBucket field's value. -func (s *LoggingEnabled) SetTargetBucket(v string) *LoggingEnabled { - s.TargetBucket = &v - return s -} - -// SetTargetGrants sets the TargetGrants field's value. -func (s *LoggingEnabled) SetTargetGrants(v []*TargetGrant) *LoggingEnabled { - s.TargetGrants = v - return s -} - -// SetTargetPrefix sets the TargetPrefix field's value. -func (s *LoggingEnabled) SetTargetPrefix(v string) *LoggingEnabled { - s.TargetPrefix = &v - return s -} - -// A metadata key-value pair to store with an object. -type MetadataEntry struct { - _ struct{} `type:"structure"` - - // Name of the Object. - Name *string `type:"string"` - - // Value of the Object. - Value *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MetadataEntry) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MetadataEntry) GoString() string { - return s.String() -} - -// SetName sets the Name field's value. -func (s *MetadataEntry) SetName(v string) *MetadataEntry { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *MetadataEntry) SetValue(v string) *MetadataEntry { - s.Value = &v - return s -} - -// A container specifying replication metrics-related settings enabling replication -// metrics and events. -type Metrics struct { - _ struct{} `type:"structure"` - - // A container specifying the time threshold for emitting the s3:Replication:OperationMissedThreshold - // event. - EventThreshold *ReplicationTimeValue `type:"structure"` - - // Specifies whether the replication metrics are enabled. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"MetricsStatus"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Metrics) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Metrics) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Metrics) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Metrics"} - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEventThreshold sets the EventThreshold field's value. -func (s *Metrics) SetEventThreshold(v *ReplicationTimeValue) *Metrics { - s.EventThreshold = v - return s -} - -// SetStatus sets the Status field's value. -func (s *Metrics) SetStatus(v string) *Metrics { - s.Status = &v - return s -} - -// A conjunction (logical AND) of predicates, which is used in evaluating a -// metrics filter. The operator must have at least two predicates, and an object -// must match all of the predicates in order for the filter to apply. -type MetricsAndOperator struct { - _ struct{} `type:"structure"` - - // The access point ARN used when evaluating an AND predicate. - AccessPointArn *string `type:"string"` - - // The prefix used when evaluating an AND predicate. - Prefix *string `type:"string"` - - // The list of tags used when evaluating an AND predicate. - Tags []*Tag `locationName:"Tag" locationNameList:"Tag" type:"list" flattened:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MetricsAndOperator) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MetricsAndOperator) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MetricsAndOperator) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MetricsAndOperator"} - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessPointArn sets the AccessPointArn field's value. -func (s *MetricsAndOperator) SetAccessPointArn(v string) *MetricsAndOperator { - s.AccessPointArn = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *MetricsAndOperator) SetPrefix(v string) *MetricsAndOperator { - s.Prefix = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *MetricsAndOperator) SetTags(v []*Tag) *MetricsAndOperator { - s.Tags = v - return s -} - -// Specifies a metrics configuration for the CloudWatch request metrics (specified -// by the metrics configuration ID) from an Amazon S3 bucket. If you're updating -// an existing metrics configuration, note that this is a full replacement of -// the existing metrics configuration. If you don't include the elements you -// want to keep, they are erased. For more information, see PutBucketMetricsConfiguration -// (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTMetricConfiguration.html). -type MetricsConfiguration struct { - _ struct{} `type:"structure"` - - // Specifies a metrics configuration filter. The metrics configuration will - // only include objects that meet the filter's criteria. A filter must be a - // prefix, an object tag, an access point ARN, or a conjunction (MetricsAndOperator). - Filter *MetricsFilter `type:"structure"` - - // The ID used to identify the metrics configuration. - // - // Id is a required field - Id *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MetricsConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MetricsConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MetricsConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MetricsConfiguration"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFilter sets the Filter field's value. -func (s *MetricsConfiguration) SetFilter(v *MetricsFilter) *MetricsConfiguration { - s.Filter = v - return s -} - -// SetId sets the Id field's value. -func (s *MetricsConfiguration) SetId(v string) *MetricsConfiguration { - s.Id = &v - return s -} - -// Specifies a metrics configuration filter. The metrics configuration only -// includes objects that meet the filter's criteria. A filter must be a prefix, -// an object tag, an access point ARN, or a conjunction (MetricsAndOperator). -// For more information, see PutBucketMetricsConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketMetricsConfiguration.html). -type MetricsFilter struct { - _ struct{} `type:"structure"` - - // The access point ARN used when evaluating a metrics filter. - AccessPointArn *string `type:"string"` - - // A conjunction (logical AND) of predicates, which is used in evaluating a - // metrics filter. The operator must have at least two predicates, and an object - // must match all of the predicates in order for the filter to apply. - And *MetricsAndOperator `type:"structure"` - - // The prefix used when evaluating a metrics filter. - Prefix *string `type:"string"` - - // The tag used when evaluating a metrics filter. - Tag *Tag `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MetricsFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MetricsFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *MetricsFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "MetricsFilter"} - if s.And != nil { - if err := s.And.Validate(); err != nil { - invalidParams.AddNested("And", err.(request.ErrInvalidParams)) - } - } - if s.Tag != nil { - if err := s.Tag.Validate(); err != nil { - invalidParams.AddNested("Tag", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessPointArn sets the AccessPointArn field's value. -func (s *MetricsFilter) SetAccessPointArn(v string) *MetricsFilter { - s.AccessPointArn = &v - return s -} - -// SetAnd sets the And field's value. -func (s *MetricsFilter) SetAnd(v *MetricsAndOperator) *MetricsFilter { - s.And = v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *MetricsFilter) SetPrefix(v string) *MetricsFilter { - s.Prefix = &v - return s -} - -// SetTag sets the Tag field's value. -func (s *MetricsFilter) SetTag(v *Tag) *MetricsFilter { - s.Tag = v - return s -} - -// Container for the MultipartUpload for the Amazon S3 object. -type MultipartUpload struct { - _ struct{} `type:"structure"` - - // The algorithm that was used to create a checksum of the object. - ChecksumAlgorithm *string `type:"string" enum:"ChecksumAlgorithm"` - - // Date and time at which the multipart upload was initiated. - Initiated *time.Time `type:"timestamp"` - - // Identifies who initiated the multipart upload. - Initiator *Initiator `type:"structure"` - - // Key of the object for which the multipart upload was initiated. - Key *string `min:"1" type:"string"` - - // Specifies the owner of the object that is part of the multipart upload. - Owner *Owner `type:"structure"` - - // The class of storage used to store the object. - StorageClass *string `type:"string" enum:"StorageClass"` - - // Upload ID that identifies the multipart upload. - UploadId *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MultipartUpload) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s MultipartUpload) GoString() string { - return s.String() -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *MultipartUpload) SetChecksumAlgorithm(v string) *MultipartUpload { - s.ChecksumAlgorithm = &v - return s -} - -// SetInitiated sets the Initiated field's value. -func (s *MultipartUpload) SetInitiated(v time.Time) *MultipartUpload { - s.Initiated = &v - return s -} - -// SetInitiator sets the Initiator field's value. -func (s *MultipartUpload) SetInitiator(v *Initiator) *MultipartUpload { - s.Initiator = v - return s -} - -// SetKey sets the Key field's value. -func (s *MultipartUpload) SetKey(v string) *MultipartUpload { - s.Key = &v - return s -} - -// SetOwner sets the Owner field's value. -func (s *MultipartUpload) SetOwner(v *Owner) *MultipartUpload { - s.Owner = v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *MultipartUpload) SetStorageClass(v string) *MultipartUpload { - s.StorageClass = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *MultipartUpload) SetUploadId(v string) *MultipartUpload { - s.UploadId = &v - return s -} - -// Specifies when noncurrent object versions expire. Upon expiration, Amazon -// S3 permanently deletes the noncurrent object versions. You set this lifecycle -// configuration action on a bucket that has versioning enabled (or suspended) -// to request that Amazon S3 delete noncurrent object versions at a specific -// period in the object's lifetime. -type NoncurrentVersionExpiration struct { - _ struct{} `type:"structure"` - - // Specifies how many noncurrent versions Amazon S3 will retain. If there are - // this many more recent noncurrent versions, Amazon S3 will take the associated - // action. For more information about noncurrent versions, see Lifecycle configuration - // elements (https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html) - // in the Amazon S3 User Guide. - NewerNoncurrentVersions *int64 `type:"integer"` - - // Specifies the number of days an object is noncurrent before Amazon S3 can - // perform the associated action. The value must be a non-zero positive integer. - // For information about the noncurrent days calculations, see How Amazon S3 - // Calculates When an Object Became Noncurrent (https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations) - // in the Amazon S3 User Guide. - NoncurrentDays *int64 `type:"integer"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s NoncurrentVersionExpiration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s NoncurrentVersionExpiration) GoString() string { - return s.String() -} - -// SetNewerNoncurrentVersions sets the NewerNoncurrentVersions field's value. -func (s *NoncurrentVersionExpiration) SetNewerNoncurrentVersions(v int64) *NoncurrentVersionExpiration { - s.NewerNoncurrentVersions = &v - return s -} - -// SetNoncurrentDays sets the NoncurrentDays field's value. -func (s *NoncurrentVersionExpiration) SetNoncurrentDays(v int64) *NoncurrentVersionExpiration { - s.NoncurrentDays = &v - return s -} - -// Container for the transition rule that describes when noncurrent objects -// transition to the STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER_IR, -// GLACIER, or DEEP_ARCHIVE storage class. If your bucket is versioning-enabled -// (or versioning is suspended), you can set this action to request that Amazon -// S3 transition noncurrent object versions to the STANDARD_IA, ONEZONE_IA, -// INTELLIGENT_TIERING, GLACIER_IR, GLACIER, or DEEP_ARCHIVE storage class at -// a specific period in the object's lifetime. -type NoncurrentVersionTransition struct { - _ struct{} `type:"structure"` - - // Specifies how many noncurrent versions Amazon S3 will retain. If there are - // this many more recent noncurrent versions, Amazon S3 will take the associated - // action. For more information about noncurrent versions, see Lifecycle configuration - // elements (https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html) - // in the Amazon S3 User Guide. - NewerNoncurrentVersions *int64 `type:"integer"` - - // Specifies the number of days an object is noncurrent before Amazon S3 can - // perform the associated action. For information about the noncurrent days - // calculations, see How Amazon S3 Calculates How Long an Object Has Been Noncurrent - // (https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations) - // in the Amazon S3 User Guide. - NoncurrentDays *int64 `type:"integer"` - - // The class of storage used to store the object. - StorageClass *string `type:"string" enum:"TransitionStorageClass"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s NoncurrentVersionTransition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s NoncurrentVersionTransition) GoString() string { - return s.String() -} - -// SetNewerNoncurrentVersions sets the NewerNoncurrentVersions field's value. -func (s *NoncurrentVersionTransition) SetNewerNoncurrentVersions(v int64) *NoncurrentVersionTransition { - s.NewerNoncurrentVersions = &v - return s -} - -// SetNoncurrentDays sets the NoncurrentDays field's value. -func (s *NoncurrentVersionTransition) SetNoncurrentDays(v int64) *NoncurrentVersionTransition { - s.NoncurrentDays = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *NoncurrentVersionTransition) SetStorageClass(v string) *NoncurrentVersionTransition { - s.StorageClass = &v - return s -} - -// A container for specifying the notification configuration of the bucket. -// If this element is empty, notifications are turned off for the bucket. -type NotificationConfiguration struct { - _ struct{} `type:"structure"` - - // Enables delivery of events to Amazon EventBridge. - EventBridgeConfiguration *EventBridgeConfiguration `type:"structure"` - - // Describes the Lambda functions to invoke and the events for which to invoke - // them. - LambdaFunctionConfigurations []*LambdaFunctionConfiguration `locationName:"CloudFunctionConfiguration" type:"list" flattened:"true"` - - // The Amazon Simple Queue Service queues to publish messages to and the events - // for which to publish messages. - QueueConfigurations []*QueueConfiguration `locationName:"QueueConfiguration" type:"list" flattened:"true"` - - // The topic to which notifications are sent and the events for which notifications - // are generated. - TopicConfigurations []*TopicConfiguration `locationName:"TopicConfiguration" type:"list" flattened:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s NotificationConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s NotificationConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *NotificationConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "NotificationConfiguration"} - if s.LambdaFunctionConfigurations != nil { - for i, v := range s.LambdaFunctionConfigurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "LambdaFunctionConfigurations", i), err.(request.ErrInvalidParams)) - } - } - } - if s.QueueConfigurations != nil { - for i, v := range s.QueueConfigurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "QueueConfigurations", i), err.(request.ErrInvalidParams)) - } - } - } - if s.TopicConfigurations != nil { - for i, v := range s.TopicConfigurations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TopicConfigurations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEventBridgeConfiguration sets the EventBridgeConfiguration field's value. -func (s *NotificationConfiguration) SetEventBridgeConfiguration(v *EventBridgeConfiguration) *NotificationConfiguration { - s.EventBridgeConfiguration = v - return s -} - -// SetLambdaFunctionConfigurations sets the LambdaFunctionConfigurations field's value. -func (s *NotificationConfiguration) SetLambdaFunctionConfigurations(v []*LambdaFunctionConfiguration) *NotificationConfiguration { - s.LambdaFunctionConfigurations = v - return s -} - -// SetQueueConfigurations sets the QueueConfigurations field's value. -func (s *NotificationConfiguration) SetQueueConfigurations(v []*QueueConfiguration) *NotificationConfiguration { - s.QueueConfigurations = v - return s -} - -// SetTopicConfigurations sets the TopicConfigurations field's value. -func (s *NotificationConfiguration) SetTopicConfigurations(v []*TopicConfiguration) *NotificationConfiguration { - s.TopicConfigurations = v - return s -} - -type NotificationConfigurationDeprecated struct { - _ struct{} `type:"structure"` - - // Container for specifying the Lambda notification configuration. - CloudFunctionConfiguration *CloudFunctionConfiguration `type:"structure"` - - // This data type is deprecated. This data type specifies the configuration - // for publishing messages to an Amazon Simple Queue Service (Amazon SQS) queue - // when Amazon S3 detects specified events. - QueueConfiguration *QueueConfigurationDeprecated `type:"structure"` - - // This data type is deprecated. A container for specifying the configuration - // for publication of messages to an Amazon Simple Notification Service (Amazon - // SNS) topic when Amazon S3 detects specified events. - TopicConfiguration *TopicConfigurationDeprecated `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s NotificationConfigurationDeprecated) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s NotificationConfigurationDeprecated) GoString() string { - return s.String() -} - -// SetCloudFunctionConfiguration sets the CloudFunctionConfiguration field's value. -func (s *NotificationConfigurationDeprecated) SetCloudFunctionConfiguration(v *CloudFunctionConfiguration) *NotificationConfigurationDeprecated { - s.CloudFunctionConfiguration = v - return s -} - -// SetQueueConfiguration sets the QueueConfiguration field's value. -func (s *NotificationConfigurationDeprecated) SetQueueConfiguration(v *QueueConfigurationDeprecated) *NotificationConfigurationDeprecated { - s.QueueConfiguration = v - return s -} - -// SetTopicConfiguration sets the TopicConfiguration field's value. -func (s *NotificationConfigurationDeprecated) SetTopicConfiguration(v *TopicConfigurationDeprecated) *NotificationConfigurationDeprecated { - s.TopicConfiguration = v - return s -} - -// Specifies object key name filtering rules. For information about key name -// filtering, see Configuring Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) -// in the Amazon S3 User Guide. -type NotificationConfigurationFilter struct { - _ struct{} `type:"structure"` - - // A container for object key name prefix and suffix filtering rules. - Key *KeyFilter `locationName:"S3Key" type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s NotificationConfigurationFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s NotificationConfigurationFilter) GoString() string { - return s.String() -} - -// SetKey sets the Key field's value. -func (s *NotificationConfigurationFilter) SetKey(v *KeyFilter) *NotificationConfigurationFilter { - s.Key = v - return s -} - -// An object consists of data and its descriptive metadata. -type Object struct { - _ struct{} `type:"structure"` - - // The algorithm that was used to create a checksum of the object. - ChecksumAlgorithm []*string `type:"list" flattened:"true" enum:"ChecksumAlgorithm"` - - // The entity tag is a hash of the object. The ETag reflects changes only to - // the contents of an object, not its metadata. The ETag may or may not be an - // MD5 digest of the object data. Whether or not it is depends on how the object - // was created and how it is encrypted as described below: - // - // * Objects created by the PUT Object, POST Object, or Copy operation, or - // through the Amazon Web Services Management Console, and are encrypted - // by SSE-S3 or plaintext, have ETags that are an MD5 digest of their object - // data. - // - // * Objects created by the PUT Object, POST Object, or Copy operation, or - // through the Amazon Web Services Management Console, and are encrypted - // by SSE-C or SSE-KMS, have ETags that are not an MD5 digest of their object - // data. - // - // * If an object is created by either the Multipart Upload or Part Copy - // operation, the ETag is not an MD5 digest, regardless of the method of - // encryption. If an object is larger than 16 MB, the Amazon Web Services - // Management Console will upload or copy that object as a Multipart Upload, - // and therefore the ETag will not be an MD5 digest. - ETag *string `type:"string"` - - // The name that you assign to an object. You use the object key to retrieve - // the object. - Key *string `min:"1" type:"string"` - - // Creation date of the object. - LastModified *time.Time `type:"timestamp"` - - // The owner of the object - Owner *Owner `type:"structure"` - - // Size in bytes of the object - Size *int64 `type:"integer"` - - // The class of storage used to store the object. - StorageClass *string `type:"string" enum:"ObjectStorageClass"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Object) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Object) GoString() string { - return s.String() -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *Object) SetChecksumAlgorithm(v []*string) *Object { - s.ChecksumAlgorithm = v - return s -} - -// SetETag sets the ETag field's value. -func (s *Object) SetETag(v string) *Object { - s.ETag = &v - return s -} - -// SetKey sets the Key field's value. -func (s *Object) SetKey(v string) *Object { - s.Key = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *Object) SetLastModified(v time.Time) *Object { - s.LastModified = &v - return s -} - -// SetOwner sets the Owner field's value. -func (s *Object) SetOwner(v *Owner) *Object { - s.Owner = v - return s -} - -// SetSize sets the Size field's value. -func (s *Object) SetSize(v int64) *Object { - s.Size = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *Object) SetStorageClass(v string) *Object { - s.StorageClass = &v - return s -} - -// Object Identifier is unique value to identify objects. -type ObjectIdentifier struct { - _ struct{} `type:"structure"` - - // Key name of the object. - // - // Replacement must be made for object keys containing special characters (such - // as carriage returns) when using XML requests. For more information, see XML - // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // VersionId for the specific version of the object to delete. - VersionId *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ObjectIdentifier) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ObjectIdentifier) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ObjectIdentifier) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ObjectIdentifier"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *ObjectIdentifier) SetKey(v string) *ObjectIdentifier { - s.Key = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *ObjectIdentifier) SetVersionId(v string) *ObjectIdentifier { - s.VersionId = &v - return s -} - -// The container element for Object Lock configuration parameters. -type ObjectLockConfiguration struct { - _ struct{} `type:"structure"` - - // Indicates whether this bucket has an Object Lock configuration enabled. Enable - // ObjectLockEnabled when you apply ObjectLockConfiguration to a bucket. - ObjectLockEnabled *string `type:"string" enum:"ObjectLockEnabled"` - - // Specifies the Object Lock rule for the specified object. Enable the this - // rule when you apply ObjectLockConfiguration to a bucket. Bucket settings - // require both a mode and a period. The period can be either Days or Years - // but you must select one. You cannot specify Days and Years at the same time. - Rule *ObjectLockRule `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ObjectLockConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ObjectLockConfiguration) GoString() string { - return s.String() -} - -// SetObjectLockEnabled sets the ObjectLockEnabled field's value. -func (s *ObjectLockConfiguration) SetObjectLockEnabled(v string) *ObjectLockConfiguration { - s.ObjectLockEnabled = &v - return s -} - -// SetRule sets the Rule field's value. -func (s *ObjectLockConfiguration) SetRule(v *ObjectLockRule) *ObjectLockConfiguration { - s.Rule = v - return s -} - -// A legal hold configuration for an object. -type ObjectLockLegalHold struct { - _ struct{} `type:"structure"` - - // Indicates whether the specified object has a legal hold in place. - Status *string `type:"string" enum:"ObjectLockLegalHoldStatus"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ObjectLockLegalHold) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ObjectLockLegalHold) GoString() string { - return s.String() -} - -// SetStatus sets the Status field's value. -func (s *ObjectLockLegalHold) SetStatus(v string) *ObjectLockLegalHold { - s.Status = &v - return s -} - -// A Retention configuration for an object. -type ObjectLockRetention struct { - _ struct{} `type:"structure"` - - // Indicates the Retention mode for the specified object. - Mode *string `type:"string" enum:"ObjectLockRetentionMode"` - - // The date on which this Object Lock Retention will expire. - RetainUntilDate *time.Time `type:"timestamp" timestampFormat:"iso8601"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ObjectLockRetention) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ObjectLockRetention) GoString() string { - return s.String() -} - -// SetMode sets the Mode field's value. -func (s *ObjectLockRetention) SetMode(v string) *ObjectLockRetention { - s.Mode = &v - return s -} - -// SetRetainUntilDate sets the RetainUntilDate field's value. -func (s *ObjectLockRetention) SetRetainUntilDate(v time.Time) *ObjectLockRetention { - s.RetainUntilDate = &v - return s -} - -// The container element for an Object Lock rule. -type ObjectLockRule struct { - _ struct{} `type:"structure"` - - // The default Object Lock retention mode and period that you want to apply - // to new objects placed in the specified bucket. Bucket settings require both - // a mode and a period. The period can be either Days or Years but you must - // select one. You cannot specify Days and Years at the same time. - DefaultRetention *DefaultRetention `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ObjectLockRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ObjectLockRule) GoString() string { - return s.String() -} - -// SetDefaultRetention sets the DefaultRetention field's value. -func (s *ObjectLockRule) SetDefaultRetention(v *DefaultRetention) *ObjectLockRule { - s.DefaultRetention = v - return s -} - -// A container for elements related to an individual part. -type ObjectPart struct { - _ struct{} `type:"structure"` - - // This header can be used as a data integrity check to verify that the data - // received is the same data that was originally sent. This header specifies - // the base64-encoded, 32-bit CRC32 checksum of the object. For more information, - // see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - ChecksumCRC32 *string `type:"string"` - - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumCRC32C *string `type:"string"` - - // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA1 *string `type:"string"` - - // The base64-encoded, 256-bit SHA-256 digest of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA256 *string `type:"string"` - - // The part number identifying the part. This value is a positive integer between - // 1 and 10,000. - PartNumber *int64 `type:"integer"` - - // The size of the uploaded part in bytes. - Size *int64 `type:"integer"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ObjectPart) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ObjectPart) GoString() string { - return s.String() -} - -// SetChecksumCRC32 sets the ChecksumCRC32 field's value. -func (s *ObjectPart) SetChecksumCRC32(v string) *ObjectPart { - s.ChecksumCRC32 = &v - return s -} - -// SetChecksumCRC32C sets the ChecksumCRC32C field's value. -func (s *ObjectPart) SetChecksumCRC32C(v string) *ObjectPart { - s.ChecksumCRC32C = &v - return s -} - -// SetChecksumSHA1 sets the ChecksumSHA1 field's value. -func (s *ObjectPart) SetChecksumSHA1(v string) *ObjectPart { - s.ChecksumSHA1 = &v - return s -} - -// SetChecksumSHA256 sets the ChecksumSHA256 field's value. -func (s *ObjectPart) SetChecksumSHA256(v string) *ObjectPart { - s.ChecksumSHA256 = &v - return s -} - -// SetPartNumber sets the PartNumber field's value. -func (s *ObjectPart) SetPartNumber(v int64) *ObjectPart { - s.PartNumber = &v - return s -} - -// SetSize sets the Size field's value. -func (s *ObjectPart) SetSize(v int64) *ObjectPart { - s.Size = &v - return s -} - -// The version of an object. -type ObjectVersion struct { - _ struct{} `type:"structure"` - - // The algorithm that was used to create a checksum of the object. - ChecksumAlgorithm []*string `type:"list" flattened:"true" enum:"ChecksumAlgorithm"` - - // The entity tag is an MD5 hash of that version of the object. - ETag *string `type:"string"` - - // Specifies whether the object is (true) or is not (false) the latest version - // of an object. - IsLatest *bool `type:"boolean"` - - // The object key. - Key *string `min:"1" type:"string"` - - // Date and time the object was last modified. - LastModified *time.Time `type:"timestamp"` - - // Specifies the owner of the object. - Owner *Owner `type:"structure"` - - // Size in bytes of the object. - Size *int64 `type:"integer"` - - // The class of storage used to store the object. - StorageClass *string `type:"string" enum:"ObjectVersionStorageClass"` - - // Version ID of an object. - VersionId *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ObjectVersion) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ObjectVersion) GoString() string { - return s.String() -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *ObjectVersion) SetChecksumAlgorithm(v []*string) *ObjectVersion { - s.ChecksumAlgorithm = v - return s -} - -// SetETag sets the ETag field's value. -func (s *ObjectVersion) SetETag(v string) *ObjectVersion { - s.ETag = &v - return s -} - -// SetIsLatest sets the IsLatest field's value. -func (s *ObjectVersion) SetIsLatest(v bool) *ObjectVersion { - s.IsLatest = &v - return s -} - -// SetKey sets the Key field's value. -func (s *ObjectVersion) SetKey(v string) *ObjectVersion { - s.Key = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *ObjectVersion) SetLastModified(v time.Time) *ObjectVersion { - s.LastModified = &v - return s -} - -// SetOwner sets the Owner field's value. -func (s *ObjectVersion) SetOwner(v *Owner) *ObjectVersion { - s.Owner = v - return s -} - -// SetSize sets the Size field's value. -func (s *ObjectVersion) SetSize(v int64) *ObjectVersion { - s.Size = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *ObjectVersion) SetStorageClass(v string) *ObjectVersion { - s.StorageClass = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *ObjectVersion) SetVersionId(v string) *ObjectVersion { - s.VersionId = &v - return s -} - -// Describes the location where the restore job's output is stored. -type OutputLocation struct { - _ struct{} `type:"structure"` - - // Describes an S3 location that will receive the results of the restore request. - S3 *Location `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OutputLocation) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OutputLocation) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OutputLocation) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OutputLocation"} - if s.S3 != nil { - if err := s.S3.Validate(); err != nil { - invalidParams.AddNested("S3", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetS3 sets the S3 field's value. -func (s *OutputLocation) SetS3(v *Location) *OutputLocation { - s.S3 = v - return s -} - -// Describes how results of the Select job are serialized. -type OutputSerialization struct { - _ struct{} `type:"structure"` - - // Describes the serialization of CSV-encoded Select results. - CSV *CSVOutput `type:"structure"` - - // Specifies JSON as request's output serialization format. - JSON *JSONOutput `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OutputSerialization) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OutputSerialization) GoString() string { - return s.String() -} - -// SetCSV sets the CSV field's value. -func (s *OutputSerialization) SetCSV(v *CSVOutput) *OutputSerialization { - s.CSV = v - return s -} - -// SetJSON sets the JSON field's value. -func (s *OutputSerialization) SetJSON(v *JSONOutput) *OutputSerialization { - s.JSON = v - return s -} - -// Container for the owner's display name and ID. -type Owner struct { - _ struct{} `type:"structure"` - - // Container for the display name of the owner. - DisplayName *string `type:"string"` - - // Container for the ID of the owner. - ID *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Owner) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Owner) GoString() string { - return s.String() -} - -// SetDisplayName sets the DisplayName field's value. -func (s *Owner) SetDisplayName(v string) *Owner { - s.DisplayName = &v - return s -} - -// SetID sets the ID field's value. -func (s *Owner) SetID(v string) *Owner { - s.ID = &v - return s -} - -// The container element for a bucket's ownership controls. -type OwnershipControls struct { - _ struct{} `type:"structure"` - - // The container element for an ownership control rule. - // - // Rules is a required field - Rules []*OwnershipControlsRule `locationName:"Rule" type:"list" flattened:"true" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OwnershipControls) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OwnershipControls) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OwnershipControls) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OwnershipControls"} - if s.Rules == nil { - invalidParams.Add(request.NewErrParamRequired("Rules")) - } - if s.Rules != nil { - for i, v := range s.Rules { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRules sets the Rules field's value. -func (s *OwnershipControls) SetRules(v []*OwnershipControlsRule) *OwnershipControls { - s.Rules = v - return s -} - -// The container element for an ownership control rule. -type OwnershipControlsRule struct { - _ struct{} `type:"structure"` - - // The container element for object ownership for a bucket's ownership controls. - // - // BucketOwnerPreferred - Objects uploaded to the bucket change ownership to - // the bucket owner if the objects are uploaded with the bucket-owner-full-control - // canned ACL. - // - // ObjectWriter - The uploading account will own the object if the object is - // uploaded with the bucket-owner-full-control canned ACL. - // - // BucketOwnerEnforced - Access control lists (ACLs) are disabled and no longer - // affect permissions. The bucket owner automatically owns and has full control - // over every object in the bucket. The bucket only accepts PUT requests that - // don't specify an ACL or bucket owner full control ACLs, such as the bucket-owner-full-control - // canned ACL or an equivalent form of this ACL expressed in the XML format. - // - // ObjectOwnership is a required field - ObjectOwnership *string `type:"string" required:"true" enum:"ObjectOwnership"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OwnershipControlsRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s OwnershipControlsRule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *OwnershipControlsRule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "OwnershipControlsRule"} - if s.ObjectOwnership == nil { - invalidParams.Add(request.NewErrParamRequired("ObjectOwnership")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetObjectOwnership sets the ObjectOwnership field's value. -func (s *OwnershipControlsRule) SetObjectOwnership(v string) *OwnershipControlsRule { - s.ObjectOwnership = &v - return s -} - -// Container for Parquet. -type ParquetInput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ParquetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ParquetInput) GoString() string { - return s.String() -} - -// Container for elements related to a part. -type Part struct { - _ struct{} `type:"structure"` - - // This header can be used as a data integrity check to verify that the data - // received is the same data that was originally sent. This header specifies - // the base64-encoded, 32-bit CRC32 checksum of the object. For more information, - // see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - ChecksumCRC32 *string `type:"string"` - - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumCRC32C *string `type:"string"` - - // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA1 *string `type:"string"` - - // This header can be used as a data integrity check to verify that the data - // received is the same data that was originally sent. This header specifies - // the base64-encoded, 256-bit SHA-256 digest of the object. For more information, - // see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - ChecksumSHA256 *string `type:"string"` - - // Entity tag returned when the part was uploaded. - ETag *string `type:"string"` - - // Date and time at which the part was uploaded. - LastModified *time.Time `type:"timestamp"` - - // Part number identifying the part. This is a positive integer between 1 and - // 10,000. - PartNumber *int64 `type:"integer"` - - // Size in bytes of the uploaded part data. - Size *int64 `type:"integer"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Part) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Part) GoString() string { - return s.String() -} - -// SetChecksumCRC32 sets the ChecksumCRC32 field's value. -func (s *Part) SetChecksumCRC32(v string) *Part { - s.ChecksumCRC32 = &v - return s -} - -// SetChecksumCRC32C sets the ChecksumCRC32C field's value. -func (s *Part) SetChecksumCRC32C(v string) *Part { - s.ChecksumCRC32C = &v - return s -} - -// SetChecksumSHA1 sets the ChecksumSHA1 field's value. -func (s *Part) SetChecksumSHA1(v string) *Part { - s.ChecksumSHA1 = &v - return s -} - -// SetChecksumSHA256 sets the ChecksumSHA256 field's value. -func (s *Part) SetChecksumSHA256(v string) *Part { - s.ChecksumSHA256 = &v - return s -} - -// SetETag sets the ETag field's value. -func (s *Part) SetETag(v string) *Part { - s.ETag = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *Part) SetLastModified(v time.Time) *Part { - s.LastModified = &v - return s -} - -// SetPartNumber sets the PartNumber field's value. -func (s *Part) SetPartNumber(v int64) *Part { - s.PartNumber = &v - return s -} - -// SetSize sets the Size field's value. -func (s *Part) SetSize(v int64) *Part { - s.Size = &v - return s -} - -// The container element for a bucket's policy status. -type PolicyStatus struct { - _ struct{} `type:"structure"` - - // The policy status for this bucket. TRUE indicates that this bucket is public. - // FALSE indicates that the bucket is not public. - IsPublic *bool `locationName:"IsPublic" type:"boolean"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicyStatus) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PolicyStatus) GoString() string { - return s.String() -} - -// SetIsPublic sets the IsPublic field's value. -func (s *PolicyStatus) SetIsPublic(v bool) *PolicyStatus { - s.IsPublic = &v - return s -} - -// This data type contains information about progress of an operation. -type Progress struct { - _ struct{} `type:"structure"` - - // The current number of uncompressed object bytes processed. - BytesProcessed *int64 `type:"long"` - - // The current number of bytes of records payload data returned. - BytesReturned *int64 `type:"long"` - - // The current number of object bytes scanned. - BytesScanned *int64 `type:"long"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Progress) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Progress) GoString() string { - return s.String() -} - -// SetBytesProcessed sets the BytesProcessed field's value. -func (s *Progress) SetBytesProcessed(v int64) *Progress { - s.BytesProcessed = &v - return s -} - -// SetBytesReturned sets the BytesReturned field's value. -func (s *Progress) SetBytesReturned(v int64) *Progress { - s.BytesReturned = &v - return s -} - -// SetBytesScanned sets the BytesScanned field's value. -func (s *Progress) SetBytesScanned(v int64) *Progress { - s.BytesScanned = &v - return s -} - -// This data type contains information about the progress event of an operation. -type ProgressEvent struct { - _ struct{} `locationName:"ProgressEvent" type:"structure" payload:"Details"` - - // The Progress event details. - Details *Progress `locationName:"Details" type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ProgressEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ProgressEvent) GoString() string { - return s.String() -} - -// SetDetails sets the Details field's value. -func (s *ProgressEvent) SetDetails(v *Progress) *ProgressEvent { - s.Details = v - return s -} - -// The ProgressEvent is and event in the SelectObjectContentEventStream group of events. -func (s *ProgressEvent) eventSelectObjectContentEventStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the ProgressEvent value. -// This method is only used internally within the SDK's EventStream handling. -func (s *ProgressEvent) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *ProgressEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err -} - -// The PublicAccessBlock configuration that you want to apply to this Amazon -// S3 bucket. You can enable the configuration options in any combination. For -// more information about when Amazon S3 considers a bucket or object public, -// see The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status) -// in the Amazon S3 User Guide. -type PublicAccessBlockConfiguration struct { - _ struct{} `type:"structure"` - - // Specifies whether Amazon S3 should block public access control lists (ACLs) - // for this bucket and objects in this bucket. Setting this element to TRUE - // causes the following behavior: - // - // * PUT Bucket ACL and PUT Object ACL calls fail if the specified ACL is - // public. - // - // * PUT Object calls fail if the request includes a public ACL. - // - // * PUT Bucket calls fail if the request includes a public ACL. - // - // Enabling this setting doesn't affect existing policies or ACLs. - BlockPublicAcls *bool `locationName:"BlockPublicAcls" type:"boolean"` - - // Specifies whether Amazon S3 should block public bucket policies for this - // bucket. Setting this element to TRUE causes Amazon S3 to reject calls to - // PUT Bucket policy if the specified bucket policy allows public access. - // - // Enabling this setting doesn't affect existing bucket policies. - BlockPublicPolicy *bool `locationName:"BlockPublicPolicy" type:"boolean"` - - // Specifies whether Amazon S3 should ignore public ACLs for this bucket and - // objects in this bucket. Setting this element to TRUE causes Amazon S3 to - // ignore all public ACLs on this bucket and objects in this bucket. - // - // Enabling this setting doesn't affect the persistence of any existing ACLs - // and doesn't prevent new public ACLs from being set. - IgnorePublicAcls *bool `locationName:"IgnorePublicAcls" type:"boolean"` - - // Specifies whether Amazon S3 should restrict public bucket policies for this - // bucket. Setting this element to TRUE restricts access to this bucket to only - // Amazon Web Service principals and authorized users within this account if - // the bucket has a public policy. - // - // Enabling this setting doesn't affect previously stored bucket policies, except - // that public and cross-account access within any public bucket policy, including - // non-public delegation to specific accounts, is blocked. - RestrictPublicBuckets *bool `locationName:"RestrictPublicBuckets" type:"boolean"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PublicAccessBlockConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PublicAccessBlockConfiguration) GoString() string { - return s.String() -} - -// SetBlockPublicAcls sets the BlockPublicAcls field's value. -func (s *PublicAccessBlockConfiguration) SetBlockPublicAcls(v bool) *PublicAccessBlockConfiguration { - s.BlockPublicAcls = &v - return s -} - -// SetBlockPublicPolicy sets the BlockPublicPolicy field's value. -func (s *PublicAccessBlockConfiguration) SetBlockPublicPolicy(v bool) *PublicAccessBlockConfiguration { - s.BlockPublicPolicy = &v - return s -} - -// SetIgnorePublicAcls sets the IgnorePublicAcls field's value. -func (s *PublicAccessBlockConfiguration) SetIgnorePublicAcls(v bool) *PublicAccessBlockConfiguration { - s.IgnorePublicAcls = &v - return s -} - -// SetRestrictPublicBuckets sets the RestrictPublicBuckets field's value. -func (s *PublicAccessBlockConfiguration) SetRestrictPublicBuckets(v bool) *PublicAccessBlockConfiguration { - s.RestrictPublicBuckets = &v - return s -} - -type PutBucketAccelerateConfigurationInput struct { - _ struct{} `locationName:"PutBucketAccelerateConfigurationRequest" type:"structure" payload:"AccelerateConfiguration"` - - // Container for setting the transfer acceleration state. - // - // AccelerateConfiguration is a required field - AccelerateConfiguration *AccelerateConfiguration `locationName:"AccelerateConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - - // The name of the bucket for which the accelerate configuration is set. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketAccelerateConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketAccelerateConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketAccelerateConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketAccelerateConfigurationInput"} - if s.AccelerateConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("AccelerateConfiguration")) - } - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccelerateConfiguration sets the AccelerateConfiguration field's value. -func (s *PutBucketAccelerateConfigurationInput) SetAccelerateConfiguration(v *AccelerateConfiguration) *PutBucketAccelerateConfigurationInput { - s.AccelerateConfiguration = v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketAccelerateConfigurationInput) SetBucket(v string) *PutBucketAccelerateConfigurationInput { - s.Bucket = &v - return s -} - -func (s *PutBucketAccelerateConfigurationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutBucketAccelerateConfigurationInput) SetChecksumAlgorithm(v string) *PutBucketAccelerateConfigurationInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutBucketAccelerateConfigurationInput) SetExpectedBucketOwner(v string) *PutBucketAccelerateConfigurationInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *PutBucketAccelerateConfigurationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutBucketAccelerateConfigurationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutBucketAccelerateConfigurationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutBucketAccelerateConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketAccelerateConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketAccelerateConfigurationOutput) GoString() string { - return s.String() -} - -type PutBucketAclInput struct { - _ struct{} `locationName:"PutBucketAclRequest" type:"structure" payload:"AccessControlPolicy"` - - // The canned ACL to apply to the bucket. - ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"BucketCannedACL"` - - // Contains the elements that set the ACL permissions for an object per grantee. - AccessControlPolicy *AccessControlPolicy `locationName:"AccessControlPolicy" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - - // The bucket to which to apply the ACL. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - // - // The SDK will automatically compute the Content-MD5 checksum for this operation. - // The AWS SDK for Go v2 allows you to configure alternative checksum algorithm - // to be used. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Allows grantee the read, write, read ACP, and write ACP permissions on the - // bucket. - GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` - - // Allows grantee to list the objects in the bucket. - GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` - - // Allows grantee to read the bucket ACL. - GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` - - // Allows grantee to create new objects in the bucket. - // - // For the bucket and object owners of existing objects, also allows deletions - // and overwrites of those objects. - GrantWrite *string `location:"header" locationName:"x-amz-grant-write" type:"string"` - - // Allows grantee to write the ACL for the applicable bucket. - GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketAclInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketAclInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketAclInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketAclInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.AccessControlPolicy != nil { - if err := s.AccessControlPolicy.Validate(); err != nil { - invalidParams.AddNested("AccessControlPolicy", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetACL sets the ACL field's value. -func (s *PutBucketAclInput) SetACL(v string) *PutBucketAclInput { - s.ACL = &v - return s -} - -// SetAccessControlPolicy sets the AccessControlPolicy field's value. -func (s *PutBucketAclInput) SetAccessControlPolicy(v *AccessControlPolicy) *PutBucketAclInput { - s.AccessControlPolicy = v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketAclInput) SetBucket(v string) *PutBucketAclInput { - s.Bucket = &v - return s -} - -func (s *PutBucketAclInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutBucketAclInput) SetChecksumAlgorithm(v string) *PutBucketAclInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutBucketAclInput) SetExpectedBucketOwner(v string) *PutBucketAclInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetGrantFullControl sets the GrantFullControl field's value. -func (s *PutBucketAclInput) SetGrantFullControl(v string) *PutBucketAclInput { - s.GrantFullControl = &v - return s -} - -// SetGrantRead sets the GrantRead field's value. -func (s *PutBucketAclInput) SetGrantRead(v string) *PutBucketAclInput { - s.GrantRead = &v - return s -} - -// SetGrantReadACP sets the GrantReadACP field's value. -func (s *PutBucketAclInput) SetGrantReadACP(v string) *PutBucketAclInput { - s.GrantReadACP = &v - return s -} - -// SetGrantWrite sets the GrantWrite field's value. -func (s *PutBucketAclInput) SetGrantWrite(v string) *PutBucketAclInput { - s.GrantWrite = &v - return s -} - -// SetGrantWriteACP sets the GrantWriteACP field's value. -func (s *PutBucketAclInput) SetGrantWriteACP(v string) *PutBucketAclInput { - s.GrantWriteACP = &v - return s -} - -func (s *PutBucketAclInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutBucketAclInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutBucketAclInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutBucketAclOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketAclOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketAclOutput) GoString() string { - return s.String() -} - -type PutBucketAnalyticsConfigurationInput struct { - _ struct{} `locationName:"PutBucketAnalyticsConfigurationRequest" type:"structure" payload:"AnalyticsConfiguration"` - - // The configuration and any analyses for the analytics filter. - // - // AnalyticsConfiguration is a required field - AnalyticsConfiguration *AnalyticsConfiguration `locationName:"AnalyticsConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - - // The name of the bucket to which an analytics configuration is stored. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The ID that identifies the analytics configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketAnalyticsConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketAnalyticsConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketAnalyticsConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketAnalyticsConfigurationInput"} - if s.AnalyticsConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("AnalyticsConfiguration")) - } - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.AnalyticsConfiguration != nil { - if err := s.AnalyticsConfiguration.Validate(); err != nil { - invalidParams.AddNested("AnalyticsConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnalyticsConfiguration sets the AnalyticsConfiguration field's value. -func (s *PutBucketAnalyticsConfigurationInput) SetAnalyticsConfiguration(v *AnalyticsConfiguration) *PutBucketAnalyticsConfigurationInput { - s.AnalyticsConfiguration = v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketAnalyticsConfigurationInput) SetBucket(v string) *PutBucketAnalyticsConfigurationInput { - s.Bucket = &v - return s -} - -func (s *PutBucketAnalyticsConfigurationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutBucketAnalyticsConfigurationInput) SetExpectedBucketOwner(v string) *PutBucketAnalyticsConfigurationInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetId sets the Id field's value. -func (s *PutBucketAnalyticsConfigurationInput) SetId(v string) *PutBucketAnalyticsConfigurationInput { - s.Id = &v - return s -} - -func (s *PutBucketAnalyticsConfigurationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutBucketAnalyticsConfigurationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutBucketAnalyticsConfigurationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutBucketAnalyticsConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketAnalyticsConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketAnalyticsConfigurationOutput) GoString() string { - return s.String() -} - -type PutBucketCorsInput struct { - _ struct{} `locationName:"PutBucketCorsRequest" type:"structure" payload:"CORSConfiguration"` - - // Specifies the bucket impacted by the corsconfiguration. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Describes the cross-origin access configuration for objects in an Amazon - // S3 bucket. For more information, see Enabling Cross-Origin Resource Sharing - // (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html) in the Amazon - // S3 User Guide. - // - // CORSConfiguration is a required field - CORSConfiguration *CORSConfiguration `locationName:"CORSConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - // - // The SDK will automatically compute the Content-MD5 checksum for this operation. - // The AWS SDK for Go v2 allows you to configure alternative checksum algorithm - // to be used. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketCorsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketCorsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketCorsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketCorsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.CORSConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("CORSConfiguration")) - } - if s.CORSConfiguration != nil { - if err := s.CORSConfiguration.Validate(); err != nil { - invalidParams.AddNested("CORSConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketCorsInput) SetBucket(v string) *PutBucketCorsInput { - s.Bucket = &v - return s -} - -func (s *PutBucketCorsInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetCORSConfiguration sets the CORSConfiguration field's value. -func (s *PutBucketCorsInput) SetCORSConfiguration(v *CORSConfiguration) *PutBucketCorsInput { - s.CORSConfiguration = v - return s -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutBucketCorsInput) SetChecksumAlgorithm(v string) *PutBucketCorsInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutBucketCorsInput) SetExpectedBucketOwner(v string) *PutBucketCorsInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *PutBucketCorsInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutBucketCorsInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutBucketCorsInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutBucketCorsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketCorsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketCorsOutput) GoString() string { - return s.String() -} - -type PutBucketEncryptionInput struct { - _ struct{} `locationName:"PutBucketEncryptionRequest" type:"structure" payload:"ServerSideEncryptionConfiguration"` - - // Specifies default encryption for a bucket using server-side encryption with - // Amazon S3-managed keys (SSE-S3) or customer managed keys (SSE-KMS). For information - // about the Amazon S3 default encryption feature, see Amazon S3 Default Bucket - // Encryption (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - // - // The SDK will automatically compute the Content-MD5 checksum for this operation. - // The AWS SDK for Go v2 allows you to configure alternative checksum algorithm - // to be used. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Specifies the default server-side-encryption configuration. - // - // ServerSideEncryptionConfiguration is a required field - ServerSideEncryptionConfiguration *ServerSideEncryptionConfiguration `locationName:"ServerSideEncryptionConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketEncryptionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketEncryptionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketEncryptionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketEncryptionInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.ServerSideEncryptionConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("ServerSideEncryptionConfiguration")) - } - if s.ServerSideEncryptionConfiguration != nil { - if err := s.ServerSideEncryptionConfiguration.Validate(); err != nil { - invalidParams.AddNested("ServerSideEncryptionConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketEncryptionInput) SetBucket(v string) *PutBucketEncryptionInput { - s.Bucket = &v - return s -} - -func (s *PutBucketEncryptionInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutBucketEncryptionInput) SetChecksumAlgorithm(v string) *PutBucketEncryptionInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutBucketEncryptionInput) SetExpectedBucketOwner(v string) *PutBucketEncryptionInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetServerSideEncryptionConfiguration sets the ServerSideEncryptionConfiguration field's value. -func (s *PutBucketEncryptionInput) SetServerSideEncryptionConfiguration(v *ServerSideEncryptionConfiguration) *PutBucketEncryptionInput { - s.ServerSideEncryptionConfiguration = v - return s -} - -func (s *PutBucketEncryptionInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutBucketEncryptionInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutBucketEncryptionInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutBucketEncryptionOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketEncryptionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketEncryptionOutput) GoString() string { - return s.String() -} - -type PutBucketIntelligentTieringConfigurationInput struct { - _ struct{} `locationName:"PutBucketIntelligentTieringConfigurationRequest" type:"structure" payload:"IntelligentTieringConfiguration"` - - // The name of the Amazon S3 bucket whose configuration you want to modify or - // retrieve. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The ID used to identify the S3 Intelligent-Tiering configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` - - // Container for S3 Intelligent-Tiering configuration. - // - // IntelligentTieringConfiguration is a required field - IntelligentTieringConfiguration *IntelligentTieringConfiguration `locationName:"IntelligentTieringConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketIntelligentTieringConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketIntelligentTieringConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketIntelligentTieringConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketIntelligentTieringConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.IntelligentTieringConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("IntelligentTieringConfiguration")) - } - if s.IntelligentTieringConfiguration != nil { - if err := s.IntelligentTieringConfiguration.Validate(); err != nil { - invalidParams.AddNested("IntelligentTieringConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketIntelligentTieringConfigurationInput) SetBucket(v string) *PutBucketIntelligentTieringConfigurationInput { - s.Bucket = &v - return s -} - -func (s *PutBucketIntelligentTieringConfigurationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetId sets the Id field's value. -func (s *PutBucketIntelligentTieringConfigurationInput) SetId(v string) *PutBucketIntelligentTieringConfigurationInput { - s.Id = &v - return s -} - -// SetIntelligentTieringConfiguration sets the IntelligentTieringConfiguration field's value. -func (s *PutBucketIntelligentTieringConfigurationInput) SetIntelligentTieringConfiguration(v *IntelligentTieringConfiguration) *PutBucketIntelligentTieringConfigurationInput { - s.IntelligentTieringConfiguration = v - return s -} - -func (s *PutBucketIntelligentTieringConfigurationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutBucketIntelligentTieringConfigurationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutBucketIntelligentTieringConfigurationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutBucketIntelligentTieringConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketIntelligentTieringConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketIntelligentTieringConfigurationOutput) GoString() string { - return s.String() -} - -type PutBucketInventoryConfigurationInput struct { - _ struct{} `locationName:"PutBucketInventoryConfigurationRequest" type:"structure" payload:"InventoryConfiguration"` - - // The name of the bucket where the inventory configuration will be stored. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The ID used to identify the inventory configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` - - // Specifies the inventory configuration. - // - // InventoryConfiguration is a required field - InventoryConfiguration *InventoryConfiguration `locationName:"InventoryConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketInventoryConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketInventoryConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketInventoryConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketInventoryConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.InventoryConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("InventoryConfiguration")) - } - if s.InventoryConfiguration != nil { - if err := s.InventoryConfiguration.Validate(); err != nil { - invalidParams.AddNested("InventoryConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketInventoryConfigurationInput) SetBucket(v string) *PutBucketInventoryConfigurationInput { - s.Bucket = &v - return s -} - -func (s *PutBucketInventoryConfigurationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutBucketInventoryConfigurationInput) SetExpectedBucketOwner(v string) *PutBucketInventoryConfigurationInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetId sets the Id field's value. -func (s *PutBucketInventoryConfigurationInput) SetId(v string) *PutBucketInventoryConfigurationInput { - s.Id = &v - return s -} - -// SetInventoryConfiguration sets the InventoryConfiguration field's value. -func (s *PutBucketInventoryConfigurationInput) SetInventoryConfiguration(v *InventoryConfiguration) *PutBucketInventoryConfigurationInput { - s.InventoryConfiguration = v - return s -} - -func (s *PutBucketInventoryConfigurationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutBucketInventoryConfigurationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutBucketInventoryConfigurationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutBucketInventoryConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketInventoryConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketInventoryConfigurationOutput) GoString() string { - return s.String() -} - -type PutBucketLifecycleConfigurationInput struct { - _ struct{} `locationName:"PutBucketLifecycleConfigurationRequest" type:"structure" payload:"LifecycleConfiguration"` - - // The name of the bucket for which to set the configuration. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - // - // The SDK will automatically compute the Content-MD5 checksum for this operation. - // The AWS SDK for Go v2 allows you to configure alternative checksum algorithm - // to be used. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Container for lifecycle rules. You can add as many as 1,000 rules. - LifecycleConfiguration *BucketLifecycleConfiguration `locationName:"LifecycleConfiguration" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketLifecycleConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketLifecycleConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketLifecycleConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketLifecycleConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.LifecycleConfiguration != nil { - if err := s.LifecycleConfiguration.Validate(); err != nil { - invalidParams.AddNested("LifecycleConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketLifecycleConfigurationInput) SetBucket(v string) *PutBucketLifecycleConfigurationInput { - s.Bucket = &v - return s -} - -func (s *PutBucketLifecycleConfigurationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutBucketLifecycleConfigurationInput) SetChecksumAlgorithm(v string) *PutBucketLifecycleConfigurationInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutBucketLifecycleConfigurationInput) SetExpectedBucketOwner(v string) *PutBucketLifecycleConfigurationInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetLifecycleConfiguration sets the LifecycleConfiguration field's value. -func (s *PutBucketLifecycleConfigurationInput) SetLifecycleConfiguration(v *BucketLifecycleConfiguration) *PutBucketLifecycleConfigurationInput { - s.LifecycleConfiguration = v - return s -} - -func (s *PutBucketLifecycleConfigurationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutBucketLifecycleConfigurationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutBucketLifecycleConfigurationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutBucketLifecycleConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketLifecycleConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketLifecycleConfigurationOutput) GoString() string { - return s.String() -} - -type PutBucketLifecycleInput struct { - _ struct{} `locationName:"PutBucketLifecycleRequest" type:"structure" payload:"LifecycleConfiguration"` - - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - // - // The SDK will automatically compute the Content-MD5 checksum for this operation. - // The AWS SDK for Go v2 allows you to configure alternative checksum algorithm - // to be used. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Container for lifecycle rules. You can add as many as 1000 rules. - LifecycleConfiguration *LifecycleConfiguration `locationName:"LifecycleConfiguration" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketLifecycleInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketLifecycleInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketLifecycleInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketLifecycleInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.LifecycleConfiguration != nil { - if err := s.LifecycleConfiguration.Validate(); err != nil { - invalidParams.AddNested("LifecycleConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketLifecycleInput) SetBucket(v string) *PutBucketLifecycleInput { - s.Bucket = &v - return s -} - -func (s *PutBucketLifecycleInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutBucketLifecycleInput) SetChecksumAlgorithm(v string) *PutBucketLifecycleInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutBucketLifecycleInput) SetExpectedBucketOwner(v string) *PutBucketLifecycleInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetLifecycleConfiguration sets the LifecycleConfiguration field's value. -func (s *PutBucketLifecycleInput) SetLifecycleConfiguration(v *LifecycleConfiguration) *PutBucketLifecycleInput { - s.LifecycleConfiguration = v - return s -} - -func (s *PutBucketLifecycleInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutBucketLifecycleInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutBucketLifecycleInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutBucketLifecycleOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketLifecycleOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketLifecycleOutput) GoString() string { - return s.String() -} - -type PutBucketLoggingInput struct { - _ struct{} `locationName:"PutBucketLoggingRequest" type:"structure" payload:"BucketLoggingStatus"` - - // The name of the bucket for which to set the logging parameters. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Container for logging status information. - // - // BucketLoggingStatus is a required field - BucketLoggingStatus *BucketLoggingStatus `locationName:"BucketLoggingStatus" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - // - // The SDK will automatically compute the Content-MD5 checksum for this operation. - // The AWS SDK for Go v2 allows you to configure alternative checksum algorithm - // to be used. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketLoggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketLoggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketLoggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketLoggingInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.BucketLoggingStatus == nil { - invalidParams.Add(request.NewErrParamRequired("BucketLoggingStatus")) - } - if s.BucketLoggingStatus != nil { - if err := s.BucketLoggingStatus.Validate(); err != nil { - invalidParams.AddNested("BucketLoggingStatus", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketLoggingInput) SetBucket(v string) *PutBucketLoggingInput { - s.Bucket = &v - return s -} - -func (s *PutBucketLoggingInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetBucketLoggingStatus sets the BucketLoggingStatus field's value. -func (s *PutBucketLoggingInput) SetBucketLoggingStatus(v *BucketLoggingStatus) *PutBucketLoggingInput { - s.BucketLoggingStatus = v - return s -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutBucketLoggingInput) SetChecksumAlgorithm(v string) *PutBucketLoggingInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutBucketLoggingInput) SetExpectedBucketOwner(v string) *PutBucketLoggingInput { - s.ExpectedBucketOwner = &v - return s -} - -func (s *PutBucketLoggingInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutBucketLoggingInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutBucketLoggingInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutBucketLoggingOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketLoggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketLoggingOutput) GoString() string { - return s.String() -} - -type PutBucketMetricsConfigurationInput struct { - _ struct{} `locationName:"PutBucketMetricsConfigurationRequest" type:"structure" payload:"MetricsConfiguration"` - - // The name of the bucket for which the metrics configuration is set. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The ID used to identify the metrics configuration. - // - // Id is a required field - Id *string `location:"querystring" locationName:"id" type:"string" required:"true"` - - // Specifies the metrics configuration. - // - // MetricsConfiguration is a required field - MetricsConfiguration *MetricsConfiguration `locationName:"MetricsConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketMetricsConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketMetricsConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketMetricsConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketMetricsConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.MetricsConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("MetricsConfiguration")) - } - if s.MetricsConfiguration != nil { - if err := s.MetricsConfiguration.Validate(); err != nil { - invalidParams.AddNested("MetricsConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketMetricsConfigurationInput) SetBucket(v string) *PutBucketMetricsConfigurationInput { - s.Bucket = &v - return s -} - -func (s *PutBucketMetricsConfigurationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutBucketMetricsConfigurationInput) SetExpectedBucketOwner(v string) *PutBucketMetricsConfigurationInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetId sets the Id field's value. -func (s *PutBucketMetricsConfigurationInput) SetId(v string) *PutBucketMetricsConfigurationInput { - s.Id = &v - return s -} - -// SetMetricsConfiguration sets the MetricsConfiguration field's value. -func (s *PutBucketMetricsConfigurationInput) SetMetricsConfiguration(v *MetricsConfiguration) *PutBucketMetricsConfigurationInput { - s.MetricsConfiguration = v - return s -} - -func (s *PutBucketMetricsConfigurationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutBucketMetricsConfigurationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutBucketMetricsConfigurationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutBucketMetricsConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketMetricsConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketMetricsConfigurationOutput) GoString() string { - return s.String() -} - -type PutBucketNotificationConfigurationInput struct { - _ struct{} `locationName:"PutBucketNotificationConfigurationRequest" type:"structure" payload:"NotificationConfiguration"` - - // The name of the bucket. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // A container for specifying the notification configuration of the bucket. - // If this element is empty, notifications are turned off for the bucket. - // - // NotificationConfiguration is a required field - NotificationConfiguration *NotificationConfiguration `locationName:"NotificationConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - - // Skips validation of Amazon SQS, Amazon SNS, and Lambda destinations. True - // or false value. - SkipDestinationValidation *bool `location:"header" locationName:"x-amz-skip-destination-validation" type:"boolean"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketNotificationConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketNotificationConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketNotificationConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketNotificationConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.NotificationConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("NotificationConfiguration")) - } - if s.NotificationConfiguration != nil { - if err := s.NotificationConfiguration.Validate(); err != nil { - invalidParams.AddNested("NotificationConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketNotificationConfigurationInput) SetBucket(v string) *PutBucketNotificationConfigurationInput { - s.Bucket = &v - return s -} - -func (s *PutBucketNotificationConfigurationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutBucketNotificationConfigurationInput) SetExpectedBucketOwner(v string) *PutBucketNotificationConfigurationInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetNotificationConfiguration sets the NotificationConfiguration field's value. -func (s *PutBucketNotificationConfigurationInput) SetNotificationConfiguration(v *NotificationConfiguration) *PutBucketNotificationConfigurationInput { - s.NotificationConfiguration = v - return s -} - -// SetSkipDestinationValidation sets the SkipDestinationValidation field's value. -func (s *PutBucketNotificationConfigurationInput) SetSkipDestinationValidation(v bool) *PutBucketNotificationConfigurationInput { - s.SkipDestinationValidation = &v - return s -} - -func (s *PutBucketNotificationConfigurationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutBucketNotificationConfigurationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutBucketNotificationConfigurationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutBucketNotificationConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketNotificationConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketNotificationConfigurationOutput) GoString() string { - return s.String() -} - -type PutBucketNotificationInput struct { - _ struct{} `locationName:"PutBucketNotificationRequest" type:"structure" payload:"NotificationConfiguration"` - - // The name of the bucket. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - // - // The SDK will automatically compute the Content-MD5 checksum for this operation. - // The AWS SDK for Go v2 allows you to configure alternative checksum algorithm - // to be used. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The container for the configuration. - // - // NotificationConfiguration is a required field - NotificationConfiguration *NotificationConfigurationDeprecated `locationName:"NotificationConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketNotificationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketNotificationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketNotificationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketNotificationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.NotificationConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("NotificationConfiguration")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketNotificationInput) SetBucket(v string) *PutBucketNotificationInput { - s.Bucket = &v - return s -} - -func (s *PutBucketNotificationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutBucketNotificationInput) SetChecksumAlgorithm(v string) *PutBucketNotificationInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutBucketNotificationInput) SetExpectedBucketOwner(v string) *PutBucketNotificationInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetNotificationConfiguration sets the NotificationConfiguration field's value. -func (s *PutBucketNotificationInput) SetNotificationConfiguration(v *NotificationConfigurationDeprecated) *PutBucketNotificationInput { - s.NotificationConfiguration = v - return s -} - -func (s *PutBucketNotificationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutBucketNotificationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutBucketNotificationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutBucketNotificationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketNotificationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketNotificationOutput) GoString() string { - return s.String() -} - -type PutBucketOwnershipControlsInput struct { - _ struct{} `locationName:"PutBucketOwnershipControlsRequest" type:"structure" payload:"OwnershipControls"` - - // The name of the Amazon S3 bucket whose OwnershipControls you want to set. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The OwnershipControls (BucketOwnerEnforced, BucketOwnerPreferred, or ObjectWriter) - // that you want to apply to this Amazon S3 bucket. - // - // OwnershipControls is a required field - OwnershipControls *OwnershipControls `locationName:"OwnershipControls" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketOwnershipControlsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketOwnershipControlsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketOwnershipControlsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketOwnershipControlsInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.OwnershipControls == nil { - invalidParams.Add(request.NewErrParamRequired("OwnershipControls")) - } - if s.OwnershipControls != nil { - if err := s.OwnershipControls.Validate(); err != nil { - invalidParams.AddNested("OwnershipControls", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketOwnershipControlsInput) SetBucket(v string) *PutBucketOwnershipControlsInput { - s.Bucket = &v - return s -} - -func (s *PutBucketOwnershipControlsInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutBucketOwnershipControlsInput) SetExpectedBucketOwner(v string) *PutBucketOwnershipControlsInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetOwnershipControls sets the OwnershipControls field's value. -func (s *PutBucketOwnershipControlsInput) SetOwnershipControls(v *OwnershipControls) *PutBucketOwnershipControlsInput { - s.OwnershipControls = v - return s -} - -func (s *PutBucketOwnershipControlsInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutBucketOwnershipControlsInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutBucketOwnershipControlsInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutBucketOwnershipControlsOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketOwnershipControlsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketOwnershipControlsOutput) GoString() string { - return s.String() -} - -type PutBucketPolicyInput struct { - _ struct{} `locationName:"PutBucketPolicyRequest" type:"structure" payload:"Policy"` - - // The name of the bucket. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - // - // The SDK will automatically compute the Content-MD5 checksum for this operation. - // The AWS SDK for Go v2 allows you to configure alternative checksum algorithm - // to be used. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // Set this parameter to true to confirm that you want to remove your permissions - // to change this bucket policy in the future. - ConfirmRemoveSelfBucketAccess *bool `location:"header" locationName:"x-amz-confirm-remove-self-bucket-access" type:"boolean"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The bucket policy as a JSON document. - // - // Policy is a required field - Policy *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketPolicyInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Policy == nil { - invalidParams.Add(request.NewErrParamRequired("Policy")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketPolicyInput) SetBucket(v string) *PutBucketPolicyInput { - s.Bucket = &v - return s -} - -func (s *PutBucketPolicyInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutBucketPolicyInput) SetChecksumAlgorithm(v string) *PutBucketPolicyInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetConfirmRemoveSelfBucketAccess sets the ConfirmRemoveSelfBucketAccess field's value. -func (s *PutBucketPolicyInput) SetConfirmRemoveSelfBucketAccess(v bool) *PutBucketPolicyInput { - s.ConfirmRemoveSelfBucketAccess = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutBucketPolicyInput) SetExpectedBucketOwner(v string) *PutBucketPolicyInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetPolicy sets the Policy field's value. -func (s *PutBucketPolicyInput) SetPolicy(v string) *PutBucketPolicyInput { - s.Policy = &v - return s -} - -func (s *PutBucketPolicyInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutBucketPolicyInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutBucketPolicyInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutBucketPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketPolicyOutput) GoString() string { - return s.String() -} - -type PutBucketReplicationInput struct { - _ struct{} `locationName:"PutBucketReplicationRequest" type:"structure" payload:"ReplicationConfiguration"` - - // The name of the bucket - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - // - // The SDK will automatically compute the Content-MD5 checksum for this operation. - // The AWS SDK for Go v2 allows you to configure alternative checksum algorithm - // to be used. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // A container for replication rules. You can add up to 1,000 rules. The maximum - // size of a replication configuration is 2 MB. - // - // ReplicationConfiguration is a required field - ReplicationConfiguration *ReplicationConfiguration `locationName:"ReplicationConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - - // A token to allow Object Lock to be enabled for an existing bucket. - Token *string `location:"header" locationName:"x-amz-bucket-object-lock-token" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketReplicationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketReplicationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketReplicationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketReplicationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.ReplicationConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("ReplicationConfiguration")) - } - if s.ReplicationConfiguration != nil { - if err := s.ReplicationConfiguration.Validate(); err != nil { - invalidParams.AddNested("ReplicationConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketReplicationInput) SetBucket(v string) *PutBucketReplicationInput { - s.Bucket = &v - return s -} - -func (s *PutBucketReplicationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutBucketReplicationInput) SetChecksumAlgorithm(v string) *PutBucketReplicationInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutBucketReplicationInput) SetExpectedBucketOwner(v string) *PutBucketReplicationInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetReplicationConfiguration sets the ReplicationConfiguration field's value. -func (s *PutBucketReplicationInput) SetReplicationConfiguration(v *ReplicationConfiguration) *PutBucketReplicationInput { - s.ReplicationConfiguration = v - return s -} - -// SetToken sets the Token field's value. -func (s *PutBucketReplicationInput) SetToken(v string) *PutBucketReplicationInput { - s.Token = &v - return s -} - -func (s *PutBucketReplicationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutBucketReplicationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutBucketReplicationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutBucketReplicationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketReplicationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketReplicationOutput) GoString() string { - return s.String() -} - -type PutBucketRequestPaymentInput struct { - _ struct{} `locationName:"PutBucketRequestPaymentRequest" type:"structure" payload:"RequestPaymentConfiguration"` - - // The bucket name. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - // - // The SDK will automatically compute the Content-MD5 checksum for this operation. - // The AWS SDK for Go v2 allows you to configure alternative checksum algorithm - // to be used. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Container for Payer. - // - // RequestPaymentConfiguration is a required field - RequestPaymentConfiguration *RequestPaymentConfiguration `locationName:"RequestPaymentConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketRequestPaymentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketRequestPaymentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketRequestPaymentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketRequestPaymentInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.RequestPaymentConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("RequestPaymentConfiguration")) - } - if s.RequestPaymentConfiguration != nil { - if err := s.RequestPaymentConfiguration.Validate(); err != nil { - invalidParams.AddNested("RequestPaymentConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketRequestPaymentInput) SetBucket(v string) *PutBucketRequestPaymentInput { - s.Bucket = &v - return s -} - -func (s *PutBucketRequestPaymentInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutBucketRequestPaymentInput) SetChecksumAlgorithm(v string) *PutBucketRequestPaymentInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutBucketRequestPaymentInput) SetExpectedBucketOwner(v string) *PutBucketRequestPaymentInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetRequestPaymentConfiguration sets the RequestPaymentConfiguration field's value. -func (s *PutBucketRequestPaymentInput) SetRequestPaymentConfiguration(v *RequestPaymentConfiguration) *PutBucketRequestPaymentInput { - s.RequestPaymentConfiguration = v - return s -} - -func (s *PutBucketRequestPaymentInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutBucketRequestPaymentInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutBucketRequestPaymentInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutBucketRequestPaymentOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketRequestPaymentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketRequestPaymentOutput) GoString() string { - return s.String() -} - -type PutBucketTaggingInput struct { - _ struct{} `locationName:"PutBucketTaggingRequest" type:"structure" payload:"Tagging"` - - // The bucket name. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - // - // The SDK will automatically compute the Content-MD5 checksum for this operation. - // The AWS SDK for Go v2 allows you to configure alternative checksum algorithm - // to be used. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Container for the TagSet and Tag elements. - // - // Tagging is a required field - Tagging *Tagging `locationName:"Tagging" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketTaggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketTaggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketTaggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketTaggingInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Tagging == nil { - invalidParams.Add(request.NewErrParamRequired("Tagging")) - } - if s.Tagging != nil { - if err := s.Tagging.Validate(); err != nil { - invalidParams.AddNested("Tagging", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketTaggingInput) SetBucket(v string) *PutBucketTaggingInput { - s.Bucket = &v - return s -} - -func (s *PutBucketTaggingInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutBucketTaggingInput) SetChecksumAlgorithm(v string) *PutBucketTaggingInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutBucketTaggingInput) SetExpectedBucketOwner(v string) *PutBucketTaggingInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetTagging sets the Tagging field's value. -func (s *PutBucketTaggingInput) SetTagging(v *Tagging) *PutBucketTaggingInput { - s.Tagging = v - return s -} - -func (s *PutBucketTaggingInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutBucketTaggingInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutBucketTaggingInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutBucketTaggingOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketTaggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketTaggingOutput) GoString() string { - return s.String() -} - -type PutBucketVersioningInput struct { - _ struct{} `locationName:"PutBucketVersioningRequest" type:"structure" payload:"VersioningConfiguration"` - - // The bucket name. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - // - // The SDK will automatically compute the Content-MD5 checksum for this operation. - // The AWS SDK for Go v2 allows you to configure alternative checksum algorithm - // to be used. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The concatenation of the authentication device's serial number, a space, - // and the value that is displayed on your authentication device. - MFA *string `location:"header" locationName:"x-amz-mfa" type:"string"` - - // Container for setting the versioning state. - // - // VersioningConfiguration is a required field - VersioningConfiguration *VersioningConfiguration `locationName:"VersioningConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketVersioningInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketVersioningInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketVersioningInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketVersioningInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.VersioningConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("VersioningConfiguration")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketVersioningInput) SetBucket(v string) *PutBucketVersioningInput { - s.Bucket = &v - return s -} - -func (s *PutBucketVersioningInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutBucketVersioningInput) SetChecksumAlgorithm(v string) *PutBucketVersioningInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutBucketVersioningInput) SetExpectedBucketOwner(v string) *PutBucketVersioningInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetMFA sets the MFA field's value. -func (s *PutBucketVersioningInput) SetMFA(v string) *PutBucketVersioningInput { - s.MFA = &v - return s -} - -// SetVersioningConfiguration sets the VersioningConfiguration field's value. -func (s *PutBucketVersioningInput) SetVersioningConfiguration(v *VersioningConfiguration) *PutBucketVersioningInput { - s.VersioningConfiguration = v - return s -} - -func (s *PutBucketVersioningInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutBucketVersioningInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutBucketVersioningInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutBucketVersioningOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketVersioningOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketVersioningOutput) GoString() string { - return s.String() -} - -type PutBucketWebsiteInput struct { - _ struct{} `locationName:"PutBucketWebsiteRequest" type:"structure" payload:"WebsiteConfiguration"` - - // The bucket name. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - // - // The SDK will automatically compute the Content-MD5 checksum for this operation. - // The AWS SDK for Go v2 allows you to configure alternative checksum algorithm - // to be used. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Container for the request. - // - // WebsiteConfiguration is a required field - WebsiteConfiguration *WebsiteConfiguration `locationName:"WebsiteConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketWebsiteInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketWebsiteInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutBucketWebsiteInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutBucketWebsiteInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.WebsiteConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("WebsiteConfiguration")) - } - if s.WebsiteConfiguration != nil { - if err := s.WebsiteConfiguration.Validate(); err != nil { - invalidParams.AddNested("WebsiteConfiguration", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutBucketWebsiteInput) SetBucket(v string) *PutBucketWebsiteInput { - s.Bucket = &v - return s -} - -func (s *PutBucketWebsiteInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutBucketWebsiteInput) SetChecksumAlgorithm(v string) *PutBucketWebsiteInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutBucketWebsiteInput) SetExpectedBucketOwner(v string) *PutBucketWebsiteInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetWebsiteConfiguration sets the WebsiteConfiguration field's value. -func (s *PutBucketWebsiteInput) SetWebsiteConfiguration(v *WebsiteConfiguration) *PutBucketWebsiteInput { - s.WebsiteConfiguration = v - return s -} - -func (s *PutBucketWebsiteInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutBucketWebsiteInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutBucketWebsiteInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutBucketWebsiteOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketWebsiteOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutBucketWebsiteOutput) GoString() string { - return s.String() -} - -type PutObjectAclInput struct { - _ struct{} `locationName:"PutObjectAclRequest" type:"structure" payload:"AccessControlPolicy"` - - // The canned ACL to apply to the object. For more information, see Canned ACL - // (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL). - ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` - - // Contains the elements that set the ACL permissions for an object per grantee. - AccessControlPolicy *AccessControlPolicy `locationName:"AccessControlPolicy" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - - // The bucket name that contains the object to which you want to attach the - // ACL. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - // - // The SDK will automatically compute the Content-MD5 checksum for this operation. - // The AWS SDK for Go v2 allows you to configure alternative checksum algorithm - // to be used. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Allows grantee the read, write, read ACP, and write ACP permissions on the - // bucket. - // - // This action is not supported by Amazon S3 on Outposts. - GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` - - // Allows grantee to list the objects in the bucket. - // - // This action is not supported by Amazon S3 on Outposts. - GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` - - // Allows grantee to read the bucket ACL. - // - // This action is not supported by Amazon S3 on Outposts. - GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` - - // Allows grantee to create new objects in the bucket. - // - // For the bucket and object owners of existing objects, also allows deletions - // and overwrites of those objects. - GrantWrite *string `location:"header" locationName:"x-amz-grant-write" type:"string"` - - // Allows grantee to write the ACL for the applicable bucket. - // - // This action is not supported by Amazon S3 on Outposts. - GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` - - // Key for which the PUT action was initiated. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // VersionId used to reference a specific version of the object. - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectAclInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectAclInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutObjectAclInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutObjectAclInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.AccessControlPolicy != nil { - if err := s.AccessControlPolicy.Validate(); err != nil { - invalidParams.AddNested("AccessControlPolicy", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetACL sets the ACL field's value. -func (s *PutObjectAclInput) SetACL(v string) *PutObjectAclInput { - s.ACL = &v - return s -} - -// SetAccessControlPolicy sets the AccessControlPolicy field's value. -func (s *PutObjectAclInput) SetAccessControlPolicy(v *AccessControlPolicy) *PutObjectAclInput { - s.AccessControlPolicy = v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *PutObjectAclInput) SetBucket(v string) *PutObjectAclInput { - s.Bucket = &v - return s -} - -func (s *PutObjectAclInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutObjectAclInput) SetChecksumAlgorithm(v string) *PutObjectAclInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutObjectAclInput) SetExpectedBucketOwner(v string) *PutObjectAclInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetGrantFullControl sets the GrantFullControl field's value. -func (s *PutObjectAclInput) SetGrantFullControl(v string) *PutObjectAclInput { - s.GrantFullControl = &v - return s -} - -// SetGrantRead sets the GrantRead field's value. -func (s *PutObjectAclInput) SetGrantRead(v string) *PutObjectAclInput { - s.GrantRead = &v - return s -} - -// SetGrantReadACP sets the GrantReadACP field's value. -func (s *PutObjectAclInput) SetGrantReadACP(v string) *PutObjectAclInput { - s.GrantReadACP = &v - return s -} - -// SetGrantWrite sets the GrantWrite field's value. -func (s *PutObjectAclInput) SetGrantWrite(v string) *PutObjectAclInput { - s.GrantWrite = &v - return s -} - -// SetGrantWriteACP sets the GrantWriteACP field's value. -func (s *PutObjectAclInput) SetGrantWriteACP(v string) *PutObjectAclInput { - s.GrantWriteACP = &v - return s -} - -// SetKey sets the Key field's value. -func (s *PutObjectAclInput) SetKey(v string) *PutObjectAclInput { - s.Key = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *PutObjectAclInput) SetRequestPayer(v string) *PutObjectAclInput { - s.RequestPayer = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *PutObjectAclInput) SetVersionId(v string) *PutObjectAclInput { - s.VersionId = &v - return s -} - -func (s *PutObjectAclInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutObjectAclInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutObjectAclInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutObjectAclOutput struct { - _ struct{} `type:"structure"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectAclOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectAclOutput) GoString() string { - return s.String() -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *PutObjectAclOutput) SetRequestCharged(v string) *PutObjectAclOutput { - s.RequestCharged = &v - return s -} - -type PutObjectInput struct { - _ struct{} `locationName:"PutObjectRequest" type:"structure" payload:"Body"` - - // The canned ACL to apply to the object. For more information, see Canned ACL - // (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL). - // - // This action is not supported by Amazon S3 on Outposts. - ACL *string `location:"header" locationName:"x-amz-acl" type:"string" enum:"ObjectCannedACL"` - - // Object data. - Body io.ReadSeeker `type:"blob"` - - // The bucket name to which the PUT action was initiated. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Specifies whether Amazon S3 should use an S3 Bucket Key for object encryption - // with server-side encryption using AWS KMS (SSE-KMS). Setting this header - // to true causes Amazon S3 to use an S3 Bucket Key for object encryption with - // SSE-KMS. - // - // Specifying this header with a PUT action doesn’t affect bucket-level settings - // for S3 Bucket Key. - BucketKeyEnabled *bool `location:"header" locationName:"x-amz-server-side-encryption-bucket-key-enabled" type:"boolean"` - - // Can be used to specify caching behavior along the request/reply chain. For - // more information, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 - // (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9). - CacheControl *string `location:"header" locationName:"Cache-Control" type:"string"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // This header can be used as a data integrity check to verify that the data - // received is the same data that was originally sent. This header specifies - // the base64-encoded, 32-bit CRC32 checksum of the object. For more information, - // see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - ChecksumCRC32 *string `location:"header" locationName:"x-amz-checksum-crc32" type:"string"` - - // This header can be used as a data integrity check to verify that the data - // received is the same data that was originally sent. This header specifies - // the base64-encoded, 32-bit CRC32C checksum of the object. For more information, - // see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - ChecksumCRC32C *string `location:"header" locationName:"x-amz-checksum-crc32c" type:"string"` - - // This header can be used as a data integrity check to verify that the data - // received is the same data that was originally sent. This header specifies - // the base64-encoded, 160-bit SHA-1 digest of the object. For more information, - // see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - ChecksumSHA1 *string `location:"header" locationName:"x-amz-checksum-sha1" type:"string"` - - // This header can be used as a data integrity check to verify that the data - // received is the same data that was originally sent. This header specifies - // the base64-encoded, 256-bit SHA-256 digest of the object. For more information, - // see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - ChecksumSHA256 *string `location:"header" locationName:"x-amz-checksum-sha256" type:"string"` - - // Specifies presentational information for the object. For more information, - // see http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1). - ContentDisposition *string `location:"header" locationName:"Content-Disposition" type:"string"` - - // Specifies what content encodings have been applied to the object and thus - // what decoding mechanisms must be applied to obtain the media-type referenced - // by the Content-Type header field. For more information, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11 - // (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11). - ContentEncoding *string `location:"header" locationName:"Content-Encoding" type:"string"` - - // The language the content is in. - ContentLanguage *string `location:"header" locationName:"Content-Language" type:"string"` - - // Size of the body in bytes. This parameter is useful when the size of the - // body cannot be determined automatically. For more information, see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13 - // (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.13). - ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` - - // The base64-encoded 128-bit MD5 digest of the message (without the headers) - // according to RFC 1864. This header can be used as a message integrity check - // to verify that the data is the same data that was originally sent. Although - // it is optional, we recommend using the Content-MD5 mechanism as an end-to-end - // integrity check. For more information about REST request authentication, - // see REST Authentication (https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html). - ContentMD5 *string `location:"header" locationName:"Content-MD5" type:"string"` - - // A standard MIME type describing the format of the contents. For more information, - // see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17). - ContentType *string `location:"header" locationName:"Content-Type" type:"string"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The date and time at which the object is no longer cacheable. For more information, - // see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21 (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.21). - Expires *time.Time `location:"header" locationName:"Expires" type:"timestamp"` - - // Gives the grantee READ, READ_ACP, and WRITE_ACP permissions on the object. - // - // This action is not supported by Amazon S3 on Outposts. - GrantFullControl *string `location:"header" locationName:"x-amz-grant-full-control" type:"string"` - - // Allows grantee to read the object data and its metadata. - // - // This action is not supported by Amazon S3 on Outposts. - GrantRead *string `location:"header" locationName:"x-amz-grant-read" type:"string"` - - // Allows grantee to read the object ACL. - // - // This action is not supported by Amazon S3 on Outposts. - GrantReadACP *string `location:"header" locationName:"x-amz-grant-read-acp" type:"string"` - - // Allows grantee to write the ACL for the applicable object. - // - // This action is not supported by Amazon S3 on Outposts. - GrantWriteACP *string `location:"header" locationName:"x-amz-grant-write-acp" type:"string"` - - // Object key for which the PUT action was initiated. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // A map of metadata to store with the object in S3. - Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` - - // Specifies whether a legal hold will be applied to this object. For more information - // about S3 Object Lock, see Object Lock (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). - ObjectLockLegalHoldStatus *string `location:"header" locationName:"x-amz-object-lock-legal-hold" type:"string" enum:"ObjectLockLegalHoldStatus"` - - // The Object Lock mode that you want to apply to this object. - ObjectLockMode *string `location:"header" locationName:"x-amz-object-lock-mode" type:"string" enum:"ObjectLockMode"` - - // The date and time when you want this object's Object Lock to expire. Must - // be formatted as a timestamp parameter. - ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // Specifies the algorithm to use to when encrypting the object (for example, - // AES256). - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting - // data. This value is used to store the object and then it is discarded; Amazon - // S3 does not store the encryption key. The key must be appropriate for use - // with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm - // header. - // - // SSECustomerKey is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PutObjectInput's - // String and GoString methods. - SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` - - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure that the - // encryption key was transmitted without error. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // Specifies the Amazon Web Services KMS Encryption Context to use for object - // encryption. The value of this header is a base64-encoded UTF-8 string holding - // JSON with the encryption context key-value pairs. - // - // SSEKMSEncryptionContext is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PutObjectInput's - // String and GoString methods. - SSEKMSEncryptionContext *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` - - // If x-amz-server-side-encryption is present and has the value of aws:kms, - // this header specifies the ID of the Amazon Web Services Key Management Service - // (Amazon Web Services KMS) symmetrical customer managed key that was used - // for the object. If you specify x-amz-server-side-encryption:aws:kms, but - // do not providex-amz-server-side-encryption-aws-kms-key-id, Amazon S3 uses - // the Amazon Web Services managed key to protect the data. If the KMS key does - // not exist in the same account issuing the command, you must use the full - // ARN and not just the ID. - // - // SSEKMSKeyId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PutObjectInput's - // String and GoString methods. - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - - // The server-side encryption algorithm used when storing this object in Amazon - // S3 (for example, AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - - // By default, Amazon S3 uses the STANDARD Storage Class to store newly created - // objects. The STANDARD storage class provides high durability and high availability. - // Depending on performance needs, you can specify a different Storage Class. - // Amazon S3 on Outposts only uses the OUTPOSTS Storage Class. For more information, - // see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) - // in the Amazon S3 User Guide. - StorageClass *string `location:"header" locationName:"x-amz-storage-class" type:"string" enum:"StorageClass"` - - // The tag-set for the object. The tag-set must be encoded as URL Query parameters. - // (For example, "Key1=Value1") - Tagging *string `location:"header" locationName:"x-amz-tagging" type:"string"` - - // If the bucket is configured as a website, redirects requests for this object - // to another object in the same bucket or to an external URL. Amazon S3 stores - // the value of this header in the object metadata. For information about object - // metadata, see Object Key and Metadata (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html). - // - // In the following example, the request header sets the redirect to an object - // (anotherPage.html) in the same bucket: - // - // x-amz-website-redirect-location: /anotherPage.html - // - // In the following example, the request header sets the object redirect to - // another website: - // - // x-amz-website-redirect-location: http://www.example.com/ - // - // For more information about website hosting in Amazon S3, see Hosting Websites - // on Amazon S3 (https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html) - // and How to Configure Website Page Redirects (https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html). - WebsiteRedirectLocation *string `location:"header" locationName:"x-amz-website-redirect-location" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutObjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutObjectInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetACL sets the ACL field's value. -func (s *PutObjectInput) SetACL(v string) *PutObjectInput { - s.ACL = &v - return s -} - -// SetBody sets the Body field's value. -func (s *PutObjectInput) SetBody(v io.ReadSeeker) *PutObjectInput { - s.Body = v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *PutObjectInput) SetBucket(v string) *PutObjectInput { - s.Bucket = &v - return s -} - -func (s *PutObjectInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetBucketKeyEnabled sets the BucketKeyEnabled field's value. -func (s *PutObjectInput) SetBucketKeyEnabled(v bool) *PutObjectInput { - s.BucketKeyEnabled = &v - return s -} - -// SetCacheControl sets the CacheControl field's value. -func (s *PutObjectInput) SetCacheControl(v string) *PutObjectInput { - s.CacheControl = &v - return s -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutObjectInput) SetChecksumAlgorithm(v string) *PutObjectInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetChecksumCRC32 sets the ChecksumCRC32 field's value. -func (s *PutObjectInput) SetChecksumCRC32(v string) *PutObjectInput { - s.ChecksumCRC32 = &v - return s -} - -// SetChecksumCRC32C sets the ChecksumCRC32C field's value. -func (s *PutObjectInput) SetChecksumCRC32C(v string) *PutObjectInput { - s.ChecksumCRC32C = &v - return s -} - -// SetChecksumSHA1 sets the ChecksumSHA1 field's value. -func (s *PutObjectInput) SetChecksumSHA1(v string) *PutObjectInput { - s.ChecksumSHA1 = &v - return s -} - -// SetChecksumSHA256 sets the ChecksumSHA256 field's value. -func (s *PutObjectInput) SetChecksumSHA256(v string) *PutObjectInput { - s.ChecksumSHA256 = &v - return s -} - -// SetContentDisposition sets the ContentDisposition field's value. -func (s *PutObjectInput) SetContentDisposition(v string) *PutObjectInput { - s.ContentDisposition = &v - return s -} - -// SetContentEncoding sets the ContentEncoding field's value. -func (s *PutObjectInput) SetContentEncoding(v string) *PutObjectInput { - s.ContentEncoding = &v - return s -} - -// SetContentLanguage sets the ContentLanguage field's value. -func (s *PutObjectInput) SetContentLanguage(v string) *PutObjectInput { - s.ContentLanguage = &v - return s -} - -// SetContentLength sets the ContentLength field's value. -func (s *PutObjectInput) SetContentLength(v int64) *PutObjectInput { - s.ContentLength = &v - return s -} - -// SetContentMD5 sets the ContentMD5 field's value. -func (s *PutObjectInput) SetContentMD5(v string) *PutObjectInput { - s.ContentMD5 = &v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *PutObjectInput) SetContentType(v string) *PutObjectInput { - s.ContentType = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutObjectInput) SetExpectedBucketOwner(v string) *PutObjectInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetExpires sets the Expires field's value. -func (s *PutObjectInput) SetExpires(v time.Time) *PutObjectInput { - s.Expires = &v - return s -} - -// SetGrantFullControl sets the GrantFullControl field's value. -func (s *PutObjectInput) SetGrantFullControl(v string) *PutObjectInput { - s.GrantFullControl = &v - return s -} - -// SetGrantRead sets the GrantRead field's value. -func (s *PutObjectInput) SetGrantRead(v string) *PutObjectInput { - s.GrantRead = &v - return s -} - -// SetGrantReadACP sets the GrantReadACP field's value. -func (s *PutObjectInput) SetGrantReadACP(v string) *PutObjectInput { - s.GrantReadACP = &v - return s -} - -// SetGrantWriteACP sets the GrantWriteACP field's value. -func (s *PutObjectInput) SetGrantWriteACP(v string) *PutObjectInput { - s.GrantWriteACP = &v - return s -} - -// SetKey sets the Key field's value. -func (s *PutObjectInput) SetKey(v string) *PutObjectInput { - s.Key = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *PutObjectInput) SetMetadata(v map[string]*string) *PutObjectInput { - s.Metadata = v - return s -} - -// SetObjectLockLegalHoldStatus sets the ObjectLockLegalHoldStatus field's value. -func (s *PutObjectInput) SetObjectLockLegalHoldStatus(v string) *PutObjectInput { - s.ObjectLockLegalHoldStatus = &v - return s -} - -// SetObjectLockMode sets the ObjectLockMode field's value. -func (s *PutObjectInput) SetObjectLockMode(v string) *PutObjectInput { - s.ObjectLockMode = &v - return s -} - -// SetObjectLockRetainUntilDate sets the ObjectLockRetainUntilDate field's value. -func (s *PutObjectInput) SetObjectLockRetainUntilDate(v time.Time) *PutObjectInput { - s.ObjectLockRetainUntilDate = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *PutObjectInput) SetRequestPayer(v string) *PutObjectInput { - s.RequestPayer = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *PutObjectInput) SetSSECustomerAlgorithm(v string) *PutObjectInput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKey sets the SSECustomerKey field's value. -func (s *PutObjectInput) SetSSECustomerKey(v string) *PutObjectInput { - s.SSECustomerKey = &v - return s -} - -func (s *PutObjectInput) getSSECustomerKey() (v string) { - if s.SSECustomerKey == nil { - return v - } - return *s.SSECustomerKey -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *PutObjectInput) SetSSECustomerKeyMD5(v string) *PutObjectInput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSEncryptionContext sets the SSEKMSEncryptionContext field's value. -func (s *PutObjectInput) SetSSEKMSEncryptionContext(v string) *PutObjectInput { - s.SSEKMSEncryptionContext = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *PutObjectInput) SetSSEKMSKeyId(v string) *PutObjectInput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *PutObjectInput) SetServerSideEncryption(v string) *PutObjectInput { - s.ServerSideEncryption = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *PutObjectInput) SetStorageClass(v string) *PutObjectInput { - s.StorageClass = &v - return s -} - -// SetTagging sets the Tagging field's value. -func (s *PutObjectInput) SetTagging(v string) *PutObjectInput { - s.Tagging = &v - return s -} - -// SetWebsiteRedirectLocation sets the WebsiteRedirectLocation field's value. -func (s *PutObjectInput) SetWebsiteRedirectLocation(v string) *PutObjectInput { - s.WebsiteRedirectLocation = &v - return s -} - -func (s *PutObjectInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutObjectInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutObjectInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutObjectLegalHoldInput struct { - _ struct{} `locationName:"PutObjectLegalHoldRequest" type:"structure" payload:"LegalHold"` - - // The bucket name containing the object that you want to place a legal hold - // on. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - // - // The SDK will automatically compute the Content-MD5 checksum for this operation. - // The AWS SDK for Go v2 allows you to configure alternative checksum algorithm - // to be used. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The key name for the object that you want to place a legal hold on. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Container element for the legal hold configuration you want to apply to the - // specified object. - LegalHold *ObjectLockLegalHold `locationName:"LegalHold" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // The version ID of the object that you want to place a legal hold on. - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectLegalHoldInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectLegalHoldInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutObjectLegalHoldInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutObjectLegalHoldInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutObjectLegalHoldInput) SetBucket(v string) *PutObjectLegalHoldInput { - s.Bucket = &v - return s -} - -func (s *PutObjectLegalHoldInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutObjectLegalHoldInput) SetChecksumAlgorithm(v string) *PutObjectLegalHoldInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutObjectLegalHoldInput) SetExpectedBucketOwner(v string) *PutObjectLegalHoldInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetKey sets the Key field's value. -func (s *PutObjectLegalHoldInput) SetKey(v string) *PutObjectLegalHoldInput { - s.Key = &v - return s -} - -// SetLegalHold sets the LegalHold field's value. -func (s *PutObjectLegalHoldInput) SetLegalHold(v *ObjectLockLegalHold) *PutObjectLegalHoldInput { - s.LegalHold = v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *PutObjectLegalHoldInput) SetRequestPayer(v string) *PutObjectLegalHoldInput { - s.RequestPayer = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *PutObjectLegalHoldInput) SetVersionId(v string) *PutObjectLegalHoldInput { - s.VersionId = &v - return s -} - -func (s *PutObjectLegalHoldInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutObjectLegalHoldInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutObjectLegalHoldInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutObjectLegalHoldOutput struct { - _ struct{} `type:"structure"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectLegalHoldOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectLegalHoldOutput) GoString() string { - return s.String() -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *PutObjectLegalHoldOutput) SetRequestCharged(v string) *PutObjectLegalHoldOutput { - s.RequestCharged = &v - return s -} - -type PutObjectLockConfigurationInput struct { - _ struct{} `locationName:"PutObjectLockConfigurationRequest" type:"structure" payload:"ObjectLockConfiguration"` - - // The bucket whose Object Lock configuration you want to create or replace. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - // - // The SDK will automatically compute the Content-MD5 checksum for this operation. - // The AWS SDK for Go v2 allows you to configure alternative checksum algorithm - // to be used. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The Object Lock configuration that you want to apply to the specified bucket. - ObjectLockConfiguration *ObjectLockConfiguration `locationName:"ObjectLockConfiguration" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // A token to allow Object Lock to be enabled for an existing bucket. - Token *string `location:"header" locationName:"x-amz-bucket-object-lock-token" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectLockConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectLockConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutObjectLockConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutObjectLockConfigurationInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutObjectLockConfigurationInput) SetBucket(v string) *PutObjectLockConfigurationInput { - s.Bucket = &v - return s -} - -func (s *PutObjectLockConfigurationInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutObjectLockConfigurationInput) SetChecksumAlgorithm(v string) *PutObjectLockConfigurationInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutObjectLockConfigurationInput) SetExpectedBucketOwner(v string) *PutObjectLockConfigurationInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetObjectLockConfiguration sets the ObjectLockConfiguration field's value. -func (s *PutObjectLockConfigurationInput) SetObjectLockConfiguration(v *ObjectLockConfiguration) *PutObjectLockConfigurationInput { - s.ObjectLockConfiguration = v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *PutObjectLockConfigurationInput) SetRequestPayer(v string) *PutObjectLockConfigurationInput { - s.RequestPayer = &v - return s -} - -// SetToken sets the Token field's value. -func (s *PutObjectLockConfigurationInput) SetToken(v string) *PutObjectLockConfigurationInput { - s.Token = &v - return s -} - -func (s *PutObjectLockConfigurationInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutObjectLockConfigurationInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutObjectLockConfigurationInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutObjectLockConfigurationOutput struct { - _ struct{} `type:"structure"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectLockConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectLockConfigurationOutput) GoString() string { - return s.String() -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *PutObjectLockConfigurationOutput) SetRequestCharged(v string) *PutObjectLockConfigurationOutput { - s.RequestCharged = &v - return s -} - -type PutObjectOutput struct { - _ struct{} `type:"structure"` - - // Indicates whether the uploaded object uses an S3 Bucket Key for server-side - // encryption with Amazon Web Services KMS (SSE-KMS). - BucketKeyEnabled *bool `location:"header" locationName:"x-amz-server-side-encryption-bucket-key-enabled" type:"boolean"` - - // The base64-encoded, 32-bit CRC32 checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumCRC32 *string `location:"header" locationName:"x-amz-checksum-crc32" type:"string"` - - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumCRC32C *string `location:"header" locationName:"x-amz-checksum-crc32c" type:"string"` - - // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA1 *string `location:"header" locationName:"x-amz-checksum-sha1" type:"string"` - - // The base64-encoded, 256-bit SHA-256 digest of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA256 *string `location:"header" locationName:"x-amz-checksum-sha256" type:"string"` - - // Entity tag for the uploaded object. - ETag *string `location:"header" locationName:"ETag" type:"string"` - - // If the expiration is configured for the object (see PutBucketLifecycleConfiguration - // (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html)), - // the response includes this header. It includes the expiry-date and rule-id - // key-value pairs that provide information about object expiration. The value - // of the rule-id is URL-encoded. - Expiration *string `location:"header" locationName:"x-amz-expiration" type:"string"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header confirming the encryption algorithm - // used. - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round-trip message integrity - // verification of the customer-provided encryption key. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // If present, specifies the Amazon Web Services KMS Encryption Context to use - // for object encryption. The value of this header is a base64-encoded UTF-8 - // string holding JSON with the encryption context key-value pairs. - // - // SSEKMSEncryptionContext is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PutObjectOutput's - // String and GoString methods. - SSEKMSEncryptionContext *string `location:"header" locationName:"x-amz-server-side-encryption-context" type:"string" sensitive:"true"` - - // If x-amz-server-side-encryption is present and has the value of aws:kms, - // this header specifies the ID of the Amazon Web Services Key Management Service - // (Amazon Web Services KMS) symmetric customer managed key that was used for - // the object. - // - // SSEKMSKeyId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by PutObjectOutput's - // String and GoString methods. - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - - // If you specified server-side encryption either with an Amazon Web Services - // KMS key or Amazon S3-managed encryption key in your PUT request, the response - // includes this header. It confirms the encryption algorithm that Amazon S3 - // used to encrypt the object. - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - - // Version of the object. - VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectOutput) GoString() string { - return s.String() -} - -// SetBucketKeyEnabled sets the BucketKeyEnabled field's value. -func (s *PutObjectOutput) SetBucketKeyEnabled(v bool) *PutObjectOutput { - s.BucketKeyEnabled = &v - return s -} - -// SetChecksumCRC32 sets the ChecksumCRC32 field's value. -func (s *PutObjectOutput) SetChecksumCRC32(v string) *PutObjectOutput { - s.ChecksumCRC32 = &v - return s -} - -// SetChecksumCRC32C sets the ChecksumCRC32C field's value. -func (s *PutObjectOutput) SetChecksumCRC32C(v string) *PutObjectOutput { - s.ChecksumCRC32C = &v - return s -} - -// SetChecksumSHA1 sets the ChecksumSHA1 field's value. -func (s *PutObjectOutput) SetChecksumSHA1(v string) *PutObjectOutput { - s.ChecksumSHA1 = &v - return s -} - -// SetChecksumSHA256 sets the ChecksumSHA256 field's value. -func (s *PutObjectOutput) SetChecksumSHA256(v string) *PutObjectOutput { - s.ChecksumSHA256 = &v - return s -} - -// SetETag sets the ETag field's value. -func (s *PutObjectOutput) SetETag(v string) *PutObjectOutput { - s.ETag = &v - return s -} - -// SetExpiration sets the Expiration field's value. -func (s *PutObjectOutput) SetExpiration(v string) *PutObjectOutput { - s.Expiration = &v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *PutObjectOutput) SetRequestCharged(v string) *PutObjectOutput { - s.RequestCharged = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *PutObjectOutput) SetSSECustomerAlgorithm(v string) *PutObjectOutput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *PutObjectOutput) SetSSECustomerKeyMD5(v string) *PutObjectOutput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSEncryptionContext sets the SSEKMSEncryptionContext field's value. -func (s *PutObjectOutput) SetSSEKMSEncryptionContext(v string) *PutObjectOutput { - s.SSEKMSEncryptionContext = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *PutObjectOutput) SetSSEKMSKeyId(v string) *PutObjectOutput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *PutObjectOutput) SetServerSideEncryption(v string) *PutObjectOutput { - s.ServerSideEncryption = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *PutObjectOutput) SetVersionId(v string) *PutObjectOutput { - s.VersionId = &v - return s -} - -type PutObjectRetentionInput struct { - _ struct{} `locationName:"PutObjectRetentionRequest" type:"structure" payload:"Retention"` - - // The bucket name that contains the object you want to apply this Object Retention - // configuration to. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates whether this action should bypass Governance-mode restrictions. - BypassGovernanceRetention *bool `location:"header" locationName:"x-amz-bypass-governance-retention" type:"boolean"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - // - // The SDK will automatically compute the Content-MD5 checksum for this operation. - // The AWS SDK for Go v2 allows you to configure alternative checksum algorithm - // to be used. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The key name for the object that you want to apply this Object Retention - // configuration to. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // The container element for the Object Retention configuration. - Retention *ObjectLockRetention `locationName:"Retention" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - - // The version ID for the object that you want to apply this Object Retention - // configuration to. - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectRetentionInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectRetentionInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutObjectRetentionInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutObjectRetentionInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutObjectRetentionInput) SetBucket(v string) *PutObjectRetentionInput { - s.Bucket = &v - return s -} - -func (s *PutObjectRetentionInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetBypassGovernanceRetention sets the BypassGovernanceRetention field's value. -func (s *PutObjectRetentionInput) SetBypassGovernanceRetention(v bool) *PutObjectRetentionInput { - s.BypassGovernanceRetention = &v - return s -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutObjectRetentionInput) SetChecksumAlgorithm(v string) *PutObjectRetentionInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutObjectRetentionInput) SetExpectedBucketOwner(v string) *PutObjectRetentionInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetKey sets the Key field's value. -func (s *PutObjectRetentionInput) SetKey(v string) *PutObjectRetentionInput { - s.Key = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *PutObjectRetentionInput) SetRequestPayer(v string) *PutObjectRetentionInput { - s.RequestPayer = &v - return s -} - -// SetRetention sets the Retention field's value. -func (s *PutObjectRetentionInput) SetRetention(v *ObjectLockRetention) *PutObjectRetentionInput { - s.Retention = v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *PutObjectRetentionInput) SetVersionId(v string) *PutObjectRetentionInput { - s.VersionId = &v - return s -} - -func (s *PutObjectRetentionInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutObjectRetentionInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutObjectRetentionInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutObjectRetentionOutput struct { - _ struct{} `type:"structure"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectRetentionOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectRetentionOutput) GoString() string { - return s.String() -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *PutObjectRetentionOutput) SetRequestCharged(v string) *PutObjectRetentionOutput { - s.RequestCharged = &v - return s -} - -type PutObjectTaggingInput struct { - _ struct{} `locationName:"PutObjectTaggingRequest" type:"structure" payload:"Tagging"` - - // The bucket name containing the object. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - // - // The SDK will automatically compute the Content-MD5 checksum for this operation. - // The AWS SDK for Go v2 allows you to configure alternative checksum algorithm - // to be used. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Name of the object key. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // Container for the TagSet and Tag elements - // - // Tagging is a required field - Tagging *Tagging `locationName:"Tagging" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - - // The versionId of the object that the tag-set will be added to. - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectTaggingInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectTaggingInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutObjectTaggingInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutObjectTaggingInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Tagging == nil { - invalidParams.Add(request.NewErrParamRequired("Tagging")) - } - if s.Tagging != nil { - if err := s.Tagging.Validate(); err != nil { - invalidParams.AddNested("Tagging", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutObjectTaggingInput) SetBucket(v string) *PutObjectTaggingInput { - s.Bucket = &v - return s -} - -func (s *PutObjectTaggingInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutObjectTaggingInput) SetChecksumAlgorithm(v string) *PutObjectTaggingInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutObjectTaggingInput) SetExpectedBucketOwner(v string) *PutObjectTaggingInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetKey sets the Key field's value. -func (s *PutObjectTaggingInput) SetKey(v string) *PutObjectTaggingInput { - s.Key = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *PutObjectTaggingInput) SetRequestPayer(v string) *PutObjectTaggingInput { - s.RequestPayer = &v - return s -} - -// SetTagging sets the Tagging field's value. -func (s *PutObjectTaggingInput) SetTagging(v *Tagging) *PutObjectTaggingInput { - s.Tagging = v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *PutObjectTaggingInput) SetVersionId(v string) *PutObjectTaggingInput { - s.VersionId = &v - return s -} - -func (s *PutObjectTaggingInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutObjectTaggingInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutObjectTaggingInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutObjectTaggingOutput struct { - _ struct{} `type:"structure"` - - // The versionId of the object the tag-set was added to. - VersionId *string `location:"header" locationName:"x-amz-version-id" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectTaggingOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutObjectTaggingOutput) GoString() string { - return s.String() -} - -// SetVersionId sets the VersionId field's value. -func (s *PutObjectTaggingOutput) SetVersionId(v string) *PutObjectTaggingOutput { - s.VersionId = &v - return s -} - -type PutPublicAccessBlockInput struct { - _ struct{} `locationName:"PutPublicAccessBlockRequest" type:"structure" payload:"PublicAccessBlockConfiguration"` - - // The name of the Amazon S3 bucket whose PublicAccessBlock configuration you - // want to set. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - // - // The SDK will automatically compute the Content-MD5 checksum for this operation. - // The AWS SDK for Go v2 allows you to configure alternative checksum algorithm - // to be used. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The PublicAccessBlock configuration that you want to apply to this Amazon - // S3 bucket. You can enable the configuration options in any combination. For - // more information about when Amazon S3 considers a bucket or object public, - // see The Meaning of "Public" (https://docs.aws.amazon.com/AmazonS3/latest/dev/access-control-block-public-access.html#access-control-block-public-access-policy-status) - // in the Amazon S3 User Guide. - // - // PublicAccessBlockConfiguration is a required field - PublicAccessBlockConfiguration *PublicAccessBlockConfiguration `locationName:"PublicAccessBlockConfiguration" type:"structure" required:"true" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutPublicAccessBlockInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutPublicAccessBlockInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *PutPublicAccessBlockInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "PutPublicAccessBlockInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.PublicAccessBlockConfiguration == nil { - invalidParams.Add(request.NewErrParamRequired("PublicAccessBlockConfiguration")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *PutPublicAccessBlockInput) SetBucket(v string) *PutPublicAccessBlockInput { - s.Bucket = &v - return s -} - -func (s *PutPublicAccessBlockInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *PutPublicAccessBlockInput) SetChecksumAlgorithm(v string) *PutPublicAccessBlockInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *PutPublicAccessBlockInput) SetExpectedBucketOwner(v string) *PutPublicAccessBlockInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetPublicAccessBlockConfiguration sets the PublicAccessBlockConfiguration field's value. -func (s *PutPublicAccessBlockInput) SetPublicAccessBlockConfiguration(v *PublicAccessBlockConfiguration) *PutPublicAccessBlockInput { - s.PublicAccessBlockConfiguration = v - return s -} - -func (s *PutPublicAccessBlockInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *PutPublicAccessBlockInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s PutPublicAccessBlockInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type PutPublicAccessBlockOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutPublicAccessBlockOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s PutPublicAccessBlockOutput) GoString() string { - return s.String() -} - -// Specifies the configuration for publishing messages to an Amazon Simple Queue -// Service (Amazon SQS) queue when Amazon S3 detects specified events. -type QueueConfiguration struct { - _ struct{} `type:"structure"` - - // A collection of bucket events for which to send notifications - // - // Events is a required field - Events []*string `locationName:"Event" type:"list" flattened:"true" required:"true" enum:"Event"` - - // Specifies object key name filtering rules. For information about key name - // filtering, see Configuring Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - // in the Amazon S3 User Guide. - Filter *NotificationConfigurationFilter `type:"structure"` - - // An optional unique identifier for configurations in a notification configuration. - // If you don't provide one, Amazon S3 will assign an ID. - Id *string `type:"string"` - - // The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 - // publishes a message when it detects events of the specified type. - // - // QueueArn is a required field - QueueArn *string `locationName:"Queue" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s QueueConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s QueueConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *QueueConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "QueueConfiguration"} - if s.Events == nil { - invalidParams.Add(request.NewErrParamRequired("Events")) - } - if s.QueueArn == nil { - invalidParams.Add(request.NewErrParamRequired("QueueArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEvents sets the Events field's value. -func (s *QueueConfiguration) SetEvents(v []*string) *QueueConfiguration { - s.Events = v - return s -} - -// SetFilter sets the Filter field's value. -func (s *QueueConfiguration) SetFilter(v *NotificationConfigurationFilter) *QueueConfiguration { - s.Filter = v - return s -} - -// SetId sets the Id field's value. -func (s *QueueConfiguration) SetId(v string) *QueueConfiguration { - s.Id = &v - return s -} - -// SetQueueArn sets the QueueArn field's value. -func (s *QueueConfiguration) SetQueueArn(v string) *QueueConfiguration { - s.QueueArn = &v - return s -} - -// This data type is deprecated. Use QueueConfiguration (https://docs.aws.amazon.com/AmazonS3/latest/API/API_QueueConfiguration.html) -// for the same purposes. This data type specifies the configuration for publishing -// messages to an Amazon Simple Queue Service (Amazon SQS) queue when Amazon -// S3 detects specified events. -type QueueConfigurationDeprecated struct { - _ struct{} `type:"structure"` - - // The bucket event for which to send notifications. - // - // Deprecated: Event has been deprecated - Event *string `deprecated:"true" type:"string" enum:"Event"` - - // A collection of bucket events for which to send notifications. - Events []*string `locationName:"Event" type:"list" flattened:"true" enum:"Event"` - - // An optional unique identifier for configurations in a notification configuration. - // If you don't provide one, Amazon S3 will assign an ID. - Id *string `type:"string"` - - // The Amazon Resource Name (ARN) of the Amazon SQS queue to which Amazon S3 - // publishes a message when it detects events of the specified type. - Queue *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s QueueConfigurationDeprecated) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s QueueConfigurationDeprecated) GoString() string { - return s.String() -} - -// SetEvent sets the Event field's value. -func (s *QueueConfigurationDeprecated) SetEvent(v string) *QueueConfigurationDeprecated { - s.Event = &v - return s -} - -// SetEvents sets the Events field's value. -func (s *QueueConfigurationDeprecated) SetEvents(v []*string) *QueueConfigurationDeprecated { - s.Events = v - return s -} - -// SetId sets the Id field's value. -func (s *QueueConfigurationDeprecated) SetId(v string) *QueueConfigurationDeprecated { - s.Id = &v - return s -} - -// SetQueue sets the Queue field's value. -func (s *QueueConfigurationDeprecated) SetQueue(v string) *QueueConfigurationDeprecated { - s.Queue = &v - return s -} - -// The container for the records event. -type RecordsEvent struct { - _ struct{} `locationName:"RecordsEvent" type:"structure" payload:"Payload"` - - // The byte array of partial, one or more result records. - // Payload is automatically base64 encoded/decoded by the SDK. - Payload []byte `type:"blob"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RecordsEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RecordsEvent) GoString() string { - return s.String() -} - -// SetPayload sets the Payload field's value. -func (s *RecordsEvent) SetPayload(v []byte) *RecordsEvent { - s.Payload = v - return s -} - -// The RecordsEvent is and event in the SelectObjectContentEventStream group of events. -func (s *RecordsEvent) eventSelectObjectContentEventStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the RecordsEvent value. -// This method is only used internally within the SDK's EventStream handling. -func (s *RecordsEvent) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - s.Payload = make([]byte, len(msg.Payload)) - copy(s.Payload, msg.Payload) - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *RecordsEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) - msg.Headers.Set(":content-type", eventstream.StringValue("application/octet-stream")) - msg.Payload = s.Payload - return msg, err -} - -// Specifies how requests are redirected. In the event of an error, you can -// specify a different error code to return. -type Redirect struct { - _ struct{} `type:"structure"` - - // The host name to use in the redirect request. - HostName *string `type:"string"` - - // The HTTP redirect code to use on the response. Not required if one of the - // siblings is present. - HttpRedirectCode *string `type:"string"` - - // Protocol to use when redirecting requests. The default is the protocol that - // is used in the original request. - Protocol *string `type:"string" enum:"Protocol"` - - // The object key prefix to use in the redirect request. For example, to redirect - // requests for all pages with prefix docs/ (objects in the docs/ folder) to - // documents/, you can set a condition block with KeyPrefixEquals set to docs/ - // and in the Redirect set ReplaceKeyPrefixWith to /documents. Not required - // if one of the siblings is present. Can be present only if ReplaceKeyWith - // is not provided. - // - // Replacement must be made for object keys containing special characters (such - // as carriage returns) when using XML requests. For more information, see XML - // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). - ReplaceKeyPrefixWith *string `type:"string"` - - // The specific object key to use in the redirect request. For example, redirect - // request to error.html. Not required if one of the siblings is present. Can - // be present only if ReplaceKeyPrefixWith is not provided. - // - // Replacement must be made for object keys containing special characters (such - // as carriage returns) when using XML requests. For more information, see XML - // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). - ReplaceKeyWith *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Redirect) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Redirect) GoString() string { - return s.String() -} - -// SetHostName sets the HostName field's value. -func (s *Redirect) SetHostName(v string) *Redirect { - s.HostName = &v - return s -} - -// SetHttpRedirectCode sets the HttpRedirectCode field's value. -func (s *Redirect) SetHttpRedirectCode(v string) *Redirect { - s.HttpRedirectCode = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *Redirect) SetProtocol(v string) *Redirect { - s.Protocol = &v - return s -} - -// SetReplaceKeyPrefixWith sets the ReplaceKeyPrefixWith field's value. -func (s *Redirect) SetReplaceKeyPrefixWith(v string) *Redirect { - s.ReplaceKeyPrefixWith = &v - return s -} - -// SetReplaceKeyWith sets the ReplaceKeyWith field's value. -func (s *Redirect) SetReplaceKeyWith(v string) *Redirect { - s.ReplaceKeyWith = &v - return s -} - -// Specifies the redirect behavior of all requests to a website endpoint of -// an Amazon S3 bucket. -type RedirectAllRequestsTo struct { - _ struct{} `type:"structure"` - - // Name of the host where requests are redirected. - // - // HostName is a required field - HostName *string `type:"string" required:"true"` - - // Protocol to use when redirecting requests. The default is the protocol that - // is used in the original request. - Protocol *string `type:"string" enum:"Protocol"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RedirectAllRequestsTo) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RedirectAllRequestsTo) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RedirectAllRequestsTo) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RedirectAllRequestsTo"} - if s.HostName == nil { - invalidParams.Add(request.NewErrParamRequired("HostName")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetHostName sets the HostName field's value. -func (s *RedirectAllRequestsTo) SetHostName(v string) *RedirectAllRequestsTo { - s.HostName = &v - return s -} - -// SetProtocol sets the Protocol field's value. -func (s *RedirectAllRequestsTo) SetProtocol(v string) *RedirectAllRequestsTo { - s.Protocol = &v - return s -} - -// A filter that you can specify for selection for modifications on replicas. -// Amazon S3 doesn't replicate replica modifications by default. In the latest -// version of replication configuration (when Filter is specified), you can -// specify this element and set the status to Enabled to replicate modifications -// on replicas. -// -// If you don't specify the Filter element, Amazon S3 assumes that the replication -// configuration is the earlier version, V1. In the earlier version, this element -// is not allowed. -type ReplicaModifications struct { - _ struct{} `type:"structure"` - - // Specifies whether Amazon S3 replicates modifications on replicas. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"ReplicaModificationsStatus"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ReplicaModifications) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ReplicaModifications) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplicaModifications) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplicaModifications"} - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStatus sets the Status field's value. -func (s *ReplicaModifications) SetStatus(v string) *ReplicaModifications { - s.Status = &v - return s -} - -// A container for replication rules. You can add up to 1,000 rules. The maximum -// size of a replication configuration is 2 MB. -type ReplicationConfiguration struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the Identity and Access Management (IAM) - // role that Amazon S3 assumes when replicating objects. For more information, - // see How to Set Up Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-how-setup.html) - // in the Amazon S3 User Guide. - // - // Role is a required field - Role *string `type:"string" required:"true"` - - // A container for one or more replication rules. A replication configuration - // must have at least one rule and can contain a maximum of 1,000 rules. - // - // Rules is a required field - Rules []*ReplicationRule `locationName:"Rule" type:"list" flattened:"true" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ReplicationConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ReplicationConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplicationConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplicationConfiguration"} - if s.Role == nil { - invalidParams.Add(request.NewErrParamRequired("Role")) - } - if s.Rules == nil { - invalidParams.Add(request.NewErrParamRequired("Rules")) - } - if s.Rules != nil { - for i, v := range s.Rules { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRole sets the Role field's value. -func (s *ReplicationConfiguration) SetRole(v string) *ReplicationConfiguration { - s.Role = &v - return s -} - -// SetRules sets the Rules field's value. -func (s *ReplicationConfiguration) SetRules(v []*ReplicationRule) *ReplicationConfiguration { - s.Rules = v - return s -} - -// Specifies which Amazon S3 objects to replicate and where to store the replicas. -type ReplicationRule struct { - _ struct{} `type:"structure"` - - // Specifies whether Amazon S3 replicates delete markers. If you specify a Filter - // in your replication configuration, you must also include a DeleteMarkerReplication - // element. If your Filter includes a Tag element, the DeleteMarkerReplication - // Status must be set to Disabled, because Amazon S3 does not support replicating - // delete markers for tag-based rules. For an example configuration, see Basic - // Rule Configuration (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-config-min-rule-config). - // - // For more information about delete marker replication, see Basic Rule Configuration - // (https://docs.aws.amazon.com/AmazonS3/latest/dev/delete-marker-replication.html). - // - // If you are using an earlier version of the replication configuration, Amazon - // S3 handles replication of delete markers differently. For more information, - // see Backward Compatibility (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-add-config.html#replication-backward-compat-considerations). - DeleteMarkerReplication *DeleteMarkerReplication `type:"structure"` - - // A container for information about the replication destination and its configurations - // including enabling the S3 Replication Time Control (S3 RTC). - // - // Destination is a required field - Destination *Destination `type:"structure" required:"true"` - - // Optional configuration to replicate existing source bucket objects. For more - // information, see Replicating Existing Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication-what-is-isnot-replicated.html#existing-object-replication) - // in the Amazon S3 User Guide. - ExistingObjectReplication *ExistingObjectReplication `type:"structure"` - - // A filter that identifies the subset of objects to which the replication rule - // applies. A Filter must specify exactly one Prefix, Tag, or an And child element. - Filter *ReplicationRuleFilter `type:"structure"` - - // A unique identifier for the rule. The maximum value is 255 characters. - ID *string `type:"string"` - - // An object key name prefix that identifies the object or objects to which - // the rule applies. The maximum prefix length is 1,024 characters. To include - // all objects in a bucket, specify an empty string. - // - // Replacement must be made for object keys containing special characters (such - // as carriage returns) when using XML requests. For more information, see XML - // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). - // - // Deprecated: Prefix has been deprecated - Prefix *string `deprecated:"true" type:"string"` - - // The priority indicates which rule has precedence whenever two or more replication - // rules conflict. Amazon S3 will attempt to replicate objects according to - // all replication rules. However, if there are two or more rules with the same - // destination bucket, then objects will be replicated according to the rule - // with the highest priority. The higher the number, the higher the priority. - // - // For more information, see Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html) - // in the Amazon S3 User Guide. - Priority *int64 `type:"integer"` - - // A container that describes additional filters for identifying the source - // objects that you want to replicate. You can choose to enable or disable the - // replication of these objects. Currently, Amazon S3 supports only the filter - // that you can specify for objects created with server-side encryption using - // a customer managed key stored in Amazon Web Services Key Management Service - // (SSE-KMS). - SourceSelectionCriteria *SourceSelectionCriteria `type:"structure"` - - // Specifies whether the rule is enabled. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"ReplicationRuleStatus"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ReplicationRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ReplicationRule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplicationRule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplicationRule"} - if s.Destination == nil { - invalidParams.Add(request.NewErrParamRequired("Destination")) - } - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - if s.Destination != nil { - if err := s.Destination.Validate(); err != nil { - invalidParams.AddNested("Destination", err.(request.ErrInvalidParams)) - } - } - if s.ExistingObjectReplication != nil { - if err := s.ExistingObjectReplication.Validate(); err != nil { - invalidParams.AddNested("ExistingObjectReplication", err.(request.ErrInvalidParams)) - } - } - if s.Filter != nil { - if err := s.Filter.Validate(); err != nil { - invalidParams.AddNested("Filter", err.(request.ErrInvalidParams)) - } - } - if s.SourceSelectionCriteria != nil { - if err := s.SourceSelectionCriteria.Validate(); err != nil { - invalidParams.AddNested("SourceSelectionCriteria", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDeleteMarkerReplication sets the DeleteMarkerReplication field's value. -func (s *ReplicationRule) SetDeleteMarkerReplication(v *DeleteMarkerReplication) *ReplicationRule { - s.DeleteMarkerReplication = v - return s -} - -// SetDestination sets the Destination field's value. -func (s *ReplicationRule) SetDestination(v *Destination) *ReplicationRule { - s.Destination = v - return s -} - -// SetExistingObjectReplication sets the ExistingObjectReplication field's value. -func (s *ReplicationRule) SetExistingObjectReplication(v *ExistingObjectReplication) *ReplicationRule { - s.ExistingObjectReplication = v - return s -} - -// SetFilter sets the Filter field's value. -func (s *ReplicationRule) SetFilter(v *ReplicationRuleFilter) *ReplicationRule { - s.Filter = v - return s -} - -// SetID sets the ID field's value. -func (s *ReplicationRule) SetID(v string) *ReplicationRule { - s.ID = &v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ReplicationRule) SetPrefix(v string) *ReplicationRule { - s.Prefix = &v - return s -} - -// SetPriority sets the Priority field's value. -func (s *ReplicationRule) SetPriority(v int64) *ReplicationRule { - s.Priority = &v - return s -} - -// SetSourceSelectionCriteria sets the SourceSelectionCriteria field's value. -func (s *ReplicationRule) SetSourceSelectionCriteria(v *SourceSelectionCriteria) *ReplicationRule { - s.SourceSelectionCriteria = v - return s -} - -// SetStatus sets the Status field's value. -func (s *ReplicationRule) SetStatus(v string) *ReplicationRule { - s.Status = &v - return s -} - -// A container for specifying rule filters. The filters determine the subset -// of objects to which the rule applies. This element is required only if you -// specify more than one filter. -// -// For example: -// -// - If you specify both a Prefix and a Tag filter, wrap these filters in -// an And tag. -// -// - If you specify a filter based on multiple tags, wrap the Tag elements -// in an And tag. -type ReplicationRuleAndOperator struct { - _ struct{} `type:"structure"` - - // An object key name prefix that identifies the subset of objects to which - // the rule applies. - Prefix *string `type:"string"` - - // An array of tags containing key and value pairs. - Tags []*Tag `locationName:"Tag" locationNameList:"Tag" type:"list" flattened:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ReplicationRuleAndOperator) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ReplicationRuleAndOperator) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplicationRuleAndOperator) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplicationRuleAndOperator"} - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPrefix sets the Prefix field's value. -func (s *ReplicationRuleAndOperator) SetPrefix(v string) *ReplicationRuleAndOperator { - s.Prefix = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *ReplicationRuleAndOperator) SetTags(v []*Tag) *ReplicationRuleAndOperator { - s.Tags = v - return s -} - -// A filter that identifies the subset of objects to which the replication rule -// applies. A Filter must specify exactly one Prefix, Tag, or an And child element. -type ReplicationRuleFilter struct { - _ struct{} `type:"structure"` - - // A container for specifying rule filters. The filters determine the subset - // of objects to which the rule applies. This element is required only if you - // specify more than one filter. For example: - // - // * If you specify both a Prefix and a Tag filter, wrap these filters in - // an And tag. - // - // * If you specify a filter based on multiple tags, wrap the Tag elements - // in an And tag. - And *ReplicationRuleAndOperator `type:"structure"` - - // An object key name prefix that identifies the subset of objects to which - // the rule applies. - // - // Replacement must be made for object keys containing special characters (such - // as carriage returns) when using XML requests. For more information, see XML - // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). - Prefix *string `type:"string"` - - // A container for specifying a tag key and value. - // - // The rule applies only to objects that have the tag in their tag set. - Tag *Tag `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ReplicationRuleFilter) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ReplicationRuleFilter) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplicationRuleFilter) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplicationRuleFilter"} - if s.And != nil { - if err := s.And.Validate(); err != nil { - invalidParams.AddNested("And", err.(request.ErrInvalidParams)) - } - } - if s.Tag != nil { - if err := s.Tag.Validate(); err != nil { - invalidParams.AddNested("Tag", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAnd sets the And field's value. -func (s *ReplicationRuleFilter) SetAnd(v *ReplicationRuleAndOperator) *ReplicationRuleFilter { - s.And = v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *ReplicationRuleFilter) SetPrefix(v string) *ReplicationRuleFilter { - s.Prefix = &v - return s -} - -// SetTag sets the Tag field's value. -func (s *ReplicationRuleFilter) SetTag(v *Tag) *ReplicationRuleFilter { - s.Tag = v - return s -} - -// A container specifying S3 Replication Time Control (S3 RTC) related information, -// including whether S3 RTC is enabled and the time when all objects and operations -// on objects must be replicated. Must be specified together with a Metrics -// block. -type ReplicationTime struct { - _ struct{} `type:"structure"` - - // Specifies whether the replication time is enabled. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"ReplicationTimeStatus"` - - // A container specifying the time by which replication should be complete for - // all objects and operations on objects. - // - // Time is a required field - Time *ReplicationTimeValue `type:"structure" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ReplicationTime) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ReplicationTime) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ReplicationTime) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ReplicationTime"} - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - if s.Time == nil { - invalidParams.Add(request.NewErrParamRequired("Time")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStatus sets the Status field's value. -func (s *ReplicationTime) SetStatus(v string) *ReplicationTime { - s.Status = &v - return s -} - -// SetTime sets the Time field's value. -func (s *ReplicationTime) SetTime(v *ReplicationTimeValue) *ReplicationTime { - s.Time = v - return s -} - -// A container specifying the time value for S3 Replication Time Control (S3 -// RTC) and replication metrics EventThreshold. -type ReplicationTimeValue struct { - _ struct{} `type:"structure"` - - // Contains an integer specifying time in minutes. - // - // Valid value: 15 - Minutes *int64 `type:"integer"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ReplicationTimeValue) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ReplicationTimeValue) GoString() string { - return s.String() -} - -// SetMinutes sets the Minutes field's value. -func (s *ReplicationTimeValue) SetMinutes(v int64) *ReplicationTimeValue { - s.Minutes = &v - return s -} - -// Container for Payer. -type RequestPaymentConfiguration struct { - _ struct{} `type:"structure"` - - // Specifies who pays for the download and request fees. - // - // Payer is a required field - Payer *string `type:"string" required:"true" enum:"Payer"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RequestPaymentConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RequestPaymentConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RequestPaymentConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RequestPaymentConfiguration"} - if s.Payer == nil { - invalidParams.Add(request.NewErrParamRequired("Payer")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetPayer sets the Payer field's value. -func (s *RequestPaymentConfiguration) SetPayer(v string) *RequestPaymentConfiguration { - s.Payer = &v - return s -} - -// Container for specifying if periodic QueryProgress messages should be sent. -type RequestProgress struct { - _ struct{} `type:"structure"` - - // Specifies whether periodic QueryProgress frames should be sent. Valid values: - // TRUE, FALSE. Default value: FALSE. - Enabled *bool `type:"boolean"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RequestProgress) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RequestProgress) GoString() string { - return s.String() -} - -// SetEnabled sets the Enabled field's value. -func (s *RequestProgress) SetEnabled(v bool) *RequestProgress { - s.Enabled = &v - return s -} - -type RestoreObjectInput struct { - _ struct{} `locationName:"RestoreObjectRequest" type:"structure" payload:"RestoreRequest"` - - // The bucket name containing the object to restore. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Object key for which the action was initiated. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // Container for restore job parameters. - RestoreRequest *RestoreRequest `locationName:"RestoreRequest" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - - // VersionId used to reference a specific version of the object. - VersionId *string `location:"querystring" locationName:"versionId" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RestoreObjectInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RestoreObjectInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreObjectInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreObjectInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.RestoreRequest != nil { - if err := s.RestoreRequest.Validate(); err != nil { - invalidParams.AddNested("RestoreRequest", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *RestoreObjectInput) SetBucket(v string) *RestoreObjectInput { - s.Bucket = &v - return s -} - -func (s *RestoreObjectInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *RestoreObjectInput) SetChecksumAlgorithm(v string) *RestoreObjectInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *RestoreObjectInput) SetExpectedBucketOwner(v string) *RestoreObjectInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetKey sets the Key field's value. -func (s *RestoreObjectInput) SetKey(v string) *RestoreObjectInput { - s.Key = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *RestoreObjectInput) SetRequestPayer(v string) *RestoreObjectInput { - s.RequestPayer = &v - return s -} - -// SetRestoreRequest sets the RestoreRequest field's value. -func (s *RestoreObjectInput) SetRestoreRequest(v *RestoreRequest) *RestoreObjectInput { - s.RestoreRequest = v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *RestoreObjectInput) SetVersionId(v string) *RestoreObjectInput { - s.VersionId = &v - return s -} - -func (s *RestoreObjectInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *RestoreObjectInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s RestoreObjectInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type RestoreObjectOutput struct { - _ struct{} `type:"structure"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // Indicates the path in the provided S3 output location where Select results - // will be restored to. - RestoreOutputPath *string `location:"header" locationName:"x-amz-restore-output-path" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RestoreObjectOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RestoreObjectOutput) GoString() string { - return s.String() -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *RestoreObjectOutput) SetRequestCharged(v string) *RestoreObjectOutput { - s.RequestCharged = &v - return s -} - -// SetRestoreOutputPath sets the RestoreOutputPath field's value. -func (s *RestoreObjectOutput) SetRestoreOutputPath(v string) *RestoreObjectOutput { - s.RestoreOutputPath = &v - return s -} - -// Container for restore job parameters. -type RestoreRequest struct { - _ struct{} `type:"structure"` - - // Lifetime of the active copy in days. Do not use with restores that specify - // OutputLocation. - // - // The Days element is required for regular restores, and must not be provided - // for select requests. - Days *int64 `type:"integer"` - - // The optional description for the job. - Description *string `type:"string"` - - // S3 Glacier related parameters pertaining to this job. Do not use with restores - // that specify OutputLocation. - GlacierJobParameters *GlacierJobParameters `type:"structure"` - - // Describes the location where the restore job's output is stored. - OutputLocation *OutputLocation `type:"structure"` - - // Describes the parameters for Select job types. - SelectParameters *SelectParameters `type:"structure"` - - // Retrieval tier at which the restore will be processed. - Tier *string `type:"string" enum:"Tier"` - - // Type of restore request. - Type *string `type:"string" enum:"RestoreRequestType"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RestoreRequest) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RestoreRequest) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RestoreRequest) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RestoreRequest"} - if s.GlacierJobParameters != nil { - if err := s.GlacierJobParameters.Validate(); err != nil { - invalidParams.AddNested("GlacierJobParameters", err.(request.ErrInvalidParams)) - } - } - if s.OutputLocation != nil { - if err := s.OutputLocation.Validate(); err != nil { - invalidParams.AddNested("OutputLocation", err.(request.ErrInvalidParams)) - } - } - if s.SelectParameters != nil { - if err := s.SelectParameters.Validate(); err != nil { - invalidParams.AddNested("SelectParameters", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDays sets the Days field's value. -func (s *RestoreRequest) SetDays(v int64) *RestoreRequest { - s.Days = &v - return s -} - -// SetDescription sets the Description field's value. -func (s *RestoreRequest) SetDescription(v string) *RestoreRequest { - s.Description = &v - return s -} - -// SetGlacierJobParameters sets the GlacierJobParameters field's value. -func (s *RestoreRequest) SetGlacierJobParameters(v *GlacierJobParameters) *RestoreRequest { - s.GlacierJobParameters = v - return s -} - -// SetOutputLocation sets the OutputLocation field's value. -func (s *RestoreRequest) SetOutputLocation(v *OutputLocation) *RestoreRequest { - s.OutputLocation = v - return s -} - -// SetSelectParameters sets the SelectParameters field's value. -func (s *RestoreRequest) SetSelectParameters(v *SelectParameters) *RestoreRequest { - s.SelectParameters = v - return s -} - -// SetTier sets the Tier field's value. -func (s *RestoreRequest) SetTier(v string) *RestoreRequest { - s.Tier = &v - return s -} - -// SetType sets the Type field's value. -func (s *RestoreRequest) SetType(v string) *RestoreRequest { - s.Type = &v - return s -} - -// Specifies the redirect behavior and when a redirect is applied. For more -// information about routing rules, see Configuring advanced conditional redirects -// (https://docs.aws.amazon.com/AmazonS3/latest/dev/how-to-page-redirect.html#advanced-conditional-redirects) -// in the Amazon S3 User Guide. -type RoutingRule struct { - _ struct{} `type:"structure"` - - // A container for describing a condition that must be met for the specified - // redirect to apply. For example, 1. If request is for pages in the /docs folder, - // redirect to the /documents folder. 2. If request results in HTTP error 4xx, - // redirect request to another host where you might process the error. - Condition *Condition `type:"structure"` - - // Container for redirect information. You can redirect requests to another - // host, to another page, or with another protocol. In the event of an error, - // you can specify a different error code to return. - // - // Redirect is a required field - Redirect *Redirect `type:"structure" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RoutingRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s RoutingRule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *RoutingRule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "RoutingRule"} - if s.Redirect == nil { - invalidParams.Add(request.NewErrParamRequired("Redirect")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCondition sets the Condition field's value. -func (s *RoutingRule) SetCondition(v *Condition) *RoutingRule { - s.Condition = v - return s -} - -// SetRedirect sets the Redirect field's value. -func (s *RoutingRule) SetRedirect(v *Redirect) *RoutingRule { - s.Redirect = v - return s -} - -// Specifies lifecycle rules for an Amazon S3 bucket. For more information, -// see Put Bucket Lifecycle Configuration (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTlifecycle.html) -// in the Amazon S3 API Reference. For examples, see Put Bucket Lifecycle Configuration -// Examples (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html#API_PutBucketLifecycleConfiguration_Examples). -type Rule struct { - _ struct{} `type:"structure"` - - // Specifies the days since the initiation of an incomplete multipart upload - // that Amazon S3 will wait before permanently removing all parts of the upload. - // For more information, see Aborting Incomplete Multipart Uploads Using a Bucket - // Lifecycle Policy (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuoverview.html#mpu-abort-incomplete-mpu-lifecycle-config) - // in the Amazon S3 User Guide. - AbortIncompleteMultipartUpload *AbortIncompleteMultipartUpload `type:"structure"` - - // Specifies the expiration for the lifecycle of the object. - Expiration *LifecycleExpiration `type:"structure"` - - // Unique identifier for the rule. The value can't be longer than 255 characters. - ID *string `type:"string"` - - // Specifies when noncurrent object versions expire. Upon expiration, Amazon - // S3 permanently deletes the noncurrent object versions. You set this lifecycle - // configuration action on a bucket that has versioning enabled (or suspended) - // to request that Amazon S3 delete noncurrent object versions at a specific - // period in the object's lifetime. - NoncurrentVersionExpiration *NoncurrentVersionExpiration `type:"structure"` - - // Container for the transition rule that describes when noncurrent objects - // transition to the STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, GLACIER_IR, - // GLACIER, or DEEP_ARCHIVE storage class. If your bucket is versioning-enabled - // (or versioning is suspended), you can set this action to request that Amazon - // S3 transition noncurrent object versions to the STANDARD_IA, ONEZONE_IA, - // INTELLIGENT_TIERING, GLACIER_IR, GLACIER, or DEEP_ARCHIVE storage class at - // a specific period in the object's lifetime. - NoncurrentVersionTransition *NoncurrentVersionTransition `type:"structure"` - - // Object key prefix that identifies one or more objects to which this rule - // applies. - // - // Replacement must be made for object keys containing special characters (such - // as carriage returns) when using XML requests. For more information, see XML - // related object key constraints (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-keys.html#object-key-xml-related-constraints). - // - // Prefix is a required field - Prefix *string `type:"string" required:"true"` - - // If Enabled, the rule is currently being applied. If Disabled, the rule is - // not currently being applied. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"ExpirationStatus"` - - // Specifies when an object transitions to a specified storage class. For more - // information about Amazon S3 lifecycle configuration rules, see Transitioning - // Objects Using Amazon S3 Lifecycle (https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html) - // in the Amazon S3 User Guide. - Transition *Transition `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Rule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Rule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Rule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Rule"} - if s.Prefix == nil { - invalidParams.Add(request.NewErrParamRequired("Prefix")) - } - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAbortIncompleteMultipartUpload sets the AbortIncompleteMultipartUpload field's value. -func (s *Rule) SetAbortIncompleteMultipartUpload(v *AbortIncompleteMultipartUpload) *Rule { - s.AbortIncompleteMultipartUpload = v - return s -} - -// SetExpiration sets the Expiration field's value. -func (s *Rule) SetExpiration(v *LifecycleExpiration) *Rule { - s.Expiration = v - return s -} - -// SetID sets the ID field's value. -func (s *Rule) SetID(v string) *Rule { - s.ID = &v - return s -} - -// SetNoncurrentVersionExpiration sets the NoncurrentVersionExpiration field's value. -func (s *Rule) SetNoncurrentVersionExpiration(v *NoncurrentVersionExpiration) *Rule { - s.NoncurrentVersionExpiration = v - return s -} - -// SetNoncurrentVersionTransition sets the NoncurrentVersionTransition field's value. -func (s *Rule) SetNoncurrentVersionTransition(v *NoncurrentVersionTransition) *Rule { - s.NoncurrentVersionTransition = v - return s -} - -// SetPrefix sets the Prefix field's value. -func (s *Rule) SetPrefix(v string) *Rule { - s.Prefix = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *Rule) SetStatus(v string) *Rule { - s.Status = &v - return s -} - -// SetTransition sets the Transition field's value. -func (s *Rule) SetTransition(v *Transition) *Rule { - s.Transition = v - return s -} - -// Specifies the use of SSE-KMS to encrypt delivered inventory reports. -type SSEKMS struct { - _ struct{} `locationName:"SSE-KMS" type:"structure"` - - // Specifies the ID of the Amazon Web Services Key Management Service (Amazon - // Web Services KMS) symmetric customer managed key to use for encrypting inventory - // reports. - // - // KeyId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SSEKMS's - // String and GoString methods. - // - // KeyId is a required field - KeyId *string `type:"string" required:"true" sensitive:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s SSEKMS) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s SSEKMS) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SSEKMS) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SSEKMS"} - if s.KeyId == nil { - invalidParams.Add(request.NewErrParamRequired("KeyId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKeyId sets the KeyId field's value. -func (s *SSEKMS) SetKeyId(v string) *SSEKMS { - s.KeyId = &v - return s -} - -// Specifies the use of SSE-S3 to encrypt delivered inventory reports. -type SSES3 struct { - _ struct{} `locationName:"SSE-S3" type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s SSES3) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s SSES3) GoString() string { - return s.String() -} - -// Specifies the byte range of the object to get the records from. A record -// is processed when its first byte is contained by the range. This parameter -// is optional, but when specified, it must not be empty. See RFC 2616, Section -// 14.35.1 about how to specify the start and end of the range. -type ScanRange struct { - _ struct{} `type:"structure"` - - // Specifies the end of the byte range. This parameter is optional. Valid values: - // non-negative integers. The default value is one less than the size of the - // object being queried. If only the End parameter is supplied, it is interpreted - // to mean scan the last N bytes of the file. For example, 50 - // means scan the last 50 bytes. - End *int64 `type:"long"` - - // Specifies the start of the byte range. This parameter is optional. Valid - // values: non-negative integers. The default value is 0. If only start is supplied, - // it means scan from that point to the end of the file. For example, 50 - // means scan from byte 50 until the end of the file. - Start *int64 `type:"long"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ScanRange) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ScanRange) GoString() string { - return s.String() -} - -// SetEnd sets the End field's value. -func (s *ScanRange) SetEnd(v int64) *ScanRange { - s.End = &v - return s -} - -// SetStart sets the Start field's value. -func (s *ScanRange) SetStart(v int64) *ScanRange { - s.Start = &v - return s -} - -// SelectObjectContentEventStreamEvent groups together all EventStream -// events writes for SelectObjectContentEventStream. -// -// These events are: -// -// - ContinuationEvent -// - EndEvent -// - ProgressEvent -// - RecordsEvent -// - StatsEvent -type SelectObjectContentEventStreamEvent interface { - eventSelectObjectContentEventStream() - eventstreamapi.Marshaler - eventstreamapi.Unmarshaler -} - -// SelectObjectContentEventStreamReader provides the interface for reading to the stream. The -// default implementation for this interface will be SelectObjectContentEventStreamData. -// -// The reader's Close method must allow multiple concurrent calls. -// -// These events are: -// -// - ContinuationEvent -// - EndEvent -// - ProgressEvent -// - RecordsEvent -// - StatsEvent -// - SelectObjectContentEventStreamUnknownEvent -type SelectObjectContentEventStreamReader interface { - // Returns a channel of events as they are read from the event stream. - Events() <-chan SelectObjectContentEventStreamEvent - - // Close will stop the reader reading events from the stream. - Close() error - - // Returns any error that has occurred while reading from the event stream. - Err() error -} - -type readSelectObjectContentEventStream struct { - eventReader *eventstreamapi.EventReader - stream chan SelectObjectContentEventStreamEvent - err *eventstreamapi.OnceError - - done chan struct{} - closeOnce sync.Once -} - -func newReadSelectObjectContentEventStream(eventReader *eventstreamapi.EventReader) *readSelectObjectContentEventStream { - r := &readSelectObjectContentEventStream{ - eventReader: eventReader, - stream: make(chan SelectObjectContentEventStreamEvent), - done: make(chan struct{}), - err: eventstreamapi.NewOnceError(), - } - go r.readEventStream() - - return r -} - -// Close will close the underlying event stream reader. -func (r *readSelectObjectContentEventStream) Close() error { - r.closeOnce.Do(r.safeClose) - return r.Err() -} - -func (r *readSelectObjectContentEventStream) ErrorSet() <-chan struct{} { - return r.err.ErrorSet() -} - -func (r *readSelectObjectContentEventStream) Closed() <-chan struct{} { - return r.done -} - -func (r *readSelectObjectContentEventStream) safeClose() { - close(r.done) -} - -func (r *readSelectObjectContentEventStream) Err() error { - return r.err.Err() -} - -func (r *readSelectObjectContentEventStream) Events() <-chan SelectObjectContentEventStreamEvent { - return r.stream -} - -func (r *readSelectObjectContentEventStream) readEventStream() { - defer r.Close() - defer close(r.stream) - - for { - event, err := r.eventReader.ReadEvent() - if err != nil { - if err == io.EOF { - return - } - select { - case <-r.done: - // If closed already ignore the error - return - default: - } - if _, ok := err.(*eventstreamapi.UnknownMessageTypeError); ok { - continue - } - r.err.SetError(err) - return - } - - select { - case r.stream <- event.(SelectObjectContentEventStreamEvent): - case <-r.done: - return - } - } -} - -type unmarshalerForSelectObjectContentEventStreamEvent struct { - metadata protocol.ResponseMetadata -} - -func (u unmarshalerForSelectObjectContentEventStreamEvent) UnmarshalerForEventName(eventType string) (eventstreamapi.Unmarshaler, error) { - switch eventType { - case "Cont": - return &ContinuationEvent{}, nil - case "End": - return &EndEvent{}, nil - case "Progress": - return &ProgressEvent{}, nil - case "Records": - return &RecordsEvent{}, nil - case "Stats": - return &StatsEvent{}, nil - default: - return &SelectObjectContentEventStreamUnknownEvent{Type: eventType}, nil - } -} - -// SelectObjectContentEventStreamUnknownEvent provides a failsafe event for the -// SelectObjectContentEventStream group of events when an unknown event is received. -type SelectObjectContentEventStreamUnknownEvent struct { - Type string - Message eventstream.Message -} - -// The SelectObjectContentEventStreamUnknownEvent is and event in the SelectObjectContentEventStream -// group of events. -func (s *SelectObjectContentEventStreamUnknownEvent) eventSelectObjectContentEventStream() {} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (e *SelectObjectContentEventStreamUnknownEvent) MarshalEvent(pm protocol.PayloadMarshaler) ( - msg eventstream.Message, err error, -) { - return e.Message.Clone(), nil -} - -// UnmarshalEvent unmarshals the EventStream Message into the SelectObjectContentEventStreamData value. -// This method is only used internally within the SDK's EventStream handling. -func (e *SelectObjectContentEventStreamUnknownEvent) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - e.Message = msg.Clone() - return nil -} - -// Request to filter the contents of an Amazon S3 object based on a simple Structured -// Query Language (SQL) statement. In the request, along with the SQL expression, -// you must specify a data serialization format (JSON or CSV) of the object. -// Amazon S3 uses this to parse object data into records. It returns only records -// that match the specified SQL expression. You must also specify the data serialization -// format for the response. For more information, see S3Select API Documentation -// (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectSELECTContent.html). -type SelectObjectContentInput struct { - _ struct{} `locationName:"SelectObjectContentRequest" type:"structure" xmlURI:"http://s3.amazonaws.com/doc/2006-03-01/"` - - // The S3 bucket. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The expression that is used to query the object. - // - // Expression is a required field - Expression *string `type:"string" required:"true"` - - // The type of the provided expression (for example, SQL). - // - // ExpressionType is a required field - ExpressionType *string `type:"string" required:"true" enum:"ExpressionType"` - - // Describes the format of the data in the object that is being queried. - // - // InputSerialization is a required field - InputSerialization *InputSerialization `type:"structure" required:"true"` - - // The object key. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Describes the format of the data that you want Amazon S3 to return in response. - // - // OutputSerialization is a required field - OutputSerialization *OutputSerialization `type:"structure" required:"true"` - - // Specifies if periodic request progress information should be enabled. - RequestProgress *RequestProgress `type:"structure"` - - // The server-side encryption (SSE) algorithm used to encrypt the object. This - // parameter is needed only when the object was created using a checksum algorithm. - // For more information, see Protecting data using SSE-C keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) - // in the Amazon S3 User Guide. - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // The server-side encryption (SSE) customer managed key. This parameter is - // needed only when the object was created using a checksum algorithm. For more - // information, see Protecting data using SSE-C keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) - // in the Amazon S3 User Guide. - // - // SSECustomerKey is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by SelectObjectContentInput's - // String and GoString methods. - SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` - - // The MD5 server-side encryption (SSE) customer managed key. This parameter - // is needed only when the object was created using a checksum algorithm. For - // more information, see Protecting data using SSE-C keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html) - // in the Amazon S3 User Guide. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // Specifies the byte range of the object to get the records from. A record - // is processed when its first byte is contained by the range. This parameter - // is optional, but when specified, it must not be empty. See RFC 2616, Section - // 14.35.1 about how to specify the start and end of the range. - // - // ScanRangemay be used in the following ways: - // - // * 50100 - process only - // the records starting between the bytes 50 and 100 (inclusive, counting - // from zero) - // - // * 50 - process only the records - // starting after the byte 50 - // - // * 50 - process only the records within - // the last 50 bytes of the file. - ScanRange *ScanRange `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s SelectObjectContentInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s SelectObjectContentInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SelectObjectContentInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SelectObjectContentInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Expression == nil { - invalidParams.Add(request.NewErrParamRequired("Expression")) - } - if s.ExpressionType == nil { - invalidParams.Add(request.NewErrParamRequired("ExpressionType")) - } - if s.InputSerialization == nil { - invalidParams.Add(request.NewErrParamRequired("InputSerialization")) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.OutputSerialization == nil { - invalidParams.Add(request.NewErrParamRequired("OutputSerialization")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *SelectObjectContentInput) SetBucket(v string) *SelectObjectContentInput { - s.Bucket = &v - return s -} - -func (s *SelectObjectContentInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *SelectObjectContentInput) SetExpectedBucketOwner(v string) *SelectObjectContentInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetExpression sets the Expression field's value. -func (s *SelectObjectContentInput) SetExpression(v string) *SelectObjectContentInput { - s.Expression = &v - return s -} - -// SetExpressionType sets the ExpressionType field's value. -func (s *SelectObjectContentInput) SetExpressionType(v string) *SelectObjectContentInput { - s.ExpressionType = &v - return s -} - -// SetInputSerialization sets the InputSerialization field's value. -func (s *SelectObjectContentInput) SetInputSerialization(v *InputSerialization) *SelectObjectContentInput { - s.InputSerialization = v - return s -} - -// SetKey sets the Key field's value. -func (s *SelectObjectContentInput) SetKey(v string) *SelectObjectContentInput { - s.Key = &v - return s -} - -// SetOutputSerialization sets the OutputSerialization field's value. -func (s *SelectObjectContentInput) SetOutputSerialization(v *OutputSerialization) *SelectObjectContentInput { - s.OutputSerialization = v - return s -} - -// SetRequestProgress sets the RequestProgress field's value. -func (s *SelectObjectContentInput) SetRequestProgress(v *RequestProgress) *SelectObjectContentInput { - s.RequestProgress = v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *SelectObjectContentInput) SetSSECustomerAlgorithm(v string) *SelectObjectContentInput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKey sets the SSECustomerKey field's value. -func (s *SelectObjectContentInput) SetSSECustomerKey(v string) *SelectObjectContentInput { - s.SSECustomerKey = &v - return s -} - -func (s *SelectObjectContentInput) getSSECustomerKey() (v string) { - if s.SSECustomerKey == nil { - return v - } - return *s.SSECustomerKey -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *SelectObjectContentInput) SetSSECustomerKeyMD5(v string) *SelectObjectContentInput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetScanRange sets the ScanRange field's value. -func (s *SelectObjectContentInput) SetScanRange(v *ScanRange) *SelectObjectContentInput { - s.ScanRange = v - return s -} - -func (s *SelectObjectContentInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *SelectObjectContentInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s SelectObjectContentInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type SelectObjectContentOutput struct { - _ struct{} `type:"structure" payload:"Payload"` - - EventStream *SelectObjectContentEventStream -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s SelectObjectContentOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s SelectObjectContentOutput) GoString() string { - return s.String() -} - -func (s *SelectObjectContentOutput) SetEventStream(v *SelectObjectContentEventStream) *SelectObjectContentOutput { - s.EventStream = v - return s -} -func (s *SelectObjectContentOutput) GetEventStream() *SelectObjectContentEventStream { - return s.EventStream -} - -// GetStream returns the type to interact with the event stream. -func (s *SelectObjectContentOutput) GetStream() *SelectObjectContentEventStream { - return s.EventStream -} - -// Describes the parameters for Select job types. -type SelectParameters struct { - _ struct{} `type:"structure"` - - // The expression that is used to query the object. - // - // Expression is a required field - Expression *string `type:"string" required:"true"` - - // The type of the provided expression (for example, SQL). - // - // ExpressionType is a required field - ExpressionType *string `type:"string" required:"true" enum:"ExpressionType"` - - // Describes the serialization format of the object. - // - // InputSerialization is a required field - InputSerialization *InputSerialization `type:"structure" required:"true"` - - // Describes how the results of the Select job are serialized. - // - // OutputSerialization is a required field - OutputSerialization *OutputSerialization `type:"structure" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s SelectParameters) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s SelectParameters) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SelectParameters) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SelectParameters"} - if s.Expression == nil { - invalidParams.Add(request.NewErrParamRequired("Expression")) - } - if s.ExpressionType == nil { - invalidParams.Add(request.NewErrParamRequired("ExpressionType")) - } - if s.InputSerialization == nil { - invalidParams.Add(request.NewErrParamRequired("InputSerialization")) - } - if s.OutputSerialization == nil { - invalidParams.Add(request.NewErrParamRequired("OutputSerialization")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetExpression sets the Expression field's value. -func (s *SelectParameters) SetExpression(v string) *SelectParameters { - s.Expression = &v - return s -} - -// SetExpressionType sets the ExpressionType field's value. -func (s *SelectParameters) SetExpressionType(v string) *SelectParameters { - s.ExpressionType = &v - return s -} - -// SetInputSerialization sets the InputSerialization field's value. -func (s *SelectParameters) SetInputSerialization(v *InputSerialization) *SelectParameters { - s.InputSerialization = v - return s -} - -// SetOutputSerialization sets the OutputSerialization field's value. -func (s *SelectParameters) SetOutputSerialization(v *OutputSerialization) *SelectParameters { - s.OutputSerialization = v - return s -} - -// Describes the default server-side encryption to apply to new objects in the -// bucket. If a PUT Object request doesn't specify any server-side encryption, -// this default encryption will be applied. If you don't specify a customer -// managed key at configuration, Amazon S3 automatically creates an Amazon Web -// Services KMS key in your Amazon Web Services account the first time that -// you add an object encrypted with SSE-KMS to a bucket. By default, Amazon -// S3 uses this KMS key for SSE-KMS. For more information, see PUT Bucket encryption -// (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTencryption.html) -// in the Amazon S3 API Reference. -type ServerSideEncryptionByDefault struct { - _ struct{} `type:"structure"` - - // Amazon Web Services Key Management Service (KMS) customer Amazon Web Services - // KMS key ID to use for the default encryption. This parameter is allowed if - // and only if SSEAlgorithm is set to aws:kms. - // - // You can specify the key ID or the Amazon Resource Name (ARN) of the KMS key. - // However, if you are using encryption with cross-account or Amazon Web Services - // service operations you must use a fully qualified KMS key ARN. For more information, - // see Using encryption for cross-account operations (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html#bucket-encryption-update-bucket-policy). - // - // For example: - // - // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab - // - // * Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab - // - // Amazon S3 only supports symmetric KMS keys and not asymmetric KMS keys. For - // more information, see Using symmetric and asymmetric keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) - // in the Amazon Web Services Key Management Service Developer Guide. - // - // KMSMasterKeyID is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by ServerSideEncryptionByDefault's - // String and GoString methods. - KMSMasterKeyID *string `type:"string" sensitive:"true"` - - // Server-side encryption algorithm to use for the default encryption. - // - // SSEAlgorithm is a required field - SSEAlgorithm *string `type:"string" required:"true" enum:"ServerSideEncryption"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ServerSideEncryptionByDefault) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ServerSideEncryptionByDefault) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ServerSideEncryptionByDefault) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ServerSideEncryptionByDefault"} - if s.SSEAlgorithm == nil { - invalidParams.Add(request.NewErrParamRequired("SSEAlgorithm")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKMSMasterKeyID sets the KMSMasterKeyID field's value. -func (s *ServerSideEncryptionByDefault) SetKMSMasterKeyID(v string) *ServerSideEncryptionByDefault { - s.KMSMasterKeyID = &v - return s -} - -// SetSSEAlgorithm sets the SSEAlgorithm field's value. -func (s *ServerSideEncryptionByDefault) SetSSEAlgorithm(v string) *ServerSideEncryptionByDefault { - s.SSEAlgorithm = &v - return s -} - -// Specifies the default server-side-encryption configuration. -type ServerSideEncryptionConfiguration struct { - _ struct{} `type:"structure"` - - // Container for information about a particular server-side encryption configuration - // rule. - // - // Rules is a required field - Rules []*ServerSideEncryptionRule `locationName:"Rule" type:"list" flattened:"true" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ServerSideEncryptionConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ServerSideEncryptionConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ServerSideEncryptionConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ServerSideEncryptionConfiguration"} - if s.Rules == nil { - invalidParams.Add(request.NewErrParamRequired("Rules")) - } - if s.Rules != nil { - for i, v := range s.Rules { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRules sets the Rules field's value. -func (s *ServerSideEncryptionConfiguration) SetRules(v []*ServerSideEncryptionRule) *ServerSideEncryptionConfiguration { - s.Rules = v - return s -} - -// Specifies the default server-side encryption configuration. -type ServerSideEncryptionRule struct { - _ struct{} `type:"structure"` - - // Specifies the default server-side encryption to apply to new objects in the - // bucket. If a PUT Object request doesn't specify any server-side encryption, - // this default encryption will be applied. - ApplyServerSideEncryptionByDefault *ServerSideEncryptionByDefault `type:"structure"` - - // Specifies whether Amazon S3 should use an S3 Bucket Key with server-side - // encryption using KMS (SSE-KMS) for new objects in the bucket. Existing objects - // are not affected. Setting the BucketKeyEnabled element to true causes Amazon - // S3 to use an S3 Bucket Key. By default, S3 Bucket Key is not enabled. - // - // For more information, see Amazon S3 Bucket Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) - // in the Amazon S3 User Guide. - BucketKeyEnabled *bool `type:"boolean"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ServerSideEncryptionRule) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ServerSideEncryptionRule) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ServerSideEncryptionRule) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ServerSideEncryptionRule"} - if s.ApplyServerSideEncryptionByDefault != nil { - if err := s.ApplyServerSideEncryptionByDefault.Validate(); err != nil { - invalidParams.AddNested("ApplyServerSideEncryptionByDefault", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetApplyServerSideEncryptionByDefault sets the ApplyServerSideEncryptionByDefault field's value. -func (s *ServerSideEncryptionRule) SetApplyServerSideEncryptionByDefault(v *ServerSideEncryptionByDefault) *ServerSideEncryptionRule { - s.ApplyServerSideEncryptionByDefault = v - return s -} - -// SetBucketKeyEnabled sets the BucketKeyEnabled field's value. -func (s *ServerSideEncryptionRule) SetBucketKeyEnabled(v bool) *ServerSideEncryptionRule { - s.BucketKeyEnabled = &v - return s -} - -// A container that describes additional filters for identifying the source -// objects that you want to replicate. You can choose to enable or disable the -// replication of these objects. Currently, Amazon S3 supports only the filter -// that you can specify for objects created with server-side encryption using -// a customer managed key stored in Amazon Web Services Key Management Service -// (SSE-KMS). -type SourceSelectionCriteria struct { - _ struct{} `type:"structure"` - - // A filter that you can specify for selections for modifications on replicas. - // Amazon S3 doesn't replicate replica modifications by default. In the latest - // version of replication configuration (when Filter is specified), you can - // specify this element and set the status to Enabled to replicate modifications - // on replicas. - // - // If you don't specify the Filter element, Amazon S3 assumes that the replication - // configuration is the earlier version, V1. In the earlier version, this element - // is not allowed - ReplicaModifications *ReplicaModifications `type:"structure"` - - // A container for filter information for the selection of Amazon S3 objects - // encrypted with Amazon Web Services KMS. If you include SourceSelectionCriteria - // in the replication configuration, this element is required. - SseKmsEncryptedObjects *SseKmsEncryptedObjects `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s SourceSelectionCriteria) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s SourceSelectionCriteria) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SourceSelectionCriteria) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SourceSelectionCriteria"} - if s.ReplicaModifications != nil { - if err := s.ReplicaModifications.Validate(); err != nil { - invalidParams.AddNested("ReplicaModifications", err.(request.ErrInvalidParams)) - } - } - if s.SseKmsEncryptedObjects != nil { - if err := s.SseKmsEncryptedObjects.Validate(); err != nil { - invalidParams.AddNested("SseKmsEncryptedObjects", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetReplicaModifications sets the ReplicaModifications field's value. -func (s *SourceSelectionCriteria) SetReplicaModifications(v *ReplicaModifications) *SourceSelectionCriteria { - s.ReplicaModifications = v - return s -} - -// SetSseKmsEncryptedObjects sets the SseKmsEncryptedObjects field's value. -func (s *SourceSelectionCriteria) SetSseKmsEncryptedObjects(v *SseKmsEncryptedObjects) *SourceSelectionCriteria { - s.SseKmsEncryptedObjects = v - return s -} - -// A container for filter information for the selection of S3 objects encrypted -// with Amazon Web Services KMS. -type SseKmsEncryptedObjects struct { - _ struct{} `type:"structure"` - - // Specifies whether Amazon S3 replicates objects created with server-side encryption - // using an Amazon Web Services KMS key stored in Amazon Web Services Key Management - // Service. - // - // Status is a required field - Status *string `type:"string" required:"true" enum:"SseKmsEncryptedObjectsStatus"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s SseKmsEncryptedObjects) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s SseKmsEncryptedObjects) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *SseKmsEncryptedObjects) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "SseKmsEncryptedObjects"} - if s.Status == nil { - invalidParams.Add(request.NewErrParamRequired("Status")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStatus sets the Status field's value. -func (s *SseKmsEncryptedObjects) SetStatus(v string) *SseKmsEncryptedObjects { - s.Status = &v - return s -} - -// Container for the stats details. -type Stats struct { - _ struct{} `type:"structure"` - - // The total number of uncompressed object bytes processed. - BytesProcessed *int64 `type:"long"` - - // The total number of bytes of records payload data returned. - BytesReturned *int64 `type:"long"` - - // The total number of object bytes scanned. - BytesScanned *int64 `type:"long"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Stats) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Stats) GoString() string { - return s.String() -} - -// SetBytesProcessed sets the BytesProcessed field's value. -func (s *Stats) SetBytesProcessed(v int64) *Stats { - s.BytesProcessed = &v - return s -} - -// SetBytesReturned sets the BytesReturned field's value. -func (s *Stats) SetBytesReturned(v int64) *Stats { - s.BytesReturned = &v - return s -} - -// SetBytesScanned sets the BytesScanned field's value. -func (s *Stats) SetBytesScanned(v int64) *Stats { - s.BytesScanned = &v - return s -} - -// Container for the Stats Event. -type StatsEvent struct { - _ struct{} `locationName:"StatsEvent" type:"structure" payload:"Details"` - - // The Stats event details. - Details *Stats `locationName:"Details" type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StatsEvent) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StatsEvent) GoString() string { - return s.String() -} - -// SetDetails sets the Details field's value. -func (s *StatsEvent) SetDetails(v *Stats) *StatsEvent { - s.Details = v - return s -} - -// The StatsEvent is and event in the SelectObjectContentEventStream group of events. -func (s *StatsEvent) eventSelectObjectContentEventStream() {} - -// UnmarshalEvent unmarshals the EventStream Message into the StatsEvent value. -// This method is only used internally within the SDK's EventStream handling. -func (s *StatsEvent) UnmarshalEvent( - payloadUnmarshaler protocol.PayloadUnmarshaler, - msg eventstream.Message, -) error { - if err := payloadUnmarshaler.UnmarshalPayload( - bytes.NewReader(msg.Payload), s, - ); err != nil { - return err - } - return nil -} - -// MarshalEvent marshals the type into an stream event value. This method -// should only used internally within the SDK's EventStream handling. -func (s *StatsEvent) MarshalEvent(pm protocol.PayloadMarshaler) (msg eventstream.Message, err error) { - msg.Headers.Set(eventstreamapi.MessageTypeHeader, eventstream.StringValue(eventstreamapi.EventMessageType)) - var buf bytes.Buffer - if err = pm.MarshalPayload(&buf, s); err != nil { - return eventstream.Message{}, err - } - msg.Payload = buf.Bytes() - return msg, err -} - -// Specifies data related to access patterns to be collected and made available -// to analyze the tradeoffs between different storage classes for an Amazon -// S3 bucket. -type StorageClassAnalysis struct { - _ struct{} `type:"structure"` - - // Specifies how data related to the storage class analysis for an Amazon S3 - // bucket should be exported. - DataExport *StorageClassAnalysisDataExport `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StorageClassAnalysis) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StorageClassAnalysis) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StorageClassAnalysis) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StorageClassAnalysis"} - if s.DataExport != nil { - if err := s.DataExport.Validate(); err != nil { - invalidParams.AddNested("DataExport", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDataExport sets the DataExport field's value. -func (s *StorageClassAnalysis) SetDataExport(v *StorageClassAnalysisDataExport) *StorageClassAnalysis { - s.DataExport = v - return s -} - -// Container for data related to the storage class analysis for an Amazon S3 -// bucket for export. -type StorageClassAnalysisDataExport struct { - _ struct{} `type:"structure"` - - // The place to store the data for an analysis. - // - // Destination is a required field - Destination *AnalyticsExportDestination `type:"structure" required:"true"` - - // The version of the output schema to use when exporting data. Must be V_1. - // - // OutputSchemaVersion is a required field - OutputSchemaVersion *string `type:"string" required:"true" enum:"StorageClassAnalysisSchemaVersion"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StorageClassAnalysisDataExport) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s StorageClassAnalysisDataExport) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *StorageClassAnalysisDataExport) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "StorageClassAnalysisDataExport"} - if s.Destination == nil { - invalidParams.Add(request.NewErrParamRequired("Destination")) - } - if s.OutputSchemaVersion == nil { - invalidParams.Add(request.NewErrParamRequired("OutputSchemaVersion")) - } - if s.Destination != nil { - if err := s.Destination.Validate(); err != nil { - invalidParams.AddNested("Destination", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDestination sets the Destination field's value. -func (s *StorageClassAnalysisDataExport) SetDestination(v *AnalyticsExportDestination) *StorageClassAnalysisDataExport { - s.Destination = v - return s -} - -// SetOutputSchemaVersion sets the OutputSchemaVersion field's value. -func (s *StorageClassAnalysisDataExport) SetOutputSchemaVersion(v string) *StorageClassAnalysisDataExport { - s.OutputSchemaVersion = &v - return s -} - -// A container of a key value name pair. -type Tag struct { - _ struct{} `type:"structure"` - - // Name of the object key. - // - // Key is a required field - Key *string `min:"1" type:"string" required:"true"` - - // Value of the tag. - // - // Value is a required field - Value *string `type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Tag) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Tag) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tag) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tag"} - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetKey sets the Key field's value. -func (s *Tag) SetKey(v string) *Tag { - s.Key = &v - return s -} - -// SetValue sets the Value field's value. -func (s *Tag) SetValue(v string) *Tag { - s.Value = &v - return s -} - -// Container for TagSet elements. -type Tagging struct { - _ struct{} `type:"structure"` - - // A collection for a set of tags - // - // TagSet is a required field - TagSet []*Tag `locationNameList:"Tag" type:"list" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Tagging) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Tagging) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tagging) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tagging"} - if s.TagSet == nil { - invalidParams.Add(request.NewErrParamRequired("TagSet")) - } - if s.TagSet != nil { - for i, v := range s.TagSet { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TagSet", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetTagSet sets the TagSet field's value. -func (s *Tagging) SetTagSet(v []*Tag) *Tagging { - s.TagSet = v - return s -} - -// Container for granting information. -// -// Buckets that use the bucket owner enforced setting for Object Ownership don't -// support target grants. For more information, see Permissions server access -// log delivery (https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html#grant-log-delivery-permissions-general) -// in the Amazon S3 User Guide. -type TargetGrant struct { - _ struct{} `type:"structure"` - - // Container for the person being granted permissions. - Grantee *Grantee `type:"structure" xmlPrefix:"xsi" xmlURI:"http://www.w3.org/2001/XMLSchema-instance"` - - // Logging permissions assigned to the grantee for the bucket. - Permission *string `type:"string" enum:"BucketLogsPermission"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TargetGrant) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TargetGrant) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TargetGrant) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TargetGrant"} - if s.Grantee != nil { - if err := s.Grantee.Validate(); err != nil { - invalidParams.AddNested("Grantee", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetGrantee sets the Grantee field's value. -func (s *TargetGrant) SetGrantee(v *Grantee) *TargetGrant { - s.Grantee = v - return s -} - -// SetPermission sets the Permission field's value. -func (s *TargetGrant) SetPermission(v string) *TargetGrant { - s.Permission = &v - return s -} - -// The S3 Intelligent-Tiering storage class is designed to optimize storage -// costs by automatically moving data to the most cost-effective storage access -// tier, without additional operational overhead. -type Tiering struct { - _ struct{} `type:"structure"` - - // S3 Intelligent-Tiering access tier. See Storage class for automatically optimizing - // frequently and infrequently accessed objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access) - // for a list of access tiers in the S3 Intelligent-Tiering storage class. - // - // AccessTier is a required field - AccessTier *string `type:"string" required:"true" enum:"IntelligentTieringAccessTier"` - - // The number of consecutive days of no access after which an object will be - // eligible to be transitioned to the corresponding tier. The minimum number - // of days specified for Archive Access tier must be at least 90 days and Deep - // Archive Access tier must be at least 180 days. The maximum can be up to 2 - // years (730 days). - // - // Days is a required field - Days *int64 `type:"integer" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Tiering) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Tiering) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Tiering) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Tiering"} - if s.AccessTier == nil { - invalidParams.Add(request.NewErrParamRequired("AccessTier")) - } - if s.Days == nil { - invalidParams.Add(request.NewErrParamRequired("Days")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAccessTier sets the AccessTier field's value. -func (s *Tiering) SetAccessTier(v string) *Tiering { - s.AccessTier = &v - return s -} - -// SetDays sets the Days field's value. -func (s *Tiering) SetDays(v int64) *Tiering { - s.Days = &v - return s -} - -// A container for specifying the configuration for publication of messages -// to an Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 -// detects specified events. -type TopicConfiguration struct { - _ struct{} `type:"structure"` - - // The Amazon S3 bucket event about which to send notifications. For more information, - // see Supported Event Types (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - // in the Amazon S3 User Guide. - // - // Events is a required field - Events []*string `locationName:"Event" type:"list" flattened:"true" required:"true" enum:"Event"` - - // Specifies object key name filtering rules. For information about key name - // filtering, see Configuring Event Notifications (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) - // in the Amazon S3 User Guide. - Filter *NotificationConfigurationFilter `type:"structure"` - - // An optional unique identifier for configurations in a notification configuration. - // If you don't provide one, Amazon S3 will assign an ID. - Id *string `type:"string"` - - // The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 - // publishes a message when it detects events of the specified type. - // - // TopicArn is a required field - TopicArn *string `locationName:"Topic" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TopicConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TopicConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *TopicConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "TopicConfiguration"} - if s.Events == nil { - invalidParams.Add(request.NewErrParamRequired("Events")) - } - if s.TopicArn == nil { - invalidParams.Add(request.NewErrParamRequired("TopicArn")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetEvents sets the Events field's value. -func (s *TopicConfiguration) SetEvents(v []*string) *TopicConfiguration { - s.Events = v - return s -} - -// SetFilter sets the Filter field's value. -func (s *TopicConfiguration) SetFilter(v *NotificationConfigurationFilter) *TopicConfiguration { - s.Filter = v - return s -} - -// SetId sets the Id field's value. -func (s *TopicConfiguration) SetId(v string) *TopicConfiguration { - s.Id = &v - return s -} - -// SetTopicArn sets the TopicArn field's value. -func (s *TopicConfiguration) SetTopicArn(v string) *TopicConfiguration { - s.TopicArn = &v - return s -} - -// A container for specifying the configuration for publication of messages -// to an Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 -// detects specified events. This data type is deprecated. Use TopicConfiguration -// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_TopicConfiguration.html) -// instead. -type TopicConfigurationDeprecated struct { - _ struct{} `type:"structure"` - - // Bucket event for which to send notifications. - // - // Deprecated: Event has been deprecated - Event *string `deprecated:"true" type:"string" enum:"Event"` - - // A collection of events related to objects - Events []*string `locationName:"Event" type:"list" flattened:"true" enum:"Event"` - - // An optional unique identifier for configurations in a notification configuration. - // If you don't provide one, Amazon S3 will assign an ID. - Id *string `type:"string"` - - // Amazon SNS topic to which Amazon S3 will publish a message to report the - // specified events for the bucket. - Topic *string `type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TopicConfigurationDeprecated) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s TopicConfigurationDeprecated) GoString() string { - return s.String() -} - -// SetEvent sets the Event field's value. -func (s *TopicConfigurationDeprecated) SetEvent(v string) *TopicConfigurationDeprecated { - s.Event = &v - return s -} - -// SetEvents sets the Events field's value. -func (s *TopicConfigurationDeprecated) SetEvents(v []*string) *TopicConfigurationDeprecated { - s.Events = v - return s -} - -// SetId sets the Id field's value. -func (s *TopicConfigurationDeprecated) SetId(v string) *TopicConfigurationDeprecated { - s.Id = &v - return s -} - -// SetTopic sets the Topic field's value. -func (s *TopicConfigurationDeprecated) SetTopic(v string) *TopicConfigurationDeprecated { - s.Topic = &v - return s -} - -// Specifies when an object transitions to a specified storage class. For more -// information about Amazon S3 lifecycle configuration rules, see Transitioning -// Objects Using Amazon S3 Lifecycle (https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-transition-general-considerations.html) -// in the Amazon S3 User Guide. -type Transition struct { - _ struct{} `type:"structure"` - - // Indicates when objects are transitioned to the specified storage class. The - // date value must be in ISO 8601 format. The time is always midnight UTC. - Date *time.Time `type:"timestamp" timestampFormat:"iso8601"` - - // Indicates the number of days after creation when objects are transitioned - // to the specified storage class. The value must be a positive integer. - Days *int64 `type:"integer"` - - // The storage class to which you want the object to transition. - StorageClass *string `type:"string" enum:"TransitionStorageClass"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Transition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Transition) GoString() string { - return s.String() -} - -// SetDate sets the Date field's value. -func (s *Transition) SetDate(v time.Time) *Transition { - s.Date = &v - return s -} - -// SetDays sets the Days field's value. -func (s *Transition) SetDays(v int64) *Transition { - s.Days = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *Transition) SetStorageClass(v string) *Transition { - s.StorageClass = &v - return s -} - -type UploadPartCopyInput struct { - _ struct{} `locationName:"UploadPartCopyRequest" type:"structure"` - - // The bucket name. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Specifies the source object for the copy operation. You specify the value - // in one of two formats, depending on whether you want to access the source - // object through an access point (https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points.html): - // - // * For objects not accessed through an access point, specify the name of - // the source bucket and key of the source object, separated by a slash (/). - // For example, to copy the object reports/january.pdf from the bucket awsexamplebucket, - // use awsexamplebucket/reports/january.pdf. The value must be URL-encoded. - // - // * For objects accessed through access points, specify the Amazon Resource - // Name (ARN) of the object as accessed through the access point, in the - // format arn:aws:s3:::accesspoint//object/. - // For example, to copy the object reports/january.pdf through access point - // my-access-point owned by account 123456789012 in Region us-west-2, use - // the URL encoding of arn:aws:s3:us-west-2:123456789012:accesspoint/my-access-point/object/reports/january.pdf. - // The value must be URL encoded. Amazon S3 supports copy operations using - // access points only when the source and destination buckets are in the - // same Amazon Web Services Region. Alternatively, for objects accessed through - // Amazon S3 on Outposts, specify the ARN of the object as accessed in the - // format arn:aws:s3-outposts:::outpost//object/. - // For example, to copy the object reports/january.pdf through outpost my-outpost - // owned by account 123456789012 in Region us-west-2, use the URL encoding - // of arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/object/reports/january.pdf. - // The value must be URL-encoded. - // - // To copy a specific version of an object, append ?versionId= to - // the value (for example, awsexamplebucket/reports/january.pdf?versionId=QUpfdndhfd8438MNFDN93jdnJFkdmqnh893). - // If you don't specify a version ID, Amazon S3 copies the latest version of - // the source object. - // - // CopySource is a required field - CopySource *string `location:"header" locationName:"x-amz-copy-source" type:"string" required:"true"` - - // Copies the object if its entity tag (ETag) matches the specified tag. - CopySourceIfMatch *string `location:"header" locationName:"x-amz-copy-source-if-match" type:"string"` - - // Copies the object if it has been modified since the specified time. - CopySourceIfModifiedSince *time.Time `location:"header" locationName:"x-amz-copy-source-if-modified-since" type:"timestamp"` - - // Copies the object if its entity tag (ETag) is different than the specified - // ETag. - CopySourceIfNoneMatch *string `location:"header" locationName:"x-amz-copy-source-if-none-match" type:"string"` - - // Copies the object if it hasn't been modified since the specified time. - CopySourceIfUnmodifiedSince *time.Time `location:"header" locationName:"x-amz-copy-source-if-unmodified-since" type:"timestamp"` - - // The range of bytes to copy from the source object. The range value must use - // the form bytes=first-last, where the first and last are the zero-based byte - // offsets to copy. For example, bytes=0-9 indicates that you want to copy the - // first 10 bytes of the source. You can copy a range only if the source object - // is greater than 5 MB. - CopySourceRange *string `location:"header" locationName:"x-amz-copy-source-range" type:"string"` - - // Specifies the algorithm to use when decrypting the source object (for example, - // AES256). - CopySourceSSECustomerAlgorithm *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-algorithm" type:"string"` - - // Specifies the customer-provided encryption key for Amazon S3 to use to decrypt - // the source object. The encryption key provided in this header must be one - // that was used when the source object was created. - // - // CopySourceSSECustomerKey is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UploadPartCopyInput's - // String and GoString methods. - CopySourceSSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key" type:"string" sensitive:"true"` - - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure that the - // encryption key was transmitted without error. - CopySourceSSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-copy-source-server-side-encryption-customer-key-MD5" type:"string"` - - // The account ID of the expected destination bucket owner. If the destination - // bucket is owned by a different account, the request fails with the HTTP status - // code 403 Forbidden (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // The account ID of the expected source bucket owner. If the source bucket - // is owned by a different account, the request fails with the HTTP status code - // 403 Forbidden (access denied). - ExpectedSourceBucketOwner *string `location:"header" locationName:"x-amz-source-expected-bucket-owner" type:"string"` - - // Object key for which the multipart upload was initiated. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Part number of part being copied. This is a positive integer between 1 and - // 10,000. - // - // PartNumber is a required field - PartNumber *int64 `location:"querystring" locationName:"partNumber" type:"integer" required:"true"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // Specifies the algorithm to use to when encrypting the object (for example, - // AES256). - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting - // data. This value is used to store the object and then it is discarded; Amazon - // S3 does not store the encryption key. The key must be appropriate for use - // with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm - // header. This must be the same encryption key specified in the initiate multipart - // upload request. - // - // SSECustomerKey is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UploadPartCopyInput's - // String and GoString methods. - SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` - - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure that the - // encryption key was transmitted without error. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // Upload ID identifying the multipart upload whose part is being copied. - // - // UploadId is a required field - UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UploadPartCopyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UploadPartCopyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UploadPartCopyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UploadPartCopyInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.CopySource == nil { - invalidParams.Add(request.NewErrParamRequired("CopySource")) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.PartNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PartNumber")) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBucket sets the Bucket field's value. -func (s *UploadPartCopyInput) SetBucket(v string) *UploadPartCopyInput { - s.Bucket = &v - return s -} - -func (s *UploadPartCopyInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetCopySource sets the CopySource field's value. -func (s *UploadPartCopyInput) SetCopySource(v string) *UploadPartCopyInput { - s.CopySource = &v - return s -} - -// SetCopySourceIfMatch sets the CopySourceIfMatch field's value. -func (s *UploadPartCopyInput) SetCopySourceIfMatch(v string) *UploadPartCopyInput { - s.CopySourceIfMatch = &v - return s -} - -// SetCopySourceIfModifiedSince sets the CopySourceIfModifiedSince field's value. -func (s *UploadPartCopyInput) SetCopySourceIfModifiedSince(v time.Time) *UploadPartCopyInput { - s.CopySourceIfModifiedSince = &v - return s -} - -// SetCopySourceIfNoneMatch sets the CopySourceIfNoneMatch field's value. -func (s *UploadPartCopyInput) SetCopySourceIfNoneMatch(v string) *UploadPartCopyInput { - s.CopySourceIfNoneMatch = &v - return s -} - -// SetCopySourceIfUnmodifiedSince sets the CopySourceIfUnmodifiedSince field's value. -func (s *UploadPartCopyInput) SetCopySourceIfUnmodifiedSince(v time.Time) *UploadPartCopyInput { - s.CopySourceIfUnmodifiedSince = &v - return s -} - -// SetCopySourceRange sets the CopySourceRange field's value. -func (s *UploadPartCopyInput) SetCopySourceRange(v string) *UploadPartCopyInput { - s.CopySourceRange = &v - return s -} - -// SetCopySourceSSECustomerAlgorithm sets the CopySourceSSECustomerAlgorithm field's value. -func (s *UploadPartCopyInput) SetCopySourceSSECustomerAlgorithm(v string) *UploadPartCopyInput { - s.CopySourceSSECustomerAlgorithm = &v - return s -} - -// SetCopySourceSSECustomerKey sets the CopySourceSSECustomerKey field's value. -func (s *UploadPartCopyInput) SetCopySourceSSECustomerKey(v string) *UploadPartCopyInput { - s.CopySourceSSECustomerKey = &v - return s -} - -func (s *UploadPartCopyInput) getCopySourceSSECustomerKey() (v string) { - if s.CopySourceSSECustomerKey == nil { - return v - } - return *s.CopySourceSSECustomerKey -} - -// SetCopySourceSSECustomerKeyMD5 sets the CopySourceSSECustomerKeyMD5 field's value. -func (s *UploadPartCopyInput) SetCopySourceSSECustomerKeyMD5(v string) *UploadPartCopyInput { - s.CopySourceSSECustomerKeyMD5 = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *UploadPartCopyInput) SetExpectedBucketOwner(v string) *UploadPartCopyInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetExpectedSourceBucketOwner sets the ExpectedSourceBucketOwner field's value. -func (s *UploadPartCopyInput) SetExpectedSourceBucketOwner(v string) *UploadPartCopyInput { - s.ExpectedSourceBucketOwner = &v - return s -} - -// SetKey sets the Key field's value. -func (s *UploadPartCopyInput) SetKey(v string) *UploadPartCopyInput { - s.Key = &v - return s -} - -// SetPartNumber sets the PartNumber field's value. -func (s *UploadPartCopyInput) SetPartNumber(v int64) *UploadPartCopyInput { - s.PartNumber = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *UploadPartCopyInput) SetRequestPayer(v string) *UploadPartCopyInput { - s.RequestPayer = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *UploadPartCopyInput) SetSSECustomerAlgorithm(v string) *UploadPartCopyInput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKey sets the SSECustomerKey field's value. -func (s *UploadPartCopyInput) SetSSECustomerKey(v string) *UploadPartCopyInput { - s.SSECustomerKey = &v - return s -} - -func (s *UploadPartCopyInput) getSSECustomerKey() (v string) { - if s.SSECustomerKey == nil { - return v - } - return *s.SSECustomerKey -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *UploadPartCopyInput) SetSSECustomerKeyMD5(v string) *UploadPartCopyInput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *UploadPartCopyInput) SetUploadId(v string) *UploadPartCopyInput { - s.UploadId = &v - return s -} - -func (s *UploadPartCopyInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *UploadPartCopyInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s UploadPartCopyInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type UploadPartCopyOutput struct { - _ struct{} `type:"structure" payload:"CopyPartResult"` - - // Indicates whether the multipart upload uses an S3 Bucket Key for server-side - // encryption with Amazon Web Services KMS (SSE-KMS). - BucketKeyEnabled *bool `location:"header" locationName:"x-amz-server-side-encryption-bucket-key-enabled" type:"boolean"` - - // Container for all response elements. - CopyPartResult *CopyPartResult `type:"structure"` - - // The version of the source object that was copied, if you have enabled versioning - // on the source bucket. - CopySourceVersionId *string `location:"header" locationName:"x-amz-copy-source-version-id" type:"string"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header confirming the encryption algorithm - // used. - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round-trip message integrity - // verification of the customer-provided encryption key. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // If present, specifies the ID of the Amazon Web Services Key Management Service - // (Amazon Web Services KMS) symmetric customer managed key that was used for - // the object. - // - // SSEKMSKeyId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UploadPartCopyOutput's - // String and GoString methods. - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - - // The server-side encryption algorithm used when storing this object in Amazon - // S3 (for example, AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UploadPartCopyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UploadPartCopyOutput) GoString() string { - return s.String() -} - -// SetBucketKeyEnabled sets the BucketKeyEnabled field's value. -func (s *UploadPartCopyOutput) SetBucketKeyEnabled(v bool) *UploadPartCopyOutput { - s.BucketKeyEnabled = &v - return s -} - -// SetCopyPartResult sets the CopyPartResult field's value. -func (s *UploadPartCopyOutput) SetCopyPartResult(v *CopyPartResult) *UploadPartCopyOutput { - s.CopyPartResult = v - return s -} - -// SetCopySourceVersionId sets the CopySourceVersionId field's value. -func (s *UploadPartCopyOutput) SetCopySourceVersionId(v string) *UploadPartCopyOutput { - s.CopySourceVersionId = &v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *UploadPartCopyOutput) SetRequestCharged(v string) *UploadPartCopyOutput { - s.RequestCharged = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *UploadPartCopyOutput) SetSSECustomerAlgorithm(v string) *UploadPartCopyOutput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *UploadPartCopyOutput) SetSSECustomerKeyMD5(v string) *UploadPartCopyOutput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *UploadPartCopyOutput) SetSSEKMSKeyId(v string) *UploadPartCopyOutput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *UploadPartCopyOutput) SetServerSideEncryption(v string) *UploadPartCopyOutput { - s.ServerSideEncryption = &v - return s -} - -type UploadPartInput struct { - _ struct{} `locationName:"UploadPartRequest" type:"structure" payload:"Body"` - - // Object data. - Body io.ReadSeeker `type:"blob"` - - // The name of the bucket to which the multipart upload was initiated. - // - // When using this action with an access point, you must direct requests to - // the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. - // When using this action with an access point through the Amazon Web Services - // SDKs, you provide the access point ARN in place of the bucket name. For more - // information about access point ARNs, see Using access points (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html) - // in the Amazon S3 User Guide. - // - // When using this action with Amazon S3 on Outposts, you must direct requests - // to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form - // AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When - // using this action with S3 on Outposts through the Amazon Web Services SDKs, - // you provide the Outposts bucket ARN in place of the bucket name. For more - // information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) - // in the Amazon S3 User Guide. - // - // Bucket is a required field - Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` - - // Indicates the algorithm used to create the checksum for the object when using - // the SDK. This header will not provide any additional functionality if not - // using the SDK. When sending this header, there must be a corresponding x-amz-checksum - // or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with - // the HTTP status code 400 Bad Request. For more information, see Checking - // object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // If you provide an individual checksum, Amazon S3 ignores any provided ChecksumAlgorithm - // parameter. - // - // This checksum algorithm must be the same for all parts and it match the checksum - // value supplied in the CreateMultipartUpload request. - // - // The AWS SDK for Go v1 does not support automatic computing request payload - // checksum. This feature is available in the AWS SDK for Go v2. If a value - // is specified for this parameter, the matching algorithm's checksum member - // must be populated with the algorithm's checksum of the request payload. - ChecksumAlgorithm *string `location:"header" locationName:"x-amz-sdk-checksum-algorithm" type:"string" enum:"ChecksumAlgorithm"` - - // This header can be used as a data integrity check to verify that the data - // received is the same data that was originally sent. This header specifies - // the base64-encoded, 32-bit CRC32 checksum of the object. For more information, - // see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - ChecksumCRC32 *string `location:"header" locationName:"x-amz-checksum-crc32" type:"string"` - - // This header can be used as a data integrity check to verify that the data - // received is the same data that was originally sent. This header specifies - // the base64-encoded, 32-bit CRC32C checksum of the object. For more information, - // see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - ChecksumCRC32C *string `location:"header" locationName:"x-amz-checksum-crc32c" type:"string"` - - // This header can be used as a data integrity check to verify that the data - // received is the same data that was originally sent. This header specifies - // the base64-encoded, 160-bit SHA-1 digest of the object. For more information, - // see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - ChecksumSHA1 *string `location:"header" locationName:"x-amz-checksum-sha1" type:"string"` - - // This header can be used as a data integrity check to verify that the data - // received is the same data that was originally sent. This header specifies - // the base64-encoded, 256-bit SHA-256 digest of the object. For more information, - // see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - ChecksumSHA256 *string `location:"header" locationName:"x-amz-checksum-sha256" type:"string"` - - // Size of the body in bytes. This parameter is useful when the size of the - // body cannot be determined automatically. - ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` - - // The base64-encoded 128-bit MD5 digest of the part data. This parameter is - // auto-populated when using the command from the CLI. This parameter is required - // if object lock parameters are specified. - ContentMD5 *string `location:"header" locationName:"Content-MD5" type:"string"` - - // The account ID of the expected bucket owner. If the bucket is owned by a - // different account, the request fails with the HTTP status code 403 Forbidden - // (access denied). - ExpectedBucketOwner *string `location:"header" locationName:"x-amz-expected-bucket-owner" type:"string"` - - // Object key for which the multipart upload was initiated. - // - // Key is a required field - Key *string `location:"uri" locationName:"Key" min:"1" type:"string" required:"true"` - - // Part number of part being uploaded. This is a positive integer between 1 - // and 10,000. - // - // PartNumber is a required field - PartNumber *int64 `location:"querystring" locationName:"partNumber" type:"integer" required:"true"` - - // Confirms that the requester knows that they will be charged for the request. - // Bucket owners need not specify this parameter in their requests. For information - // about downloading objects from Requester Pays buckets, see Downloading Objects - // in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) - // in the Amazon S3 User Guide. - RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` - - // Specifies the algorithm to use to when encrypting the object (for example, - // AES256). - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // Specifies the customer-provided encryption key for Amazon S3 to use in encrypting - // data. This value is used to store the object and then it is discarded; Amazon - // S3 does not store the encryption key. The key must be appropriate for use - // with the algorithm specified in the x-amz-server-side-encryption-customer-algorithm - // header. This must be the same encryption key specified in the initiate multipart - // upload request. - // - // SSECustomerKey is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UploadPartInput's - // String and GoString methods. - SSECustomerKey *string `marshal-as:"blob" location:"header" locationName:"x-amz-server-side-encryption-customer-key" type:"string" sensitive:"true"` - - // Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. - // Amazon S3 uses this header for a message integrity check to ensure that the - // encryption key was transmitted without error. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // Upload ID identifying the multipart upload whose part is being uploaded. - // - // UploadId is a required field - UploadId *string `location:"querystring" locationName:"uploadId" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UploadPartInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UploadPartInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *UploadPartInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "UploadPartInput"} - if s.Bucket == nil { - invalidParams.Add(request.NewErrParamRequired("Bucket")) - } - if s.Bucket != nil && len(*s.Bucket) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Bucket", 1)) - } - if s.Key == nil { - invalidParams.Add(request.NewErrParamRequired("Key")) - } - if s.Key != nil && len(*s.Key) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Key", 1)) - } - if s.PartNumber == nil { - invalidParams.Add(request.NewErrParamRequired("PartNumber")) - } - if s.UploadId == nil { - invalidParams.Add(request.NewErrParamRequired("UploadId")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetBody sets the Body field's value. -func (s *UploadPartInput) SetBody(v io.ReadSeeker) *UploadPartInput { - s.Body = v - return s -} - -// SetBucket sets the Bucket field's value. -func (s *UploadPartInput) SetBucket(v string) *UploadPartInput { - s.Bucket = &v - return s -} - -func (s *UploadPartInput) getBucket() (v string) { - if s.Bucket == nil { - return v - } - return *s.Bucket -} - -// SetChecksumAlgorithm sets the ChecksumAlgorithm field's value. -func (s *UploadPartInput) SetChecksumAlgorithm(v string) *UploadPartInput { - s.ChecksumAlgorithm = &v - return s -} - -// SetChecksumCRC32 sets the ChecksumCRC32 field's value. -func (s *UploadPartInput) SetChecksumCRC32(v string) *UploadPartInput { - s.ChecksumCRC32 = &v - return s -} - -// SetChecksumCRC32C sets the ChecksumCRC32C field's value. -func (s *UploadPartInput) SetChecksumCRC32C(v string) *UploadPartInput { - s.ChecksumCRC32C = &v - return s -} - -// SetChecksumSHA1 sets the ChecksumSHA1 field's value. -func (s *UploadPartInput) SetChecksumSHA1(v string) *UploadPartInput { - s.ChecksumSHA1 = &v - return s -} - -// SetChecksumSHA256 sets the ChecksumSHA256 field's value. -func (s *UploadPartInput) SetChecksumSHA256(v string) *UploadPartInput { - s.ChecksumSHA256 = &v - return s -} - -// SetContentLength sets the ContentLength field's value. -func (s *UploadPartInput) SetContentLength(v int64) *UploadPartInput { - s.ContentLength = &v - return s -} - -// SetContentMD5 sets the ContentMD5 field's value. -func (s *UploadPartInput) SetContentMD5(v string) *UploadPartInput { - s.ContentMD5 = &v - return s -} - -// SetExpectedBucketOwner sets the ExpectedBucketOwner field's value. -func (s *UploadPartInput) SetExpectedBucketOwner(v string) *UploadPartInput { - s.ExpectedBucketOwner = &v - return s -} - -// SetKey sets the Key field's value. -func (s *UploadPartInput) SetKey(v string) *UploadPartInput { - s.Key = &v - return s -} - -// SetPartNumber sets the PartNumber field's value. -func (s *UploadPartInput) SetPartNumber(v int64) *UploadPartInput { - s.PartNumber = &v - return s -} - -// SetRequestPayer sets the RequestPayer field's value. -func (s *UploadPartInput) SetRequestPayer(v string) *UploadPartInput { - s.RequestPayer = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *UploadPartInput) SetSSECustomerAlgorithm(v string) *UploadPartInput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKey sets the SSECustomerKey field's value. -func (s *UploadPartInput) SetSSECustomerKey(v string) *UploadPartInput { - s.SSECustomerKey = &v - return s -} - -func (s *UploadPartInput) getSSECustomerKey() (v string) { - if s.SSECustomerKey == nil { - return v - } - return *s.SSECustomerKey -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *UploadPartInput) SetSSECustomerKeyMD5(v string) *UploadPartInput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetUploadId sets the UploadId field's value. -func (s *UploadPartInput) SetUploadId(v string) *UploadPartInput { - s.UploadId = &v - return s -} - -func (s *UploadPartInput) getEndpointARN() (arn.Resource, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - return parseEndpointARN(*s.Bucket) -} - -func (s *UploadPartInput) hasEndpointARN() bool { - if s.Bucket == nil { - return false - } - return arn.IsARN(*s.Bucket) -} - -// updateArnableField updates the value of the input field that -// takes an ARN as an input. This method is useful to backfill -// the parsed resource name from ARN into the input member. -// It returns a pointer to a modified copy of input and an error. -// Note that original input is not modified. -func (s UploadPartInput) updateArnableField(v string) (interface{}, error) { - if s.Bucket == nil { - return nil, fmt.Errorf("member Bucket is nil") - } - s.Bucket = aws.String(v) - return &s, nil -} - -type UploadPartOutput struct { - _ struct{} `type:"structure"` - - // Indicates whether the multipart upload uses an S3 Bucket Key for server-side - // encryption with Amazon Web Services KMS (SSE-KMS). - BucketKeyEnabled *bool `location:"header" locationName:"x-amz-server-side-encryption-bucket-key-enabled" type:"boolean"` - - // The base64-encoded, 32-bit CRC32 checksum of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumCRC32 *string `location:"header" locationName:"x-amz-checksum-crc32" type:"string"` - - // The base64-encoded, 32-bit CRC32C checksum of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumCRC32C *string `location:"header" locationName:"x-amz-checksum-crc32c" type:"string"` - - // The base64-encoded, 160-bit SHA-1 digest of the object. This will only be - // present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA1 *string `location:"header" locationName:"x-amz-checksum-sha1" type:"string"` - - // The base64-encoded, 256-bit SHA-256 digest of the object. This will only - // be present if it was uploaded with the object. With multipart uploads, this - // may not be a checksum value of the object. For more information about how - // checksums are calculated with multipart uploads, see Checking object integrity - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums) - // in the Amazon S3 User Guide. - ChecksumSHA256 *string `location:"header" locationName:"x-amz-checksum-sha256" type:"string"` - - // Entity tag for the uploaded object. - ETag *string `location:"header" locationName:"ETag" type:"string"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header confirming the encryption algorithm - // used. - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // If server-side encryption with a customer-provided encryption key was requested, - // the response will include this header to provide round-trip message integrity - // verification of the customer-provided encryption key. - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // If present, specifies the ID of the Amazon Web Services Key Management Service - // (Amazon Web Services KMS) symmetric customer managed key was used for the - // object. - // - // SSEKMSKeyId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by UploadPartOutput's - // String and GoString methods. - SSEKMSKeyId *string `location:"header" locationName:"x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - - // The server-side encryption algorithm used when storing this object in Amazon - // S3 (for example, AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UploadPartOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s UploadPartOutput) GoString() string { - return s.String() -} - -// SetBucketKeyEnabled sets the BucketKeyEnabled field's value. -func (s *UploadPartOutput) SetBucketKeyEnabled(v bool) *UploadPartOutput { - s.BucketKeyEnabled = &v - return s -} - -// SetChecksumCRC32 sets the ChecksumCRC32 field's value. -func (s *UploadPartOutput) SetChecksumCRC32(v string) *UploadPartOutput { - s.ChecksumCRC32 = &v - return s -} - -// SetChecksumCRC32C sets the ChecksumCRC32C field's value. -func (s *UploadPartOutput) SetChecksumCRC32C(v string) *UploadPartOutput { - s.ChecksumCRC32C = &v - return s -} - -// SetChecksumSHA1 sets the ChecksumSHA1 field's value. -func (s *UploadPartOutput) SetChecksumSHA1(v string) *UploadPartOutput { - s.ChecksumSHA1 = &v - return s -} - -// SetChecksumSHA256 sets the ChecksumSHA256 field's value. -func (s *UploadPartOutput) SetChecksumSHA256(v string) *UploadPartOutput { - s.ChecksumSHA256 = &v - return s -} - -// SetETag sets the ETag field's value. -func (s *UploadPartOutput) SetETag(v string) *UploadPartOutput { - s.ETag = &v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *UploadPartOutput) SetRequestCharged(v string) *UploadPartOutput { - s.RequestCharged = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *UploadPartOutput) SetSSECustomerAlgorithm(v string) *UploadPartOutput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *UploadPartOutput) SetSSECustomerKeyMD5(v string) *UploadPartOutput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *UploadPartOutput) SetSSEKMSKeyId(v string) *UploadPartOutput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *UploadPartOutput) SetServerSideEncryption(v string) *UploadPartOutput { - s.ServerSideEncryption = &v - return s -} - -// Describes the versioning state of an Amazon S3 bucket. For more information, -// see PUT Bucket versioning (https://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTVersioningStatus.html) -// in the Amazon S3 API Reference. -type VersioningConfiguration struct { - _ struct{} `type:"structure"` - - // Specifies whether MFA delete is enabled in the bucket versioning configuration. - // This element is only returned if the bucket has been configured with MFA - // delete. If the bucket has never been so configured, this element is not returned. - MFADelete *string `locationName:"MfaDelete" type:"string" enum:"MFADelete"` - - // The versioning state of the bucket. - Status *string `type:"string" enum:"BucketVersioningStatus"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s VersioningConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s VersioningConfiguration) GoString() string { - return s.String() -} - -// SetMFADelete sets the MFADelete field's value. -func (s *VersioningConfiguration) SetMFADelete(v string) *VersioningConfiguration { - s.MFADelete = &v - return s -} - -// SetStatus sets the Status field's value. -func (s *VersioningConfiguration) SetStatus(v string) *VersioningConfiguration { - s.Status = &v - return s -} - -// Specifies website configuration parameters for an Amazon S3 bucket. -type WebsiteConfiguration struct { - _ struct{} `type:"structure"` - - // The name of the error document for the website. - ErrorDocument *ErrorDocument `type:"structure"` - - // The name of the index document for the website. - IndexDocument *IndexDocument `type:"structure"` - - // The redirect behavior for every request to this bucket's website endpoint. - // - // If you specify this property, you can't specify any other property. - RedirectAllRequestsTo *RedirectAllRequestsTo `type:"structure"` - - // Rules that define when a redirect is applied and the redirect behavior. - RoutingRules []*RoutingRule `locationNameList:"RoutingRule" type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s WebsiteConfiguration) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s WebsiteConfiguration) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *WebsiteConfiguration) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "WebsiteConfiguration"} - if s.ErrorDocument != nil { - if err := s.ErrorDocument.Validate(); err != nil { - invalidParams.AddNested("ErrorDocument", err.(request.ErrInvalidParams)) - } - } - if s.IndexDocument != nil { - if err := s.IndexDocument.Validate(); err != nil { - invalidParams.AddNested("IndexDocument", err.(request.ErrInvalidParams)) - } - } - if s.RedirectAllRequestsTo != nil { - if err := s.RedirectAllRequestsTo.Validate(); err != nil { - invalidParams.AddNested("RedirectAllRequestsTo", err.(request.ErrInvalidParams)) - } - } - if s.RoutingRules != nil { - for i, v := range s.RoutingRules { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RoutingRules", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetErrorDocument sets the ErrorDocument field's value. -func (s *WebsiteConfiguration) SetErrorDocument(v *ErrorDocument) *WebsiteConfiguration { - s.ErrorDocument = v - return s -} - -// SetIndexDocument sets the IndexDocument field's value. -func (s *WebsiteConfiguration) SetIndexDocument(v *IndexDocument) *WebsiteConfiguration { - s.IndexDocument = v - return s -} - -// SetRedirectAllRequestsTo sets the RedirectAllRequestsTo field's value. -func (s *WebsiteConfiguration) SetRedirectAllRequestsTo(v *RedirectAllRequestsTo) *WebsiteConfiguration { - s.RedirectAllRequestsTo = v - return s -} - -// SetRoutingRules sets the RoutingRules field's value. -func (s *WebsiteConfiguration) SetRoutingRules(v []*RoutingRule) *WebsiteConfiguration { - s.RoutingRules = v - return s -} - -type WriteGetObjectResponseInput struct { - _ struct{} `locationName:"WriteGetObjectResponseRequest" type:"structure" payload:"Body"` - - // Indicates that a range of bytes was specified. - AcceptRanges *string `location:"header" locationName:"x-amz-fwd-header-accept-ranges" type:"string"` - - // The object data. - // - // To use an non-seekable io.Reader for this request wrap the io.Reader with - // "aws.ReadSeekCloser". The SDK will not retry request errors for non-seekable - // readers. This will allow the SDK to send the reader's payload as chunked - // transfer encoding. - Body io.ReadSeeker `type:"blob"` - - // Indicates whether the object stored in Amazon S3 uses an S3 bucket key for - // server-side encryption with Amazon Web Services KMS (SSE-KMS). - BucketKeyEnabled *bool `location:"header" locationName:"x-amz-fwd-header-x-amz-server-side-encryption-bucket-key-enabled" type:"boolean"` - - // Specifies caching behavior along the request/reply chain. - CacheControl *string `location:"header" locationName:"x-amz-fwd-header-Cache-Control" type:"string"` - - // This header can be used as a data integrity check to verify that the data - // received is the same data that was originally sent. This specifies the base64-encoded, - // 32-bit CRC32 checksum of the object returned by the Object Lambda function. - // This may not match the checksum for the object stored in Amazon S3. Amazon - // S3 will perform validation of the checksum values only when the original - // GetObject request required checksum validation. For more information about - // checksums, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // Only one checksum header can be specified at a time. If you supply multiple - // checksum headers, this request will fail. - ChecksumCRC32 *string `location:"header" locationName:"x-amz-fwd-header-x-amz-checksum-crc32" type:"string"` - - // This header can be used as a data integrity check to verify that the data - // received is the same data that was originally sent. This specifies the base64-encoded, - // 32-bit CRC32C checksum of the object returned by the Object Lambda function. - // This may not match the checksum for the object stored in Amazon S3. Amazon - // S3 will perform validation of the checksum values only when the original - // GetObject request required checksum validation. For more information about - // checksums, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // Only one checksum header can be specified at a time. If you supply multiple - // checksum headers, this request will fail. - ChecksumCRC32C *string `location:"header" locationName:"x-amz-fwd-header-x-amz-checksum-crc32c" type:"string"` - - // This header can be used as a data integrity check to verify that the data - // received is the same data that was originally sent. This specifies the base64-encoded, - // 160-bit SHA-1 digest of the object returned by the Object Lambda function. - // This may not match the checksum for the object stored in Amazon S3. Amazon - // S3 will perform validation of the checksum values only when the original - // GetObject request required checksum validation. For more information about - // checksums, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // Only one checksum header can be specified at a time. If you supply multiple - // checksum headers, this request will fail. - ChecksumSHA1 *string `location:"header" locationName:"x-amz-fwd-header-x-amz-checksum-sha1" type:"string"` - - // This header can be used as a data integrity check to verify that the data - // received is the same data that was originally sent. This specifies the base64-encoded, - // 256-bit SHA-256 digest of the object returned by the Object Lambda function. - // This may not match the checksum for the object stored in Amazon S3. Amazon - // S3 will perform validation of the checksum values only when the original - // GetObject request required checksum validation. For more information about - // checksums, see Checking object integrity (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html) - // in the Amazon S3 User Guide. - // - // Only one checksum header can be specified at a time. If you supply multiple - // checksum headers, this request will fail. - ChecksumSHA256 *string `location:"header" locationName:"x-amz-fwd-header-x-amz-checksum-sha256" type:"string"` - - // Specifies presentational information for the object. - ContentDisposition *string `location:"header" locationName:"x-amz-fwd-header-Content-Disposition" type:"string"` - - // Specifies what content encodings have been applied to the object and thus - // what decoding mechanisms must be applied to obtain the media-type referenced - // by the Content-Type header field. - ContentEncoding *string `location:"header" locationName:"x-amz-fwd-header-Content-Encoding" type:"string"` - - // The language the content is in. - ContentLanguage *string `location:"header" locationName:"x-amz-fwd-header-Content-Language" type:"string"` - - // The size of the content body in bytes. - ContentLength *int64 `location:"header" locationName:"Content-Length" type:"long"` - - // The portion of the object returned in the response. - ContentRange *string `location:"header" locationName:"x-amz-fwd-header-Content-Range" type:"string"` - - // A standard MIME type describing the format of the object data. - ContentType *string `location:"header" locationName:"x-amz-fwd-header-Content-Type" type:"string"` - - // Specifies whether an object stored in Amazon S3 is (true) or is not (false) - // a delete marker. - DeleteMarker *bool `location:"header" locationName:"x-amz-fwd-header-x-amz-delete-marker" type:"boolean"` - - // An opaque identifier assigned by a web server to a specific version of a - // resource found at a URL. - ETag *string `location:"header" locationName:"x-amz-fwd-header-ETag" type:"string"` - - // A string that uniquely identifies an error condition. Returned in the - // tag of the error XML response for a corresponding GetObject call. Cannot - // be used with a successful StatusCode header or when the transformed object - // is provided in the body. All error codes from S3 are sentence-cased. The - // regular expression (regex) value is "^[A-Z][a-zA-Z]+$". - ErrorCode *string `location:"header" locationName:"x-amz-fwd-error-code" type:"string"` - - // Contains a generic description of the error condition. Returned in the - // tag of the error XML response for a corresponding GetObject call. Cannot - // be used with a successful StatusCode header or when the transformed object - // is provided in body. - ErrorMessage *string `location:"header" locationName:"x-amz-fwd-error-message" type:"string"` - - // If the object expiration is configured (see PUT Bucket lifecycle), the response - // includes this header. It includes the expiry-date and rule-id key-value pairs - // that provide the object expiration information. The value of the rule-id - // is URL-encoded. - Expiration *string `location:"header" locationName:"x-amz-fwd-header-x-amz-expiration" type:"string"` - - // The date and time at which the object is no longer cacheable. - Expires *time.Time `location:"header" locationName:"x-amz-fwd-header-Expires" type:"timestamp"` - - // The date and time that the object was last modified. - LastModified *time.Time `location:"header" locationName:"x-amz-fwd-header-Last-Modified" type:"timestamp"` - - // A map of metadata to store with the object in S3. - Metadata map[string]*string `location:"headers" locationName:"x-amz-meta-" type:"map"` - - // Set to the number of metadata entries not returned in x-amz-meta headers. - // This can happen if you create metadata using an API like SOAP that supports - // more flexible metadata than the REST API. For example, using SOAP, you can - // create metadata whose values are not legal HTTP headers. - MissingMeta *int64 `location:"header" locationName:"x-amz-fwd-header-x-amz-missing-meta" type:"integer"` - - // Indicates whether an object stored in Amazon S3 has an active legal hold. - ObjectLockLegalHoldStatus *string `location:"header" locationName:"x-amz-fwd-header-x-amz-object-lock-legal-hold" type:"string" enum:"ObjectLockLegalHoldStatus"` - - // Indicates whether an object stored in Amazon S3 has Object Lock enabled. - // For more information about S3 Object Lock, see Object Lock (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lock.html). - ObjectLockMode *string `location:"header" locationName:"x-amz-fwd-header-x-amz-object-lock-mode" type:"string" enum:"ObjectLockMode"` - - // The date and time when Object Lock is configured to expire. - ObjectLockRetainUntilDate *time.Time `location:"header" locationName:"x-amz-fwd-header-x-amz-object-lock-retain-until-date" type:"timestamp" timestampFormat:"iso8601"` - - // The count of parts this object has. - PartsCount *int64 `location:"header" locationName:"x-amz-fwd-header-x-amz-mp-parts-count" type:"integer"` - - // Indicates if request involves bucket that is either a source or destination - // in a Replication rule. For more information about S3 Replication, see Replication - // (https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication.html). - ReplicationStatus *string `location:"header" locationName:"x-amz-fwd-header-x-amz-replication-status" type:"string" enum:"ReplicationStatus"` - - // If present, indicates that the requester was successfully charged for the - // request. - RequestCharged *string `location:"header" locationName:"x-amz-fwd-header-x-amz-request-charged" type:"string" enum:"RequestCharged"` - - // Route prefix to the HTTP URL generated. - // - // RequestRoute is a required field - RequestRoute *string `location:"header" locationName:"x-amz-request-route" type:"string" required:"true"` - - // A single use encrypted token that maps WriteGetObjectResponse to the end - // user GetObject request. - // - // RequestToken is a required field - RequestToken *string `location:"header" locationName:"x-amz-request-token" type:"string" required:"true"` - - // Provides information about object restoration operation and expiration time - // of the restored object copy. - Restore *string `location:"header" locationName:"x-amz-fwd-header-x-amz-restore" type:"string"` - - // Encryption algorithm used if server-side encryption with a customer-provided - // encryption key was specified for object stored in Amazon S3. - SSECustomerAlgorithm *string `location:"header" locationName:"x-amz-fwd-header-x-amz-server-side-encryption-customer-algorithm" type:"string"` - - // 128-bit MD5 digest of customer-provided encryption key used in Amazon S3 - // to encrypt data stored in S3. For more information, see Protecting data using - // server-side encryption with customer-provided encryption keys (SSE-C) (https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerSideEncryptionCustomerKeys.html). - SSECustomerKeyMD5 *string `location:"header" locationName:"x-amz-fwd-header-x-amz-server-side-encryption-customer-key-MD5" type:"string"` - - // If present, specifies the ID of the Amazon Web Services Key Management Service - // (Amazon Web Services KMS) symmetric customer managed key that was used for - // stored in Amazon S3 object. - // - // SSEKMSKeyId is a sensitive parameter and its value will be - // replaced with "sensitive" in string returned by WriteGetObjectResponseInput's - // String and GoString methods. - SSEKMSKeyId *string `location:"header" locationName:"x-amz-fwd-header-x-amz-server-side-encryption-aws-kms-key-id" type:"string" sensitive:"true"` - - // The server-side encryption algorithm used when storing requested object in - // Amazon S3 (for example, AES256, aws:kms). - ServerSideEncryption *string `location:"header" locationName:"x-amz-fwd-header-x-amz-server-side-encryption" type:"string" enum:"ServerSideEncryption"` - - // The integer status code for an HTTP response of a corresponding GetObject - // request. - // - // Status Codes - // - // * 200 - OK - // - // * 206 - Partial Content - // - // * 304 - Not Modified - // - // * 400 - Bad Request - // - // * 401 - Unauthorized - // - // * 403 - Forbidden - // - // * 404 - Not Found - // - // * 405 - Method Not Allowed - // - // * 409 - Conflict - // - // * 411 - Length Required - // - // * 412 - Precondition Failed - // - // * 416 - Range Not Satisfiable - // - // * 500 - Internal Server Error - // - // * 503 - Service Unavailable - StatusCode *int64 `location:"header" locationName:"x-amz-fwd-status" type:"integer"` - - // Provides storage class information of the object. Amazon S3 returns this - // header for all objects except for S3 Standard storage class objects. - // - // For more information, see Storage Classes (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html). - StorageClass *string `location:"header" locationName:"x-amz-fwd-header-x-amz-storage-class" type:"string" enum:"StorageClass"` - - // The number of tags, if any, on the object. - TagCount *int64 `location:"header" locationName:"x-amz-fwd-header-x-amz-tagging-count" type:"integer"` - - // An ID used to reference a specific version of the object. - VersionId *string `location:"header" locationName:"x-amz-fwd-header-x-amz-version-id" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s WriteGetObjectResponseInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s WriteGetObjectResponseInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *WriteGetObjectResponseInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "WriteGetObjectResponseInput"} - if s.RequestRoute == nil { - invalidParams.Add(request.NewErrParamRequired("RequestRoute")) - } - if s.RequestRoute != nil && len(*s.RequestRoute) < 1 { - invalidParams.Add(request.NewErrParamMinLen("RequestRoute", 1)) - } - if s.RequestToken == nil { - invalidParams.Add(request.NewErrParamRequired("RequestToken")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAcceptRanges sets the AcceptRanges field's value. -func (s *WriteGetObjectResponseInput) SetAcceptRanges(v string) *WriteGetObjectResponseInput { - s.AcceptRanges = &v - return s -} - -// SetBody sets the Body field's value. -func (s *WriteGetObjectResponseInput) SetBody(v io.ReadSeeker) *WriteGetObjectResponseInput { - s.Body = v - return s -} - -// SetBucketKeyEnabled sets the BucketKeyEnabled field's value. -func (s *WriteGetObjectResponseInput) SetBucketKeyEnabled(v bool) *WriteGetObjectResponseInput { - s.BucketKeyEnabled = &v - return s -} - -// SetCacheControl sets the CacheControl field's value. -func (s *WriteGetObjectResponseInput) SetCacheControl(v string) *WriteGetObjectResponseInput { - s.CacheControl = &v - return s -} - -// SetChecksumCRC32 sets the ChecksumCRC32 field's value. -func (s *WriteGetObjectResponseInput) SetChecksumCRC32(v string) *WriteGetObjectResponseInput { - s.ChecksumCRC32 = &v - return s -} - -// SetChecksumCRC32C sets the ChecksumCRC32C field's value. -func (s *WriteGetObjectResponseInput) SetChecksumCRC32C(v string) *WriteGetObjectResponseInput { - s.ChecksumCRC32C = &v - return s -} - -// SetChecksumSHA1 sets the ChecksumSHA1 field's value. -func (s *WriteGetObjectResponseInput) SetChecksumSHA1(v string) *WriteGetObjectResponseInput { - s.ChecksumSHA1 = &v - return s -} - -// SetChecksumSHA256 sets the ChecksumSHA256 field's value. -func (s *WriteGetObjectResponseInput) SetChecksumSHA256(v string) *WriteGetObjectResponseInput { - s.ChecksumSHA256 = &v - return s -} - -// SetContentDisposition sets the ContentDisposition field's value. -func (s *WriteGetObjectResponseInput) SetContentDisposition(v string) *WriteGetObjectResponseInput { - s.ContentDisposition = &v - return s -} - -// SetContentEncoding sets the ContentEncoding field's value. -func (s *WriteGetObjectResponseInput) SetContentEncoding(v string) *WriteGetObjectResponseInput { - s.ContentEncoding = &v - return s -} - -// SetContentLanguage sets the ContentLanguage field's value. -func (s *WriteGetObjectResponseInput) SetContentLanguage(v string) *WriteGetObjectResponseInput { - s.ContentLanguage = &v - return s -} - -// SetContentLength sets the ContentLength field's value. -func (s *WriteGetObjectResponseInput) SetContentLength(v int64) *WriteGetObjectResponseInput { - s.ContentLength = &v - return s -} - -// SetContentRange sets the ContentRange field's value. -func (s *WriteGetObjectResponseInput) SetContentRange(v string) *WriteGetObjectResponseInput { - s.ContentRange = &v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *WriteGetObjectResponseInput) SetContentType(v string) *WriteGetObjectResponseInput { - s.ContentType = &v - return s -} - -// SetDeleteMarker sets the DeleteMarker field's value. -func (s *WriteGetObjectResponseInput) SetDeleteMarker(v bool) *WriteGetObjectResponseInput { - s.DeleteMarker = &v - return s -} - -// SetETag sets the ETag field's value. -func (s *WriteGetObjectResponseInput) SetETag(v string) *WriteGetObjectResponseInput { - s.ETag = &v - return s -} - -// SetErrorCode sets the ErrorCode field's value. -func (s *WriteGetObjectResponseInput) SetErrorCode(v string) *WriteGetObjectResponseInput { - s.ErrorCode = &v - return s -} - -// SetErrorMessage sets the ErrorMessage field's value. -func (s *WriteGetObjectResponseInput) SetErrorMessage(v string) *WriteGetObjectResponseInput { - s.ErrorMessage = &v - return s -} - -// SetExpiration sets the Expiration field's value. -func (s *WriteGetObjectResponseInput) SetExpiration(v string) *WriteGetObjectResponseInput { - s.Expiration = &v - return s -} - -// SetExpires sets the Expires field's value. -func (s *WriteGetObjectResponseInput) SetExpires(v time.Time) *WriteGetObjectResponseInput { - s.Expires = &v - return s -} - -// SetLastModified sets the LastModified field's value. -func (s *WriteGetObjectResponseInput) SetLastModified(v time.Time) *WriteGetObjectResponseInput { - s.LastModified = &v - return s -} - -// SetMetadata sets the Metadata field's value. -func (s *WriteGetObjectResponseInput) SetMetadata(v map[string]*string) *WriteGetObjectResponseInput { - s.Metadata = v - return s -} - -// SetMissingMeta sets the MissingMeta field's value. -func (s *WriteGetObjectResponseInput) SetMissingMeta(v int64) *WriteGetObjectResponseInput { - s.MissingMeta = &v - return s -} - -// SetObjectLockLegalHoldStatus sets the ObjectLockLegalHoldStatus field's value. -func (s *WriteGetObjectResponseInput) SetObjectLockLegalHoldStatus(v string) *WriteGetObjectResponseInput { - s.ObjectLockLegalHoldStatus = &v - return s -} - -// SetObjectLockMode sets the ObjectLockMode field's value. -func (s *WriteGetObjectResponseInput) SetObjectLockMode(v string) *WriteGetObjectResponseInput { - s.ObjectLockMode = &v - return s -} - -// SetObjectLockRetainUntilDate sets the ObjectLockRetainUntilDate field's value. -func (s *WriteGetObjectResponseInput) SetObjectLockRetainUntilDate(v time.Time) *WriteGetObjectResponseInput { - s.ObjectLockRetainUntilDate = &v - return s -} - -// SetPartsCount sets the PartsCount field's value. -func (s *WriteGetObjectResponseInput) SetPartsCount(v int64) *WriteGetObjectResponseInput { - s.PartsCount = &v - return s -} - -// SetReplicationStatus sets the ReplicationStatus field's value. -func (s *WriteGetObjectResponseInput) SetReplicationStatus(v string) *WriteGetObjectResponseInput { - s.ReplicationStatus = &v - return s -} - -// SetRequestCharged sets the RequestCharged field's value. -func (s *WriteGetObjectResponseInput) SetRequestCharged(v string) *WriteGetObjectResponseInput { - s.RequestCharged = &v - return s -} - -// SetRequestRoute sets the RequestRoute field's value. -func (s *WriteGetObjectResponseInput) SetRequestRoute(v string) *WriteGetObjectResponseInput { - s.RequestRoute = &v - return s -} - -// SetRequestToken sets the RequestToken field's value. -func (s *WriteGetObjectResponseInput) SetRequestToken(v string) *WriteGetObjectResponseInput { - s.RequestToken = &v - return s -} - -// SetRestore sets the Restore field's value. -func (s *WriteGetObjectResponseInput) SetRestore(v string) *WriteGetObjectResponseInput { - s.Restore = &v - return s -} - -// SetSSECustomerAlgorithm sets the SSECustomerAlgorithm field's value. -func (s *WriteGetObjectResponseInput) SetSSECustomerAlgorithm(v string) *WriteGetObjectResponseInput { - s.SSECustomerAlgorithm = &v - return s -} - -// SetSSECustomerKeyMD5 sets the SSECustomerKeyMD5 field's value. -func (s *WriteGetObjectResponseInput) SetSSECustomerKeyMD5(v string) *WriteGetObjectResponseInput { - s.SSECustomerKeyMD5 = &v - return s -} - -// SetSSEKMSKeyId sets the SSEKMSKeyId field's value. -func (s *WriteGetObjectResponseInput) SetSSEKMSKeyId(v string) *WriteGetObjectResponseInput { - s.SSEKMSKeyId = &v - return s -} - -// SetServerSideEncryption sets the ServerSideEncryption field's value. -func (s *WriteGetObjectResponseInput) SetServerSideEncryption(v string) *WriteGetObjectResponseInput { - s.ServerSideEncryption = &v - return s -} - -// SetStatusCode sets the StatusCode field's value. -func (s *WriteGetObjectResponseInput) SetStatusCode(v int64) *WriteGetObjectResponseInput { - s.StatusCode = &v - return s -} - -// SetStorageClass sets the StorageClass field's value. -func (s *WriteGetObjectResponseInput) SetStorageClass(v string) *WriteGetObjectResponseInput { - s.StorageClass = &v - return s -} - -// SetTagCount sets the TagCount field's value. -func (s *WriteGetObjectResponseInput) SetTagCount(v int64) *WriteGetObjectResponseInput { - s.TagCount = &v - return s -} - -// SetVersionId sets the VersionId field's value. -func (s *WriteGetObjectResponseInput) SetVersionId(v string) *WriteGetObjectResponseInput { - s.VersionId = &v - return s -} - -func (s *WriteGetObjectResponseInput) hostLabels() map[string]string { - return map[string]string{ - "RequestRoute": aws.StringValue(s.RequestRoute), - } -} - -type WriteGetObjectResponseOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s WriteGetObjectResponseOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s WriteGetObjectResponseOutput) GoString() string { - return s.String() -} - -const ( - // AnalyticsS3ExportFileFormatCsv is a AnalyticsS3ExportFileFormat enum value - AnalyticsS3ExportFileFormatCsv = "CSV" -) - -// AnalyticsS3ExportFileFormat_Values returns all elements of the AnalyticsS3ExportFileFormat enum -func AnalyticsS3ExportFileFormat_Values() []string { - return []string{ - AnalyticsS3ExportFileFormatCsv, - } -} - -const ( - // ArchiveStatusArchiveAccess is a ArchiveStatus enum value - ArchiveStatusArchiveAccess = "ARCHIVE_ACCESS" - - // ArchiveStatusDeepArchiveAccess is a ArchiveStatus enum value - ArchiveStatusDeepArchiveAccess = "DEEP_ARCHIVE_ACCESS" -) - -// ArchiveStatus_Values returns all elements of the ArchiveStatus enum -func ArchiveStatus_Values() []string { - return []string{ - ArchiveStatusArchiveAccess, - ArchiveStatusDeepArchiveAccess, - } -} - -const ( - // BucketAccelerateStatusEnabled is a BucketAccelerateStatus enum value - BucketAccelerateStatusEnabled = "Enabled" - - // BucketAccelerateStatusSuspended is a BucketAccelerateStatus enum value - BucketAccelerateStatusSuspended = "Suspended" -) - -// BucketAccelerateStatus_Values returns all elements of the BucketAccelerateStatus enum -func BucketAccelerateStatus_Values() []string { - return []string{ - BucketAccelerateStatusEnabled, - BucketAccelerateStatusSuspended, - } -} - -const ( - // BucketCannedACLPrivate is a BucketCannedACL enum value - BucketCannedACLPrivate = "private" - - // BucketCannedACLPublicRead is a BucketCannedACL enum value - BucketCannedACLPublicRead = "public-read" - - // BucketCannedACLPublicReadWrite is a BucketCannedACL enum value - BucketCannedACLPublicReadWrite = "public-read-write" - - // BucketCannedACLAuthenticatedRead is a BucketCannedACL enum value - BucketCannedACLAuthenticatedRead = "authenticated-read" -) - -// BucketCannedACL_Values returns all elements of the BucketCannedACL enum -func BucketCannedACL_Values() []string { - return []string{ - BucketCannedACLPrivate, - BucketCannedACLPublicRead, - BucketCannedACLPublicReadWrite, - BucketCannedACLAuthenticatedRead, - } -} - -const ( - // BucketLocationConstraintAfSouth1 is a BucketLocationConstraint enum value - BucketLocationConstraintAfSouth1 = "af-south-1" - - // BucketLocationConstraintApEast1 is a BucketLocationConstraint enum value - BucketLocationConstraintApEast1 = "ap-east-1" - - // BucketLocationConstraintApNortheast1 is a BucketLocationConstraint enum value - BucketLocationConstraintApNortheast1 = "ap-northeast-1" - - // BucketLocationConstraintApNortheast2 is a BucketLocationConstraint enum value - BucketLocationConstraintApNortheast2 = "ap-northeast-2" - - // BucketLocationConstraintApNortheast3 is a BucketLocationConstraint enum value - BucketLocationConstraintApNortheast3 = "ap-northeast-3" - - // BucketLocationConstraintApSouth1 is a BucketLocationConstraint enum value - BucketLocationConstraintApSouth1 = "ap-south-1" - - // BucketLocationConstraintApSoutheast1 is a BucketLocationConstraint enum value - BucketLocationConstraintApSoutheast1 = "ap-southeast-1" - - // BucketLocationConstraintApSoutheast2 is a BucketLocationConstraint enum value - BucketLocationConstraintApSoutheast2 = "ap-southeast-2" - - // BucketLocationConstraintApSoutheast3 is a BucketLocationConstraint enum value - BucketLocationConstraintApSoutheast3 = "ap-southeast-3" - - // BucketLocationConstraintCaCentral1 is a BucketLocationConstraint enum value - BucketLocationConstraintCaCentral1 = "ca-central-1" - - // BucketLocationConstraintCnNorth1 is a BucketLocationConstraint enum value - BucketLocationConstraintCnNorth1 = "cn-north-1" - - // BucketLocationConstraintCnNorthwest1 is a BucketLocationConstraint enum value - BucketLocationConstraintCnNorthwest1 = "cn-northwest-1" - - // BucketLocationConstraintEu is a BucketLocationConstraint enum value - BucketLocationConstraintEu = "EU" - - // BucketLocationConstraintEuCentral1 is a BucketLocationConstraint enum value - BucketLocationConstraintEuCentral1 = "eu-central-1" - - // BucketLocationConstraintEuNorth1 is a BucketLocationConstraint enum value - BucketLocationConstraintEuNorth1 = "eu-north-1" - - // BucketLocationConstraintEuSouth1 is a BucketLocationConstraint enum value - BucketLocationConstraintEuSouth1 = "eu-south-1" - - // BucketLocationConstraintEuWest1 is a BucketLocationConstraint enum value - BucketLocationConstraintEuWest1 = "eu-west-1" - - // BucketLocationConstraintEuWest2 is a BucketLocationConstraint enum value - BucketLocationConstraintEuWest2 = "eu-west-2" - - // BucketLocationConstraintEuWest3 is a BucketLocationConstraint enum value - BucketLocationConstraintEuWest3 = "eu-west-3" - - // BucketLocationConstraintMeSouth1 is a BucketLocationConstraint enum value - BucketLocationConstraintMeSouth1 = "me-south-1" - - // BucketLocationConstraintSaEast1 is a BucketLocationConstraint enum value - BucketLocationConstraintSaEast1 = "sa-east-1" - - // BucketLocationConstraintUsEast2 is a BucketLocationConstraint enum value - BucketLocationConstraintUsEast2 = "us-east-2" - - // BucketLocationConstraintUsGovEast1 is a BucketLocationConstraint enum value - BucketLocationConstraintUsGovEast1 = "us-gov-east-1" - - // BucketLocationConstraintUsGovWest1 is a BucketLocationConstraint enum value - BucketLocationConstraintUsGovWest1 = "us-gov-west-1" - - // BucketLocationConstraintUsWest1 is a BucketLocationConstraint enum value - BucketLocationConstraintUsWest1 = "us-west-1" - - // BucketLocationConstraintUsWest2 is a BucketLocationConstraint enum value - BucketLocationConstraintUsWest2 = "us-west-2" -) - -// BucketLocationConstraint_Values returns all elements of the BucketLocationConstraint enum -func BucketLocationConstraint_Values() []string { - return []string{ - BucketLocationConstraintAfSouth1, - BucketLocationConstraintApEast1, - BucketLocationConstraintApNortheast1, - BucketLocationConstraintApNortheast2, - BucketLocationConstraintApNortheast3, - BucketLocationConstraintApSouth1, - BucketLocationConstraintApSoutheast1, - BucketLocationConstraintApSoutheast2, - BucketLocationConstraintApSoutheast3, - BucketLocationConstraintCaCentral1, - BucketLocationConstraintCnNorth1, - BucketLocationConstraintCnNorthwest1, - BucketLocationConstraintEu, - BucketLocationConstraintEuCentral1, - BucketLocationConstraintEuNorth1, - BucketLocationConstraintEuSouth1, - BucketLocationConstraintEuWest1, - BucketLocationConstraintEuWest2, - BucketLocationConstraintEuWest3, - BucketLocationConstraintMeSouth1, - BucketLocationConstraintSaEast1, - BucketLocationConstraintUsEast2, - BucketLocationConstraintUsGovEast1, - BucketLocationConstraintUsGovWest1, - BucketLocationConstraintUsWest1, - BucketLocationConstraintUsWest2, - } -} - -const ( - // BucketLogsPermissionFullControl is a BucketLogsPermission enum value - BucketLogsPermissionFullControl = "FULL_CONTROL" - - // BucketLogsPermissionRead is a BucketLogsPermission enum value - BucketLogsPermissionRead = "READ" - - // BucketLogsPermissionWrite is a BucketLogsPermission enum value - BucketLogsPermissionWrite = "WRITE" -) - -// BucketLogsPermission_Values returns all elements of the BucketLogsPermission enum -func BucketLogsPermission_Values() []string { - return []string{ - BucketLogsPermissionFullControl, - BucketLogsPermissionRead, - BucketLogsPermissionWrite, - } -} - -const ( - // BucketVersioningStatusEnabled is a BucketVersioningStatus enum value - BucketVersioningStatusEnabled = "Enabled" - - // BucketVersioningStatusSuspended is a BucketVersioningStatus enum value - BucketVersioningStatusSuspended = "Suspended" -) - -// BucketVersioningStatus_Values returns all elements of the BucketVersioningStatus enum -func BucketVersioningStatus_Values() []string { - return []string{ - BucketVersioningStatusEnabled, - BucketVersioningStatusSuspended, - } -} - -const ( - // ChecksumAlgorithmCrc32 is a ChecksumAlgorithm enum value - ChecksumAlgorithmCrc32 = "CRC32" - - // ChecksumAlgorithmCrc32c is a ChecksumAlgorithm enum value - ChecksumAlgorithmCrc32c = "CRC32C" - - // ChecksumAlgorithmSha1 is a ChecksumAlgorithm enum value - ChecksumAlgorithmSha1 = "SHA1" - - // ChecksumAlgorithmSha256 is a ChecksumAlgorithm enum value - ChecksumAlgorithmSha256 = "SHA256" -) - -// ChecksumAlgorithm_Values returns all elements of the ChecksumAlgorithm enum -func ChecksumAlgorithm_Values() []string { - return []string{ - ChecksumAlgorithmCrc32, - ChecksumAlgorithmCrc32c, - ChecksumAlgorithmSha1, - ChecksumAlgorithmSha256, - } -} - -const ( - // ChecksumModeEnabled is a ChecksumMode enum value - ChecksumModeEnabled = "ENABLED" -) - -// ChecksumMode_Values returns all elements of the ChecksumMode enum -func ChecksumMode_Values() []string { - return []string{ - ChecksumModeEnabled, - } -} - -const ( - // CompressionTypeNone is a CompressionType enum value - CompressionTypeNone = "NONE" - - // CompressionTypeGzip is a CompressionType enum value - CompressionTypeGzip = "GZIP" - - // CompressionTypeBzip2 is a CompressionType enum value - CompressionTypeBzip2 = "BZIP2" -) - -// CompressionType_Values returns all elements of the CompressionType enum -func CompressionType_Values() []string { - return []string{ - CompressionTypeNone, - CompressionTypeGzip, - CompressionTypeBzip2, - } -} - -const ( - // DeleteMarkerReplicationStatusEnabled is a DeleteMarkerReplicationStatus enum value - DeleteMarkerReplicationStatusEnabled = "Enabled" - - // DeleteMarkerReplicationStatusDisabled is a DeleteMarkerReplicationStatus enum value - DeleteMarkerReplicationStatusDisabled = "Disabled" -) - -// DeleteMarkerReplicationStatus_Values returns all elements of the DeleteMarkerReplicationStatus enum -func DeleteMarkerReplicationStatus_Values() []string { - return []string{ - DeleteMarkerReplicationStatusEnabled, - DeleteMarkerReplicationStatusDisabled, - } -} - -// Requests Amazon S3 to encode the object keys in the response and specifies -// the encoding method to use. An object key may contain any Unicode character; -// however, XML 1.0 parser cannot parse some characters, such as characters -// with an ASCII value from 0 to 10. For characters that are not supported in -// XML 1.0, you can add this parameter to request that Amazon S3 encode the -// keys in the response. -const ( - // EncodingTypeUrl is a EncodingType enum value - EncodingTypeUrl = "url" -) - -// EncodingType_Values returns all elements of the EncodingType enum -func EncodingType_Values() []string { - return []string{ - EncodingTypeUrl, - } -} - -// The bucket event for which to send notifications. -const ( - // EventS3ReducedRedundancyLostObject is a Event enum value - EventS3ReducedRedundancyLostObject = "s3:ReducedRedundancyLostObject" - - // EventS3ObjectCreated is a Event enum value - EventS3ObjectCreated = "s3:ObjectCreated:*" - - // EventS3ObjectCreatedPut is a Event enum value - EventS3ObjectCreatedPut = "s3:ObjectCreated:Put" - - // EventS3ObjectCreatedPost is a Event enum value - EventS3ObjectCreatedPost = "s3:ObjectCreated:Post" - - // EventS3ObjectCreatedCopy is a Event enum value - EventS3ObjectCreatedCopy = "s3:ObjectCreated:Copy" - - // EventS3ObjectCreatedCompleteMultipartUpload is a Event enum value - EventS3ObjectCreatedCompleteMultipartUpload = "s3:ObjectCreated:CompleteMultipartUpload" - - // EventS3ObjectRemoved is a Event enum value - EventS3ObjectRemoved = "s3:ObjectRemoved:*" - - // EventS3ObjectRemovedDelete is a Event enum value - EventS3ObjectRemovedDelete = "s3:ObjectRemoved:Delete" - - // EventS3ObjectRemovedDeleteMarkerCreated is a Event enum value - EventS3ObjectRemovedDeleteMarkerCreated = "s3:ObjectRemoved:DeleteMarkerCreated" - - // EventS3ObjectRestore is a Event enum value - EventS3ObjectRestore = "s3:ObjectRestore:*" - - // EventS3ObjectRestorePost is a Event enum value - EventS3ObjectRestorePost = "s3:ObjectRestore:Post" - - // EventS3ObjectRestoreCompleted is a Event enum value - EventS3ObjectRestoreCompleted = "s3:ObjectRestore:Completed" - - // EventS3Replication is a Event enum value - EventS3Replication = "s3:Replication:*" - - // EventS3ReplicationOperationFailedReplication is a Event enum value - EventS3ReplicationOperationFailedReplication = "s3:Replication:OperationFailedReplication" - - // EventS3ReplicationOperationNotTracked is a Event enum value - EventS3ReplicationOperationNotTracked = "s3:Replication:OperationNotTracked" - - // EventS3ReplicationOperationMissedThreshold is a Event enum value - EventS3ReplicationOperationMissedThreshold = "s3:Replication:OperationMissedThreshold" - - // EventS3ReplicationOperationReplicatedAfterThreshold is a Event enum value - EventS3ReplicationOperationReplicatedAfterThreshold = "s3:Replication:OperationReplicatedAfterThreshold" - - // EventS3ObjectRestoreDelete is a Event enum value - EventS3ObjectRestoreDelete = "s3:ObjectRestore:Delete" - - // EventS3LifecycleTransition is a Event enum value - EventS3LifecycleTransition = "s3:LifecycleTransition" - - // EventS3IntelligentTiering is a Event enum value - EventS3IntelligentTiering = "s3:IntelligentTiering" - - // EventS3ObjectAclPut is a Event enum value - EventS3ObjectAclPut = "s3:ObjectAcl:Put" - - // EventS3LifecycleExpiration is a Event enum value - EventS3LifecycleExpiration = "s3:LifecycleExpiration:*" - - // EventS3LifecycleExpirationDelete is a Event enum value - EventS3LifecycleExpirationDelete = "s3:LifecycleExpiration:Delete" - - // EventS3LifecycleExpirationDeleteMarkerCreated is a Event enum value - EventS3LifecycleExpirationDeleteMarkerCreated = "s3:LifecycleExpiration:DeleteMarkerCreated" - - // EventS3ObjectTagging is a Event enum value - EventS3ObjectTagging = "s3:ObjectTagging:*" - - // EventS3ObjectTaggingPut is a Event enum value - EventS3ObjectTaggingPut = "s3:ObjectTagging:Put" - - // EventS3ObjectTaggingDelete is a Event enum value - EventS3ObjectTaggingDelete = "s3:ObjectTagging:Delete" -) - -// Event_Values returns all elements of the Event enum -func Event_Values() []string { - return []string{ - EventS3ReducedRedundancyLostObject, - EventS3ObjectCreated, - EventS3ObjectCreatedPut, - EventS3ObjectCreatedPost, - EventS3ObjectCreatedCopy, - EventS3ObjectCreatedCompleteMultipartUpload, - EventS3ObjectRemoved, - EventS3ObjectRemovedDelete, - EventS3ObjectRemovedDeleteMarkerCreated, - EventS3ObjectRestore, - EventS3ObjectRestorePost, - EventS3ObjectRestoreCompleted, - EventS3Replication, - EventS3ReplicationOperationFailedReplication, - EventS3ReplicationOperationNotTracked, - EventS3ReplicationOperationMissedThreshold, - EventS3ReplicationOperationReplicatedAfterThreshold, - EventS3ObjectRestoreDelete, - EventS3LifecycleTransition, - EventS3IntelligentTiering, - EventS3ObjectAclPut, - EventS3LifecycleExpiration, - EventS3LifecycleExpirationDelete, - EventS3LifecycleExpirationDeleteMarkerCreated, - EventS3ObjectTagging, - EventS3ObjectTaggingPut, - EventS3ObjectTaggingDelete, - } -} - -const ( - // ExistingObjectReplicationStatusEnabled is a ExistingObjectReplicationStatus enum value - ExistingObjectReplicationStatusEnabled = "Enabled" - - // ExistingObjectReplicationStatusDisabled is a ExistingObjectReplicationStatus enum value - ExistingObjectReplicationStatusDisabled = "Disabled" -) - -// ExistingObjectReplicationStatus_Values returns all elements of the ExistingObjectReplicationStatus enum -func ExistingObjectReplicationStatus_Values() []string { - return []string{ - ExistingObjectReplicationStatusEnabled, - ExistingObjectReplicationStatusDisabled, - } -} - -const ( - // ExpirationStatusEnabled is a ExpirationStatus enum value - ExpirationStatusEnabled = "Enabled" - - // ExpirationStatusDisabled is a ExpirationStatus enum value - ExpirationStatusDisabled = "Disabled" -) - -// ExpirationStatus_Values returns all elements of the ExpirationStatus enum -func ExpirationStatus_Values() []string { - return []string{ - ExpirationStatusEnabled, - ExpirationStatusDisabled, - } -} - -const ( - // ExpressionTypeSql is a ExpressionType enum value - ExpressionTypeSql = "SQL" -) - -// ExpressionType_Values returns all elements of the ExpressionType enum -func ExpressionType_Values() []string { - return []string{ - ExpressionTypeSql, - } -} - -const ( - // FileHeaderInfoUse is a FileHeaderInfo enum value - FileHeaderInfoUse = "USE" - - // FileHeaderInfoIgnore is a FileHeaderInfo enum value - FileHeaderInfoIgnore = "IGNORE" - - // FileHeaderInfoNone is a FileHeaderInfo enum value - FileHeaderInfoNone = "NONE" -) - -// FileHeaderInfo_Values returns all elements of the FileHeaderInfo enum -func FileHeaderInfo_Values() []string { - return []string{ - FileHeaderInfoUse, - FileHeaderInfoIgnore, - FileHeaderInfoNone, - } -} - -const ( - // FilterRuleNamePrefix is a FilterRuleName enum value - FilterRuleNamePrefix = "prefix" - - // FilterRuleNameSuffix is a FilterRuleName enum value - FilterRuleNameSuffix = "suffix" -) - -// FilterRuleName_Values returns all elements of the FilterRuleName enum -func FilterRuleName_Values() []string { - return []string{ - FilterRuleNamePrefix, - FilterRuleNameSuffix, - } -} - -const ( - // IntelligentTieringAccessTierArchiveAccess is a IntelligentTieringAccessTier enum value - IntelligentTieringAccessTierArchiveAccess = "ARCHIVE_ACCESS" - - // IntelligentTieringAccessTierDeepArchiveAccess is a IntelligentTieringAccessTier enum value - IntelligentTieringAccessTierDeepArchiveAccess = "DEEP_ARCHIVE_ACCESS" -) - -// IntelligentTieringAccessTier_Values returns all elements of the IntelligentTieringAccessTier enum -func IntelligentTieringAccessTier_Values() []string { - return []string{ - IntelligentTieringAccessTierArchiveAccess, - IntelligentTieringAccessTierDeepArchiveAccess, - } -} - -const ( - // IntelligentTieringStatusEnabled is a IntelligentTieringStatus enum value - IntelligentTieringStatusEnabled = "Enabled" - - // IntelligentTieringStatusDisabled is a IntelligentTieringStatus enum value - IntelligentTieringStatusDisabled = "Disabled" -) - -// IntelligentTieringStatus_Values returns all elements of the IntelligentTieringStatus enum -func IntelligentTieringStatus_Values() []string { - return []string{ - IntelligentTieringStatusEnabled, - IntelligentTieringStatusDisabled, - } -} - -const ( - // InventoryFormatCsv is a InventoryFormat enum value - InventoryFormatCsv = "CSV" - - // InventoryFormatOrc is a InventoryFormat enum value - InventoryFormatOrc = "ORC" - - // InventoryFormatParquet is a InventoryFormat enum value - InventoryFormatParquet = "Parquet" -) - -// InventoryFormat_Values returns all elements of the InventoryFormat enum -func InventoryFormat_Values() []string { - return []string{ - InventoryFormatCsv, - InventoryFormatOrc, - InventoryFormatParquet, - } -} - -const ( - // InventoryFrequencyDaily is a InventoryFrequency enum value - InventoryFrequencyDaily = "Daily" - - // InventoryFrequencyWeekly is a InventoryFrequency enum value - InventoryFrequencyWeekly = "Weekly" -) - -// InventoryFrequency_Values returns all elements of the InventoryFrequency enum -func InventoryFrequency_Values() []string { - return []string{ - InventoryFrequencyDaily, - InventoryFrequencyWeekly, - } -} - -const ( - // InventoryIncludedObjectVersionsAll is a InventoryIncludedObjectVersions enum value - InventoryIncludedObjectVersionsAll = "All" - - // InventoryIncludedObjectVersionsCurrent is a InventoryIncludedObjectVersions enum value - InventoryIncludedObjectVersionsCurrent = "Current" -) - -// InventoryIncludedObjectVersions_Values returns all elements of the InventoryIncludedObjectVersions enum -func InventoryIncludedObjectVersions_Values() []string { - return []string{ - InventoryIncludedObjectVersionsAll, - InventoryIncludedObjectVersionsCurrent, - } -} - -const ( - // InventoryOptionalFieldSize is a InventoryOptionalField enum value - InventoryOptionalFieldSize = "Size" - - // InventoryOptionalFieldLastModifiedDate is a InventoryOptionalField enum value - InventoryOptionalFieldLastModifiedDate = "LastModifiedDate" - - // InventoryOptionalFieldStorageClass is a InventoryOptionalField enum value - InventoryOptionalFieldStorageClass = "StorageClass" - - // InventoryOptionalFieldEtag is a InventoryOptionalField enum value - InventoryOptionalFieldEtag = "ETag" - - // InventoryOptionalFieldIsMultipartUploaded is a InventoryOptionalField enum value - InventoryOptionalFieldIsMultipartUploaded = "IsMultipartUploaded" - - // InventoryOptionalFieldReplicationStatus is a InventoryOptionalField enum value - InventoryOptionalFieldReplicationStatus = "ReplicationStatus" - - // InventoryOptionalFieldEncryptionStatus is a InventoryOptionalField enum value - InventoryOptionalFieldEncryptionStatus = "EncryptionStatus" - - // InventoryOptionalFieldObjectLockRetainUntilDate is a InventoryOptionalField enum value - InventoryOptionalFieldObjectLockRetainUntilDate = "ObjectLockRetainUntilDate" - - // InventoryOptionalFieldObjectLockMode is a InventoryOptionalField enum value - InventoryOptionalFieldObjectLockMode = "ObjectLockMode" - - // InventoryOptionalFieldObjectLockLegalHoldStatus is a InventoryOptionalField enum value - InventoryOptionalFieldObjectLockLegalHoldStatus = "ObjectLockLegalHoldStatus" - - // InventoryOptionalFieldIntelligentTieringAccessTier is a InventoryOptionalField enum value - InventoryOptionalFieldIntelligentTieringAccessTier = "IntelligentTieringAccessTier" - - // InventoryOptionalFieldBucketKeyStatus is a InventoryOptionalField enum value - InventoryOptionalFieldBucketKeyStatus = "BucketKeyStatus" - - // InventoryOptionalFieldChecksumAlgorithm is a InventoryOptionalField enum value - InventoryOptionalFieldChecksumAlgorithm = "ChecksumAlgorithm" -) - -// InventoryOptionalField_Values returns all elements of the InventoryOptionalField enum -func InventoryOptionalField_Values() []string { - return []string{ - InventoryOptionalFieldSize, - InventoryOptionalFieldLastModifiedDate, - InventoryOptionalFieldStorageClass, - InventoryOptionalFieldEtag, - InventoryOptionalFieldIsMultipartUploaded, - InventoryOptionalFieldReplicationStatus, - InventoryOptionalFieldEncryptionStatus, - InventoryOptionalFieldObjectLockRetainUntilDate, - InventoryOptionalFieldObjectLockMode, - InventoryOptionalFieldObjectLockLegalHoldStatus, - InventoryOptionalFieldIntelligentTieringAccessTier, - InventoryOptionalFieldBucketKeyStatus, - InventoryOptionalFieldChecksumAlgorithm, - } -} - -const ( - // JSONTypeDocument is a JSONType enum value - JSONTypeDocument = "DOCUMENT" - - // JSONTypeLines is a JSONType enum value - JSONTypeLines = "LINES" -) - -// JSONType_Values returns all elements of the JSONType enum -func JSONType_Values() []string { - return []string{ - JSONTypeDocument, - JSONTypeLines, - } -} - -const ( - // MFADeleteEnabled is a MFADelete enum value - MFADeleteEnabled = "Enabled" - - // MFADeleteDisabled is a MFADelete enum value - MFADeleteDisabled = "Disabled" -) - -// MFADelete_Values returns all elements of the MFADelete enum -func MFADelete_Values() []string { - return []string{ - MFADeleteEnabled, - MFADeleteDisabled, - } -} - -const ( - // MFADeleteStatusEnabled is a MFADeleteStatus enum value - MFADeleteStatusEnabled = "Enabled" - - // MFADeleteStatusDisabled is a MFADeleteStatus enum value - MFADeleteStatusDisabled = "Disabled" -) - -// MFADeleteStatus_Values returns all elements of the MFADeleteStatus enum -func MFADeleteStatus_Values() []string { - return []string{ - MFADeleteStatusEnabled, - MFADeleteStatusDisabled, - } -} - -const ( - // MetadataDirectiveCopy is a MetadataDirective enum value - MetadataDirectiveCopy = "COPY" - - // MetadataDirectiveReplace is a MetadataDirective enum value - MetadataDirectiveReplace = "REPLACE" -) - -// MetadataDirective_Values returns all elements of the MetadataDirective enum -func MetadataDirective_Values() []string { - return []string{ - MetadataDirectiveCopy, - MetadataDirectiveReplace, - } -} - -const ( - // MetricsStatusEnabled is a MetricsStatus enum value - MetricsStatusEnabled = "Enabled" - - // MetricsStatusDisabled is a MetricsStatus enum value - MetricsStatusDisabled = "Disabled" -) - -// MetricsStatus_Values returns all elements of the MetricsStatus enum -func MetricsStatus_Values() []string { - return []string{ - MetricsStatusEnabled, - MetricsStatusDisabled, - } -} - -const ( - // ObjectAttributesEtag is a ObjectAttributes enum value - ObjectAttributesEtag = "ETag" - - // ObjectAttributesChecksum is a ObjectAttributes enum value - ObjectAttributesChecksum = "Checksum" - - // ObjectAttributesObjectParts is a ObjectAttributes enum value - ObjectAttributesObjectParts = "ObjectParts" - - // ObjectAttributesStorageClass is a ObjectAttributes enum value - ObjectAttributesStorageClass = "StorageClass" - - // ObjectAttributesObjectSize is a ObjectAttributes enum value - ObjectAttributesObjectSize = "ObjectSize" -) - -// ObjectAttributes_Values returns all elements of the ObjectAttributes enum -func ObjectAttributes_Values() []string { - return []string{ - ObjectAttributesEtag, - ObjectAttributesChecksum, - ObjectAttributesObjectParts, - ObjectAttributesStorageClass, - ObjectAttributesObjectSize, - } -} - -const ( - // ObjectCannedACLPrivate is a ObjectCannedACL enum value - ObjectCannedACLPrivate = "private" - - // ObjectCannedACLPublicRead is a ObjectCannedACL enum value - ObjectCannedACLPublicRead = "public-read" - - // ObjectCannedACLPublicReadWrite is a ObjectCannedACL enum value - ObjectCannedACLPublicReadWrite = "public-read-write" - - // ObjectCannedACLAuthenticatedRead is a ObjectCannedACL enum value - ObjectCannedACLAuthenticatedRead = "authenticated-read" - - // ObjectCannedACLAwsExecRead is a ObjectCannedACL enum value - ObjectCannedACLAwsExecRead = "aws-exec-read" - - // ObjectCannedACLBucketOwnerRead is a ObjectCannedACL enum value - ObjectCannedACLBucketOwnerRead = "bucket-owner-read" - - // ObjectCannedACLBucketOwnerFullControl is a ObjectCannedACL enum value - ObjectCannedACLBucketOwnerFullControl = "bucket-owner-full-control" -) - -// ObjectCannedACL_Values returns all elements of the ObjectCannedACL enum -func ObjectCannedACL_Values() []string { - return []string{ - ObjectCannedACLPrivate, - ObjectCannedACLPublicRead, - ObjectCannedACLPublicReadWrite, - ObjectCannedACLAuthenticatedRead, - ObjectCannedACLAwsExecRead, - ObjectCannedACLBucketOwnerRead, - ObjectCannedACLBucketOwnerFullControl, - } -} - -const ( - // ObjectLockEnabledEnabled is a ObjectLockEnabled enum value - ObjectLockEnabledEnabled = "Enabled" -) - -// ObjectLockEnabled_Values returns all elements of the ObjectLockEnabled enum -func ObjectLockEnabled_Values() []string { - return []string{ - ObjectLockEnabledEnabled, - } -} - -const ( - // ObjectLockLegalHoldStatusOn is a ObjectLockLegalHoldStatus enum value - ObjectLockLegalHoldStatusOn = "ON" - - // ObjectLockLegalHoldStatusOff is a ObjectLockLegalHoldStatus enum value - ObjectLockLegalHoldStatusOff = "OFF" -) - -// ObjectLockLegalHoldStatus_Values returns all elements of the ObjectLockLegalHoldStatus enum -func ObjectLockLegalHoldStatus_Values() []string { - return []string{ - ObjectLockLegalHoldStatusOn, - ObjectLockLegalHoldStatusOff, - } -} - -const ( - // ObjectLockModeGovernance is a ObjectLockMode enum value - ObjectLockModeGovernance = "GOVERNANCE" - - // ObjectLockModeCompliance is a ObjectLockMode enum value - ObjectLockModeCompliance = "COMPLIANCE" -) - -// ObjectLockMode_Values returns all elements of the ObjectLockMode enum -func ObjectLockMode_Values() []string { - return []string{ - ObjectLockModeGovernance, - ObjectLockModeCompliance, - } -} - -const ( - // ObjectLockRetentionModeGovernance is a ObjectLockRetentionMode enum value - ObjectLockRetentionModeGovernance = "GOVERNANCE" - - // ObjectLockRetentionModeCompliance is a ObjectLockRetentionMode enum value - ObjectLockRetentionModeCompliance = "COMPLIANCE" -) - -// ObjectLockRetentionMode_Values returns all elements of the ObjectLockRetentionMode enum -func ObjectLockRetentionMode_Values() []string { - return []string{ - ObjectLockRetentionModeGovernance, - ObjectLockRetentionModeCompliance, - } -} - -// The container element for object ownership for a bucket's ownership controls. -// -// BucketOwnerPreferred - Objects uploaded to the bucket change ownership to -// the bucket owner if the objects are uploaded with the bucket-owner-full-control -// canned ACL. -// -// ObjectWriter - The uploading account will own the object if the object is -// uploaded with the bucket-owner-full-control canned ACL. -// -// BucketOwnerEnforced - Access control lists (ACLs) are disabled and no longer -// affect permissions. The bucket owner automatically owns and has full control -// over every object in the bucket. The bucket only accepts PUT requests that -// don't specify an ACL or bucket owner full control ACLs, such as the bucket-owner-full-control -// canned ACL or an equivalent form of this ACL expressed in the XML format. -const ( - // ObjectOwnershipBucketOwnerPreferred is a ObjectOwnership enum value - ObjectOwnershipBucketOwnerPreferred = "BucketOwnerPreferred" - - // ObjectOwnershipObjectWriter is a ObjectOwnership enum value - ObjectOwnershipObjectWriter = "ObjectWriter" - - // ObjectOwnershipBucketOwnerEnforced is a ObjectOwnership enum value - ObjectOwnershipBucketOwnerEnforced = "BucketOwnerEnforced" -) - -// ObjectOwnership_Values returns all elements of the ObjectOwnership enum -func ObjectOwnership_Values() []string { - return []string{ - ObjectOwnershipBucketOwnerPreferred, - ObjectOwnershipObjectWriter, - ObjectOwnershipBucketOwnerEnforced, - } -} - -const ( - // ObjectStorageClassStandard is a ObjectStorageClass enum value - ObjectStorageClassStandard = "STANDARD" - - // ObjectStorageClassReducedRedundancy is a ObjectStorageClass enum value - ObjectStorageClassReducedRedundancy = "REDUCED_REDUNDANCY" - - // ObjectStorageClassGlacier is a ObjectStorageClass enum value - ObjectStorageClassGlacier = "GLACIER" - - // ObjectStorageClassStandardIa is a ObjectStorageClass enum value - ObjectStorageClassStandardIa = "STANDARD_IA" - - // ObjectStorageClassOnezoneIa is a ObjectStorageClass enum value - ObjectStorageClassOnezoneIa = "ONEZONE_IA" - - // ObjectStorageClassIntelligentTiering is a ObjectStorageClass enum value - ObjectStorageClassIntelligentTiering = "INTELLIGENT_TIERING" - - // ObjectStorageClassDeepArchive is a ObjectStorageClass enum value - ObjectStorageClassDeepArchive = "DEEP_ARCHIVE" - - // ObjectStorageClassOutposts is a ObjectStorageClass enum value - ObjectStorageClassOutposts = "OUTPOSTS" - - // ObjectStorageClassGlacierIr is a ObjectStorageClass enum value - ObjectStorageClassGlacierIr = "GLACIER_IR" -) - -// ObjectStorageClass_Values returns all elements of the ObjectStorageClass enum -func ObjectStorageClass_Values() []string { - return []string{ - ObjectStorageClassStandard, - ObjectStorageClassReducedRedundancy, - ObjectStorageClassGlacier, - ObjectStorageClassStandardIa, - ObjectStorageClassOnezoneIa, - ObjectStorageClassIntelligentTiering, - ObjectStorageClassDeepArchive, - ObjectStorageClassOutposts, - ObjectStorageClassGlacierIr, - } -} - -const ( - // ObjectVersionStorageClassStandard is a ObjectVersionStorageClass enum value - ObjectVersionStorageClassStandard = "STANDARD" -) - -// ObjectVersionStorageClass_Values returns all elements of the ObjectVersionStorageClass enum -func ObjectVersionStorageClass_Values() []string { - return []string{ - ObjectVersionStorageClassStandard, - } -} - -const ( - // OwnerOverrideDestination is a OwnerOverride enum value - OwnerOverrideDestination = "Destination" -) - -// OwnerOverride_Values returns all elements of the OwnerOverride enum -func OwnerOverride_Values() []string { - return []string{ - OwnerOverrideDestination, - } -} - -const ( - // PayerRequester is a Payer enum value - PayerRequester = "Requester" - - // PayerBucketOwner is a Payer enum value - PayerBucketOwner = "BucketOwner" -) - -// Payer_Values returns all elements of the Payer enum -func Payer_Values() []string { - return []string{ - PayerRequester, - PayerBucketOwner, - } -} - -const ( - // PermissionFullControl is a Permission enum value - PermissionFullControl = "FULL_CONTROL" - - // PermissionWrite is a Permission enum value - PermissionWrite = "WRITE" - - // PermissionWriteAcp is a Permission enum value - PermissionWriteAcp = "WRITE_ACP" - - // PermissionRead is a Permission enum value - PermissionRead = "READ" - - // PermissionReadAcp is a Permission enum value - PermissionReadAcp = "READ_ACP" -) - -// Permission_Values returns all elements of the Permission enum -func Permission_Values() []string { - return []string{ - PermissionFullControl, - PermissionWrite, - PermissionWriteAcp, - PermissionRead, - PermissionReadAcp, - } -} - -const ( - // ProtocolHttp is a Protocol enum value - ProtocolHttp = "http" - - // ProtocolHttps is a Protocol enum value - ProtocolHttps = "https" -) - -// Protocol_Values returns all elements of the Protocol enum -func Protocol_Values() []string { - return []string{ - ProtocolHttp, - ProtocolHttps, - } -} - -const ( - // QuoteFieldsAlways is a QuoteFields enum value - QuoteFieldsAlways = "ALWAYS" - - // QuoteFieldsAsneeded is a QuoteFields enum value - QuoteFieldsAsneeded = "ASNEEDED" -) - -// QuoteFields_Values returns all elements of the QuoteFields enum -func QuoteFields_Values() []string { - return []string{ - QuoteFieldsAlways, - QuoteFieldsAsneeded, - } -} - -const ( - // ReplicaModificationsStatusEnabled is a ReplicaModificationsStatus enum value - ReplicaModificationsStatusEnabled = "Enabled" - - // ReplicaModificationsStatusDisabled is a ReplicaModificationsStatus enum value - ReplicaModificationsStatusDisabled = "Disabled" -) - -// ReplicaModificationsStatus_Values returns all elements of the ReplicaModificationsStatus enum -func ReplicaModificationsStatus_Values() []string { - return []string{ - ReplicaModificationsStatusEnabled, - ReplicaModificationsStatusDisabled, - } -} - -const ( - // ReplicationRuleStatusEnabled is a ReplicationRuleStatus enum value - ReplicationRuleStatusEnabled = "Enabled" - - // ReplicationRuleStatusDisabled is a ReplicationRuleStatus enum value - ReplicationRuleStatusDisabled = "Disabled" -) - -// ReplicationRuleStatus_Values returns all elements of the ReplicationRuleStatus enum -func ReplicationRuleStatus_Values() []string { - return []string{ - ReplicationRuleStatusEnabled, - ReplicationRuleStatusDisabled, - } -} - -const ( - // ReplicationStatusComplete is a ReplicationStatus enum value - ReplicationStatusComplete = "COMPLETE" - - // ReplicationStatusPending is a ReplicationStatus enum value - ReplicationStatusPending = "PENDING" - - // ReplicationStatusFailed is a ReplicationStatus enum value - ReplicationStatusFailed = "FAILED" - - // ReplicationStatusReplica is a ReplicationStatus enum value - ReplicationStatusReplica = "REPLICA" -) - -// ReplicationStatus_Values returns all elements of the ReplicationStatus enum -func ReplicationStatus_Values() []string { - return []string{ - ReplicationStatusComplete, - ReplicationStatusPending, - ReplicationStatusFailed, - ReplicationStatusReplica, - } -} - -const ( - // ReplicationTimeStatusEnabled is a ReplicationTimeStatus enum value - ReplicationTimeStatusEnabled = "Enabled" - - // ReplicationTimeStatusDisabled is a ReplicationTimeStatus enum value - ReplicationTimeStatusDisabled = "Disabled" -) - -// ReplicationTimeStatus_Values returns all elements of the ReplicationTimeStatus enum -func ReplicationTimeStatus_Values() []string { - return []string{ - ReplicationTimeStatusEnabled, - ReplicationTimeStatusDisabled, - } -} - -// If present, indicates that the requester was successfully charged for the -// request. -const ( - // RequestChargedRequester is a RequestCharged enum value - RequestChargedRequester = "requester" -) - -// RequestCharged_Values returns all elements of the RequestCharged enum -func RequestCharged_Values() []string { - return []string{ - RequestChargedRequester, - } -} - -// Confirms that the requester knows that they will be charged for the request. -// Bucket owners need not specify this parameter in their requests. For information -// about downloading objects from Requester Pays buckets, see Downloading Objects -// in Requester Pays Buckets (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html) -// in the Amazon S3 User Guide. -const ( - // RequestPayerRequester is a RequestPayer enum value - RequestPayerRequester = "requester" -) - -// RequestPayer_Values returns all elements of the RequestPayer enum -func RequestPayer_Values() []string { - return []string{ - RequestPayerRequester, - } -} - -const ( - // RestoreRequestTypeSelect is a RestoreRequestType enum value - RestoreRequestTypeSelect = "SELECT" -) - -// RestoreRequestType_Values returns all elements of the RestoreRequestType enum -func RestoreRequestType_Values() []string { - return []string{ - RestoreRequestTypeSelect, - } -} - -const ( - // ServerSideEncryptionAes256 is a ServerSideEncryption enum value - ServerSideEncryptionAes256 = "AES256" - - // ServerSideEncryptionAwsKms is a ServerSideEncryption enum value - ServerSideEncryptionAwsKms = "aws:kms" -) - -// ServerSideEncryption_Values returns all elements of the ServerSideEncryption enum -func ServerSideEncryption_Values() []string { - return []string{ - ServerSideEncryptionAes256, - ServerSideEncryptionAwsKms, - } -} - -const ( - // SseKmsEncryptedObjectsStatusEnabled is a SseKmsEncryptedObjectsStatus enum value - SseKmsEncryptedObjectsStatusEnabled = "Enabled" - - // SseKmsEncryptedObjectsStatusDisabled is a SseKmsEncryptedObjectsStatus enum value - SseKmsEncryptedObjectsStatusDisabled = "Disabled" -) - -// SseKmsEncryptedObjectsStatus_Values returns all elements of the SseKmsEncryptedObjectsStatus enum -func SseKmsEncryptedObjectsStatus_Values() []string { - return []string{ - SseKmsEncryptedObjectsStatusEnabled, - SseKmsEncryptedObjectsStatusDisabled, - } -} - -const ( - // StorageClassStandard is a StorageClass enum value - StorageClassStandard = "STANDARD" - - // StorageClassReducedRedundancy is a StorageClass enum value - StorageClassReducedRedundancy = "REDUCED_REDUNDANCY" - - // StorageClassStandardIa is a StorageClass enum value - StorageClassStandardIa = "STANDARD_IA" - - // StorageClassOnezoneIa is a StorageClass enum value - StorageClassOnezoneIa = "ONEZONE_IA" - - // StorageClassIntelligentTiering is a StorageClass enum value - StorageClassIntelligentTiering = "INTELLIGENT_TIERING" - - // StorageClassGlacier is a StorageClass enum value - StorageClassGlacier = "GLACIER" - - // StorageClassDeepArchive is a StorageClass enum value - StorageClassDeepArchive = "DEEP_ARCHIVE" - - // StorageClassOutposts is a StorageClass enum value - StorageClassOutposts = "OUTPOSTS" - - // StorageClassGlacierIr is a StorageClass enum value - StorageClassGlacierIr = "GLACIER_IR" -) - -// StorageClass_Values returns all elements of the StorageClass enum -func StorageClass_Values() []string { - return []string{ - StorageClassStandard, - StorageClassReducedRedundancy, - StorageClassStandardIa, - StorageClassOnezoneIa, - StorageClassIntelligentTiering, - StorageClassGlacier, - StorageClassDeepArchive, - StorageClassOutposts, - StorageClassGlacierIr, - } -} - -const ( - // StorageClassAnalysisSchemaVersionV1 is a StorageClassAnalysisSchemaVersion enum value - StorageClassAnalysisSchemaVersionV1 = "V_1" -) - -// StorageClassAnalysisSchemaVersion_Values returns all elements of the StorageClassAnalysisSchemaVersion enum -func StorageClassAnalysisSchemaVersion_Values() []string { - return []string{ - StorageClassAnalysisSchemaVersionV1, - } -} - -const ( - // TaggingDirectiveCopy is a TaggingDirective enum value - TaggingDirectiveCopy = "COPY" - - // TaggingDirectiveReplace is a TaggingDirective enum value - TaggingDirectiveReplace = "REPLACE" -) - -// TaggingDirective_Values returns all elements of the TaggingDirective enum -func TaggingDirective_Values() []string { - return []string{ - TaggingDirectiveCopy, - TaggingDirectiveReplace, - } -} - -const ( - // TierStandard is a Tier enum value - TierStandard = "Standard" - - // TierBulk is a Tier enum value - TierBulk = "Bulk" - - // TierExpedited is a Tier enum value - TierExpedited = "Expedited" -) - -// Tier_Values returns all elements of the Tier enum -func Tier_Values() []string { - return []string{ - TierStandard, - TierBulk, - TierExpedited, - } -} - -const ( - // TransitionStorageClassGlacier is a TransitionStorageClass enum value - TransitionStorageClassGlacier = "GLACIER" - - // TransitionStorageClassStandardIa is a TransitionStorageClass enum value - TransitionStorageClassStandardIa = "STANDARD_IA" - - // TransitionStorageClassOnezoneIa is a TransitionStorageClass enum value - TransitionStorageClassOnezoneIa = "ONEZONE_IA" - - // TransitionStorageClassIntelligentTiering is a TransitionStorageClass enum value - TransitionStorageClassIntelligentTiering = "INTELLIGENT_TIERING" - - // TransitionStorageClassDeepArchive is a TransitionStorageClass enum value - TransitionStorageClassDeepArchive = "DEEP_ARCHIVE" - - // TransitionStorageClassGlacierIr is a TransitionStorageClass enum value - TransitionStorageClassGlacierIr = "GLACIER_IR" -) - -// TransitionStorageClass_Values returns all elements of the TransitionStorageClass enum -func TransitionStorageClass_Values() []string { - return []string{ - TransitionStorageClassGlacier, - TransitionStorageClassStandardIa, - TransitionStorageClassOnezoneIa, - TransitionStorageClassIntelligentTiering, - TransitionStorageClassDeepArchive, - TransitionStorageClassGlacierIr, - } -} - -const ( - // TypeCanonicalUser is a Type enum value - TypeCanonicalUser = "CanonicalUser" - - // TypeAmazonCustomerByEmail is a Type enum value - TypeAmazonCustomerByEmail = "AmazonCustomerByEmail" - - // TypeGroup is a Type enum value - TypeGroup = "Group" -) - -// Type_Values returns all elements of the Type enum -func Type_Values() []string { - return []string{ - TypeCanonicalUser, - TypeAmazonCustomerByEmail, - TypeGroup, - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/body_hash.go b/vendor/github.com/aws/aws-sdk-go/service/s3/body_hash.go deleted file mode 100644 index 407f06b6ed..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/body_hash.go +++ /dev/null @@ -1,202 +0,0 @@ -package s3 - -import ( - "bytes" - "crypto/md5" - "crypto/sha256" - "encoding/base64" - "encoding/hex" - "fmt" - "hash" - "io" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" -) - -const ( - contentMD5Header = "Content-Md5" - contentSha256Header = "X-Amz-Content-Sha256" - amzTeHeader = "X-Amz-Te" - amzTxEncodingHeader = "X-Amz-Transfer-Encoding" - - appendMD5TxEncoding = "append-md5" -) - -// computeBodyHashes will add Content MD5 and Content Sha256 hashes to the -// request. If the body is not seekable or S3DisableContentMD5Validation set -// this handler will be ignored. -func computeBodyHashes(r *request.Request) { - if aws.BoolValue(r.Config.S3DisableContentMD5Validation) { - return - } - if r.IsPresigned() { - return - } - if r.Error != nil || !aws.IsReaderSeekable(r.Body) { - return - } - - var md5Hash, sha256Hash hash.Hash - hashers := make([]io.Writer, 0, 2) - - // Determine upfront which hashes can be set without overriding user - // provide header data. - if v := r.HTTPRequest.Header.Get(contentMD5Header); len(v) == 0 { - md5Hash = md5.New() - hashers = append(hashers, md5Hash) - } - - if v := r.HTTPRequest.Header.Get(contentSha256Header); len(v) == 0 { - sha256Hash = sha256.New() - hashers = append(hashers, sha256Hash) - } - - // Create the destination writer based on the hashes that are not already - // provided by the user. - var dst io.Writer - switch len(hashers) { - case 0: - return - case 1: - dst = hashers[0] - default: - dst = io.MultiWriter(hashers...) - } - - if _, err := aws.CopySeekableBody(dst, r.Body); err != nil { - r.Error = awserr.New("BodyHashError", "failed to compute body hashes", err) - return - } - - // For the hashes created, set the associated headers that the user did not - // already provide. - if md5Hash != nil { - sum := make([]byte, md5.Size) - encoded := make([]byte, md5Base64EncLen) - - base64.StdEncoding.Encode(encoded, md5Hash.Sum(sum[0:0])) - r.HTTPRequest.Header[contentMD5Header] = []string{string(encoded)} - } - - if sha256Hash != nil { - encoded := make([]byte, sha256HexEncLen) - sum := make([]byte, sha256.Size) - - hex.Encode(encoded, sha256Hash.Sum(sum[0:0])) - r.HTTPRequest.Header[contentSha256Header] = []string{string(encoded)} - } -} - -const ( - md5Base64EncLen = (md5.Size + 2) / 3 * 4 // base64.StdEncoding.EncodedLen - sha256HexEncLen = sha256.Size * 2 // hex.EncodedLen -) - -// Adds the x-amz-te: append_md5 header to the request. This requests the service -// responds with a trailing MD5 checksum. -// -// Will not ask for append MD5 if disabled, the request is presigned or, -// or the API operation does not support content MD5 validation. -func askForTxEncodingAppendMD5(r *request.Request) { - if aws.BoolValue(r.Config.S3DisableContentMD5Validation) { - return - } - if r.IsPresigned() { - return - } - r.HTTPRequest.Header.Set(amzTeHeader, appendMD5TxEncoding) -} - -func useMD5ValidationReader(r *request.Request) { - if r.Error != nil { - return - } - - if v := r.HTTPResponse.Header.Get(amzTxEncodingHeader); v != appendMD5TxEncoding { - return - } - - var bodyReader *io.ReadCloser - var contentLen int64 - switch tv := r.Data.(type) { - case *GetObjectOutput: - bodyReader = &tv.Body - contentLen = aws.Int64Value(tv.ContentLength) - // Update ContentLength hiden the trailing MD5 checksum. - tv.ContentLength = aws.Int64(contentLen - md5.Size) - tv.ContentRange = aws.String(r.HTTPResponse.Header.Get("X-Amz-Content-Range")) - default: - r.Error = awserr.New("ChecksumValidationError", - fmt.Sprintf("%s: %s header received on unsupported API, %s", - amzTxEncodingHeader, appendMD5TxEncoding, r.Operation.Name, - ), nil) - return - } - - if contentLen < md5.Size { - r.Error = awserr.New("ChecksumValidationError", - fmt.Sprintf("invalid Content-Length %d for %s %s", - contentLen, appendMD5TxEncoding, amzTxEncodingHeader, - ), nil) - return - } - - // Wrap and swap the response body reader with the validation reader. - *bodyReader = newMD5ValidationReader(*bodyReader, contentLen-md5.Size) -} - -type md5ValidationReader struct { - rawReader io.ReadCloser - payload io.Reader - hash hash.Hash - - payloadLen int64 - read int64 -} - -func newMD5ValidationReader(reader io.ReadCloser, payloadLen int64) *md5ValidationReader { - h := md5.New() - return &md5ValidationReader{ - rawReader: reader, - payload: io.TeeReader(&io.LimitedReader{R: reader, N: payloadLen}, h), - hash: h, - payloadLen: payloadLen, - } -} - -func (v *md5ValidationReader) Read(p []byte) (n int, err error) { - n, err = v.payload.Read(p) - if err != nil && err != io.EOF { - return n, err - } - - v.read += int64(n) - - if err == io.EOF { - if v.read != v.payloadLen { - return n, io.ErrUnexpectedEOF - } - expectSum := make([]byte, md5.Size) - actualSum := make([]byte, md5.Size) - if _, sumReadErr := io.ReadFull(v.rawReader, expectSum); sumReadErr != nil { - return n, sumReadErr - } - actualSum = v.hash.Sum(actualSum[0:0]) - if !bytes.Equal(expectSum, actualSum) { - return n, awserr.New("InvalidChecksum", - fmt.Sprintf("expected MD5 checksum %s, got %s", - hex.EncodeToString(expectSum), - hex.EncodeToString(actualSum), - ), - nil) - } - } - - return n, err -} - -func (v *md5ValidationReader) Close() error { - return v.rawReader.Close() -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/bucket_location.go b/vendor/github.com/aws/aws-sdk-go/service/s3/bucket_location.go deleted file mode 100644 index 20828387ea..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/bucket_location.go +++ /dev/null @@ -1,107 +0,0 @@ -package s3 - -import ( - "io/ioutil" - "regexp" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" -) - -var reBucketLocation = regexp.MustCompile(`>([^<>]+)<\/Location`) - -// NormalizeBucketLocation is a utility function which will update the -// passed in value to always be a region ID. Generally this would be used -// with GetBucketLocation API operation. -// -// Replaces empty string with "us-east-1", and "EU" with "eu-west-1". -// -// See http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html -// for more information on the values that can be returned. -func NormalizeBucketLocation(loc string) string { - switch loc { - case "": - loc = "us-east-1" - case "EU": - loc = "eu-west-1" - } - - return loc -} - -// NormalizeBucketLocationHandler is a request handler which will update the -// GetBucketLocation's result LocationConstraint value to always be a region ID. -// -// Replaces empty string with "us-east-1", and "EU" with "eu-west-1". -// -// See http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html -// for more information on the values that can be returned. -// -// req, result := svc.GetBucketLocationRequest(&s3.GetBucketLocationInput{ -// Bucket: aws.String(bucket), -// }) -// req.Handlers.Unmarshal.PushBackNamed(NormalizeBucketLocationHandler) -// err := req.Send() -var NormalizeBucketLocationHandler = request.NamedHandler{ - Name: "awssdk.s3.NormalizeBucketLocation", - Fn: func(req *request.Request) { - if req.Error != nil { - return - } - - out := req.Data.(*GetBucketLocationOutput) - loc := NormalizeBucketLocation(aws.StringValue(out.LocationConstraint)) - out.LocationConstraint = aws.String(loc) - }, -} - -// WithNormalizeBucketLocation is a request option which will update the -// GetBucketLocation's result LocationConstraint value to always be a region ID. -// -// Replaces empty string with "us-east-1", and "EU" with "eu-west-1". -// -// See http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketGETlocation.html -// for more information on the values that can be returned. -// -// result, err := svc.GetBucketLocationWithContext(ctx, -// &s3.GetBucketLocationInput{ -// Bucket: aws.String(bucket), -// }, -// s3.WithNormalizeBucketLocation, -// ) -func WithNormalizeBucketLocation(r *request.Request) { - r.Handlers.Unmarshal.PushBackNamed(NormalizeBucketLocationHandler) -} - -func buildGetBucketLocation(r *request.Request) { - if r.DataFilled() { - out := r.Data.(*GetBucketLocationOutput) - b, err := ioutil.ReadAll(r.HTTPResponse.Body) - if err != nil { - r.Error = awserr.New(request.ErrCodeSerialization, - "failed reading response body", err) - return - } - - match := reBucketLocation.FindSubmatch(b) - if len(match) > 1 { - loc := string(match[1]) - out.LocationConstraint = aws.String(loc) - } - } -} - -func populateLocationConstraint(r *request.Request) { - if r.ParamsFilled() && aws.StringValue(r.Config.Region) != "us-east-1" { - in := r.Params.(*CreateBucketInput) - if in.CreateBucketConfiguration == nil { - r.Params = awsutil.CopyOf(r.Params) - in = r.Params.(*CreateBucketInput) - in.CreateBucketConfiguration = &CreateBucketConfiguration{ - LocationConstraint: r.Config.Region, - } - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go b/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go deleted file mode 100644 index 229606b708..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/customizations.go +++ /dev/null @@ -1,89 +0,0 @@ -package s3 - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/internal/s3shared/arn" - "github.com/aws/aws-sdk-go/internal/s3shared/s3err" -) - -func init() { - initClient = defaultInitClientFn - initRequest = defaultInitRequestFn -} - -func defaultInitClientFn(c *client.Client) { - if c.Config.UseDualStackEndpoint == endpoints.DualStackEndpointStateUnset { - if aws.BoolValue(c.Config.UseDualStack) { - c.Config.UseDualStackEndpoint = endpoints.DualStackEndpointStateEnabled - } else { - c.Config.UseDualStackEndpoint = endpoints.DualStackEndpointStateDisabled - } - } - - // Support building custom endpoints based on config - c.Handlers.Build.PushFront(endpointHandler) - - // Require SSL when using SSE keys - c.Handlers.Validate.PushBack(validateSSERequiresSSL) - c.Handlers.Build.PushBack(computeSSEKeyMD5) - c.Handlers.Build.PushBack(computeCopySourceSSEKeyMD5) - - // S3 uses custom error unmarshaling logic - c.Handlers.UnmarshalError.Clear() - c.Handlers.UnmarshalError.PushBack(unmarshalError) - c.Handlers.UnmarshalError.PushBackNamed(s3err.RequestFailureWrapperHandler()) -} - -func defaultInitRequestFn(r *request.Request) { - // Add request handlers for specific platforms. - // e.g. 100-continue support for PUT requests using Go 1.6 - platformRequestHandlers(r) - - switch r.Operation.Name { - case opGetBucketLocation: - // GetBucketLocation has custom parsing logic - r.Handlers.Unmarshal.PushFront(buildGetBucketLocation) - case opCreateBucket: - // Auto-populate LocationConstraint with current region - r.Handlers.Validate.PushFront(populateLocationConstraint) - case opCopyObject, opUploadPartCopy, opCompleteMultipartUpload: - r.Handlers.Unmarshal.PushFront(copyMultipartStatusOKUnmarshalError) - r.Handlers.Unmarshal.PushBackNamed(s3err.RequestFailureWrapperHandler()) - case opPutObject, opUploadPart: - r.Handlers.Build.PushBack(computeBodyHashes) - // Disabled until #1837 root issue is resolved. - // case opGetObject: - // r.Handlers.Build.PushBack(askForTxEncodingAppendMD5) - // r.Handlers.Unmarshal.PushBack(useMD5ValidationReader) - case opWriteGetObjectResponse: - r.Handlers.Build.PushFront(buildWriteGetObjectResponseEndpoint) - } -} - -// bucketGetter is an accessor interface to grab the "Bucket" field from -// an S3 type. -type bucketGetter interface { - getBucket() string -} - -// sseCustomerKeyGetter is an accessor interface to grab the "SSECustomerKey" -// field from an S3 type. -type sseCustomerKeyGetter interface { - getSSECustomerKey() string -} - -// copySourceSSECustomerKeyGetter is an accessor interface to grab the -// "CopySourceSSECustomerKey" field from an S3 type. -type copySourceSSECustomerKeyGetter interface { - getCopySourceSSECustomerKey() string -} - -// endpointARNGetter is an accessor interface to grab the -// the field corresponding to an endpoint ARN input. -type endpointARNGetter interface { - getEndpointARN() (arn.Resource, error) - hasEndpointARN() bool -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/doc.go b/vendor/github.com/aws/aws-sdk-go/service/s3/doc.go deleted file mode 100644 index c148f757ee..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/doc.go +++ /dev/null @@ -1,26 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -// Package s3 provides the client and types for making API -// requests to Amazon Simple Storage Service. -// -// See https://docs.aws.amazon.com/goto/WebAPI/s3-2006-03-01 for more information on this service. -// -// See s3 package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/s3/ -// -// # Using the Client -// -// To contact Amazon Simple Storage Service with the SDK use the New function to create -// a new service client. With that client you can make API requests to the service. -// These clients are safe to use concurrently. -// -// See the SDK's documentation for more information on how to use the SDK. -// https://docs.aws.amazon.com/sdk-for-go/api/ -// -// See aws.Config documentation for more information on configuring SDK clients. -// https://docs.aws.amazon.com/sdk-for-go/api/aws/#Config -// -// See the Amazon Simple Storage Service client S3 for more -// information on creating client for this service. -// https://docs.aws.amazon.com/sdk-for-go/api/service/s3/#New -package s3 diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go b/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go deleted file mode 100644 index 2e8244f8f6..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/doc_custom.go +++ /dev/null @@ -1,109 +0,0 @@ -// Upload Managers -// -// The s3manager package's Uploader provides concurrent upload of content to S3 -// by taking advantage of S3's Multipart APIs. The Uploader also supports both -// io.Reader for streaming uploads, and will also take advantage of io.ReadSeeker -// for optimizations if the Body satisfies that type. Once the Uploader instance -// is created you can call Upload concurrently from multiple goroutines safely. -// -// // The session the S3 Uploader will use -// sess := session.Must(session.NewSession()) -// -// // Create an uploader with the session and default options -// uploader := s3manager.NewUploader(sess) -// -// f, err := os.Open(filename) -// if err != nil { -// return fmt.Errorf("failed to open file %q, %v", filename, err) -// } -// -// // Upload the file to S3. -// result, err := uploader.Upload(&s3manager.UploadInput{ -// Bucket: aws.String(myBucket), -// Key: aws.String(myString), -// Body: f, -// }) -// if err != nil { -// return fmt.Errorf("failed to upload file, %v", err) -// } -// fmt.Printf("file uploaded to, %s\n", aws.StringValue(result.Location)) -// -// See the s3manager package's Uploader type documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/s3/s3manager/#Uploader -// -// # Download Manager -// -// The s3manager package's Downloader provides concurrently downloading of Objects -// from S3. The Downloader will write S3 Object content with an io.WriterAt. -// Once the Downloader instance is created you can call Download concurrently from -// multiple goroutines safely. -// -// // The session the S3 Downloader will use -// sess := session.Must(session.NewSession()) -// -// // Create a downloader with the session and default options -// downloader := s3manager.NewDownloader(sess) -// -// // Create a file to write the S3 Object contents to. -// f, err := os.Create(filename) -// if err != nil { -// return fmt.Errorf("failed to create file %q, %v", filename, err) -// } -// -// // Write the contents of S3 Object to the file -// n, err := downloader.Download(f, &s3.GetObjectInput{ -// Bucket: aws.String(myBucket), -// Key: aws.String(myString), -// }) -// if err != nil { -// return fmt.Errorf("failed to download file, %v", err) -// } -// fmt.Printf("file downloaded, %d bytes\n", n) -// -// See the s3manager package's Downloader type documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/s3/s3manager/#Downloader -// -// # Automatic URI cleaning -// -// Interacting with objects whose keys contain adjacent slashes (e.g. bucketname/foo//bar/objectname) -// requires setting DisableRestProtocolURICleaning to true in the aws.Config struct -// used by the service client. -// -// svc := s3.New(sess, &aws.Config{ -// DisableRestProtocolURICleaning: aws.Bool(true), -// }) -// out, err := svc.GetObject(&s3.GetObjectInput { -// Bucket: aws.String("bucketname"), -// Key: aws.String("//foo//bar//moo"), -// }) -// -// # Get Bucket Region -// -// GetBucketRegion will attempt to get the region for a bucket using a region -// hint to determine which AWS partition to perform the query on. Use this utility -// to determine the region a bucket is in. -// -// sess := session.Must(session.NewSession()) -// -// bucket := "my-bucket" -// region, err := s3manager.GetBucketRegion(ctx, sess, bucket, "us-west-2") -// if err != nil { -// if aerr, ok := err.(awserr.Error); ok && aerr.Code() == "NotFound" { -// fmt.Fprintf(os.Stderr, "unable to find bucket %s's region not found\n", bucket) -// } -// return err -// } -// fmt.Printf("Bucket %s is in %s region\n", bucket, region) -// -// See the s3manager package's GetBucketRegion function documentation for more information -// https://docs.aws.amazon.com/sdk-for-go/api/service/s3/s3manager/#GetBucketRegion -// -// # S3 Crypto Client -// -// The s3crypto package provides the tools to upload and download encrypted -// content from S3. The Encryption and Decryption clients can be used concurrently -// once the client is created. -// -// See the s3crypto package documentation for more information. -// https://docs.aws.amazon.com/sdk-for-go/api/service/s3/s3crypto/ -package s3 diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint.go b/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint.go deleted file mode 100644 index 71b4386926..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint.go +++ /dev/null @@ -1,298 +0,0 @@ -package s3 - -import ( - "fmt" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/endpoints" - "net/url" - "strings" - - "github.com/aws/aws-sdk-go/aws" - awsarn "github.com/aws/aws-sdk-go/aws/arn" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/internal/s3shared" - "github.com/aws/aws-sdk-go/internal/s3shared/arn" -) - -const ( - s3Namespace = "s3" - s3AccessPointNamespace = "s3-accesspoint" - s3ObjectsLambdaNamespace = "s3-object-lambda" - s3OutpostsNamespace = "s3-outposts" -) - -// Used by shapes with members decorated as endpoint ARN. -func parseEndpointARN(v string) (arn.Resource, error) { - return arn.ParseResource(v, accessPointResourceParser) -} - -func accessPointResourceParser(a awsarn.ARN) (arn.Resource, error) { - resParts := arn.SplitResource(a.Resource) - switch resParts[0] { - case "accesspoint": - switch a.Service { - case s3Namespace: - return arn.ParseAccessPointResource(a, resParts[1:]) - case s3ObjectsLambdaNamespace: - return parseS3ObjectLambdaAccessPointResource(a, resParts) - default: - return arn.AccessPointARN{}, arn.InvalidARNError{ARN: a, Reason: fmt.Sprintf("service is not %s or %s", s3Namespace, s3ObjectsLambdaNamespace)} - } - case "outpost": - if a.Service != "s3-outposts" { - return arn.OutpostAccessPointARN{}, arn.InvalidARNError{ARN: a, Reason: "service is not s3-outposts"} - } - return parseOutpostAccessPointResource(a, resParts[1:]) - default: - return nil, arn.InvalidARNError{ARN: a, Reason: "unknown resource type"} - } -} - -// parseOutpostAccessPointResource attempts to parse the ARNs resource as an -// outpost access-point resource. -// -// Supported Outpost AccessPoint ARN format: -// - ARN format: arn:{partition}:s3-outposts:{region}:{accountId}:outpost/{outpostId}/accesspoint/{accesspointName} -// - example: arn:aws:s3-outposts:us-west-2:012345678901:outpost/op-1234567890123456/accesspoint/myaccesspoint -func parseOutpostAccessPointResource(a awsarn.ARN, resParts []string) (arn.OutpostAccessPointARN, error) { - // outpost accesspoint arn is only valid if service is s3-outposts - if a.Service != "s3-outposts" { - return arn.OutpostAccessPointARN{}, arn.InvalidARNError{ARN: a, Reason: "service is not s3-outposts"} - } - - if len(resParts) == 0 { - return arn.OutpostAccessPointARN{}, arn.InvalidARNError{ARN: a, Reason: "outpost resource-id not set"} - } - - if len(resParts) < 3 { - return arn.OutpostAccessPointARN{}, arn.InvalidARNError{ - ARN: a, Reason: "access-point resource not set in Outpost ARN", - } - } - - resID := strings.TrimSpace(resParts[0]) - if len(resID) == 0 { - return arn.OutpostAccessPointARN{}, arn.InvalidARNError{ARN: a, Reason: "outpost resource-id not set"} - } - - var outpostAccessPointARN = arn.OutpostAccessPointARN{} - switch resParts[1] { - case "accesspoint": - accessPointARN, err := arn.ParseAccessPointResource(a, resParts[2:]) - if err != nil { - return arn.OutpostAccessPointARN{}, err - } - // set access-point arn - outpostAccessPointARN.AccessPointARN = accessPointARN - default: - return arn.OutpostAccessPointARN{}, arn.InvalidARNError{ARN: a, Reason: "access-point resource not set in Outpost ARN"} - } - - // set outpost id - outpostAccessPointARN.OutpostID = resID - return outpostAccessPointARN, nil -} - -func parseS3ObjectLambdaAccessPointResource(a awsarn.ARN, resParts []string) (arn.S3ObjectLambdaAccessPointARN, error) { - if a.Service != s3ObjectsLambdaNamespace { - return arn.S3ObjectLambdaAccessPointARN{}, arn.InvalidARNError{ARN: a, Reason: fmt.Sprintf("service is not %s", s3ObjectsLambdaNamespace)} - } - - accessPointARN, err := arn.ParseAccessPointResource(a, resParts[1:]) - if err != nil { - return arn.S3ObjectLambdaAccessPointARN{}, err - } - - if len(accessPointARN.Region) == 0 { - return arn.S3ObjectLambdaAccessPointARN{}, arn.InvalidARNError{ARN: a, Reason: fmt.Sprintf("%s region not set", s3ObjectsLambdaNamespace)} - } - - return arn.S3ObjectLambdaAccessPointARN{ - AccessPointARN: accessPointARN, - }, nil -} - -func endpointHandler(req *request.Request) { - endpoint, ok := req.Params.(endpointARNGetter) - if !ok || !endpoint.hasEndpointARN() { - updateBucketEndpointFromParams(req) - return - } - - resource, err := endpoint.getEndpointARN() - if err != nil { - req.Error = s3shared.NewInvalidARNError(nil, err) - return - } - - resReq := s3shared.ResourceRequest{ - Resource: resource, - Request: req, - } - - if len(resReq.Request.ClientInfo.PartitionID) != 0 && resReq.IsCrossPartition() { - req.Error = s3shared.NewClientPartitionMismatchError(resource, - req.ClientInfo.PartitionID, aws.StringValue(req.Config.Region), nil) - return - } - - if !resReq.AllowCrossRegion() && resReq.IsCrossRegion() { - req.Error = s3shared.NewClientRegionMismatchError(resource, - req.ClientInfo.PartitionID, aws.StringValue(req.Config.Region), nil) - return - } - - switch tv := resource.(type) { - case arn.AccessPointARN: - err = updateRequestAccessPointEndpoint(req, tv) - if err != nil { - req.Error = err - } - case arn.S3ObjectLambdaAccessPointARN: - err = updateRequestS3ObjectLambdaAccessPointEndpoint(req, tv) - if err != nil { - req.Error = err - } - case arn.OutpostAccessPointARN: - // outposts does not support FIPS regions - if req.Config.UseFIPSEndpoint == endpoints.FIPSEndpointStateEnabled { - req.Error = s3shared.NewFIPSConfigurationError(resource, req.ClientInfo.PartitionID, - aws.StringValue(req.Config.Region), nil) - return - } - - err = updateRequestOutpostAccessPointEndpoint(req, tv) - if err != nil { - req.Error = err - } - default: - req.Error = s3shared.NewInvalidARNError(resource, nil) - } -} - -func updateBucketEndpointFromParams(r *request.Request) { - bucket, ok := bucketNameFromReqParams(r.Params) - if !ok { - // Ignore operation requests if the bucket name was not provided - // if this is an input validation error the validation handler - // will report it. - return - } - updateEndpointForS3Config(r, bucket) -} - -func updateRequestAccessPointEndpoint(req *request.Request, accessPoint arn.AccessPointARN) error { - // Accelerate not supported - if aws.BoolValue(req.Config.S3UseAccelerate) { - return s3shared.NewClientConfiguredForAccelerateError(accessPoint, - req.ClientInfo.PartitionID, aws.StringValue(req.Config.Region), nil) - } - - // Ignore the disable host prefix for access points - req.Config.DisableEndpointHostPrefix = aws.Bool(false) - - if err := accessPointEndpointBuilder(accessPoint).build(req); err != nil { - return err - } - - removeBucketFromPath(req.HTTPRequest.URL) - - return nil -} - -func updateRequestS3ObjectLambdaAccessPointEndpoint(req *request.Request, accessPoint arn.S3ObjectLambdaAccessPointARN) error { - // DualStack not supported - if isUseDualStackEndpoint(req) { - return s3shared.NewClientConfiguredForDualStackError(accessPoint, - req.ClientInfo.PartitionID, aws.StringValue(req.Config.Region), nil) - } - - // Accelerate not supported - if aws.BoolValue(req.Config.S3UseAccelerate) { - return s3shared.NewClientConfiguredForAccelerateError(accessPoint, - req.ClientInfo.PartitionID, aws.StringValue(req.Config.Region), nil) - } - - // Ignore the disable host prefix for access points - req.Config.DisableEndpointHostPrefix = aws.Bool(false) - - if err := s3ObjectLambdaAccessPointEndpointBuilder(accessPoint).build(req); err != nil { - return err - } - - removeBucketFromPath(req.HTTPRequest.URL) - - return nil -} - -func updateRequestOutpostAccessPointEndpoint(req *request.Request, accessPoint arn.OutpostAccessPointARN) error { - // Accelerate not supported - if aws.BoolValue(req.Config.S3UseAccelerate) { - return s3shared.NewClientConfiguredForAccelerateError(accessPoint, - req.ClientInfo.PartitionID, aws.StringValue(req.Config.Region), nil) - } - - // Dualstack not supported - if isUseDualStackEndpoint(req) { - return s3shared.NewClientConfiguredForDualStackError(accessPoint, - req.ClientInfo.PartitionID, aws.StringValue(req.Config.Region), nil) - } - - // Ignore the disable host prefix for access points - req.Config.DisableEndpointHostPrefix = aws.Bool(false) - - if err := outpostAccessPointEndpointBuilder(accessPoint).build(req); err != nil { - return err - } - - removeBucketFromPath(req.HTTPRequest.URL) - return nil -} - -func removeBucketFromPath(u *url.URL) { - u.Path = strings.Replace(u.Path, "/{Bucket}", "", -1) - if u.Path == "" { - u.Path = "/" - } -} - -func buildWriteGetObjectResponseEndpoint(req *request.Request) { - // DualStack not supported - if isUseDualStackEndpoint(req) { - req.Error = awserr.New("ConfigurationError", "client configured for dualstack but not supported for operation", nil) - return - } - - // Accelerate not supported - if aws.BoolValue(req.Config.S3UseAccelerate) { - req.Error = awserr.New("ConfigurationError", "client configured for accelerate but not supported for operation", nil) - return - } - - signingName := s3ObjectsLambdaNamespace - signingRegion := req.ClientInfo.SigningRegion - - if !hasCustomEndpoint(req) { - endpoint, err := resolveRegionalEndpoint(req, aws.StringValue(req.Config.Region), req.ClientInfo.ResolvedRegion, EndpointsID) - if err != nil { - req.Error = awserr.New(request.ErrCodeSerialization, "failed to resolve endpoint", err) - return - } - signingRegion = endpoint.SigningRegion - - if err = updateRequestEndpoint(req, endpoint.URL); err != nil { - req.Error = err - return - } - updateS3HostPrefixForS3ObjectLambda(req) - } - - redirectSigner(req, signingName, signingRegion) -} - -func isUseDualStackEndpoint(req *request.Request) bool { - if req.Config.UseDualStackEndpoint != endpoints.DualStackEndpointStateUnset { - return req.Config.UseDualStackEndpoint == endpoints.DualStackEndpointStateEnabled - } - return aws.BoolValue(req.Config.UseDualStack) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_builder.go b/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_builder.go deleted file mode 100644 index 7ae18ef548..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/endpoint_builder.go +++ /dev/null @@ -1,239 +0,0 @@ -package s3 - -import ( - "net/url" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/endpoints" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/internal/s3shared" - "github.com/aws/aws-sdk-go/internal/s3shared/arn" - "github.com/aws/aws-sdk-go/private/protocol" -) - -const ( - accessPointPrefixLabel = "accesspoint" - accountIDPrefixLabel = "accountID" - accessPointPrefixTemplate = "{" + accessPointPrefixLabel + "}-{" + accountIDPrefixLabel + "}." - - outpostPrefixLabel = "outpost" - outpostAccessPointPrefixTemplate = accessPointPrefixTemplate + "{" + outpostPrefixLabel + "}." -) - -// hasCustomEndpoint returns true if endpoint is a custom endpoint -func hasCustomEndpoint(r *request.Request) bool { - return len(aws.StringValue(r.Config.Endpoint)) > 0 -} - -// accessPointEndpointBuilder represents the endpoint builder for access point arn -type accessPointEndpointBuilder arn.AccessPointARN - -// build builds the endpoint for corresponding access point arn -// -// For building an endpoint from access point arn, format used is: -// - Access point endpoint format : {accesspointName}-{accountId}.s3-accesspoint.{region}.{dnsSuffix} -// - example : myaccesspoint-012345678901.s3-accesspoint.us-west-2.amazonaws.com -// -// Access Point Endpoint requests are signed using "s3" as signing name. -func (a accessPointEndpointBuilder) build(req *request.Request) error { - resolveService := arn.AccessPointARN(a).Service - resolveRegion := arn.AccessPointARN(a).Region - - endpoint, err := resolveRegionalEndpoint(req, resolveRegion, "", resolveService) - if err != nil { - return s3shared.NewFailedToResolveEndpointError(arn.AccessPointARN(a), - req.ClientInfo.PartitionID, resolveRegion, err) - } - - endpoint.URL = endpoints.AddScheme(endpoint.URL, aws.BoolValue(req.Config.DisableSSL)) - - if !hasCustomEndpoint(req) { - if err = updateRequestEndpoint(req, endpoint.URL); err != nil { - return err - } - - // dual stack provided by endpoint resolver - updateS3HostForS3AccessPoint(req) - } - - protocol.HostPrefixBuilder{ - Prefix: accessPointPrefixTemplate, - LabelsFn: a.hostPrefixLabelValues, - }.Build(req) - - // signer redirection - redirectSigner(req, endpoint.SigningName, endpoint.SigningRegion) - - err = protocol.ValidateEndpointHost(req.Operation.Name, req.HTTPRequest.URL.Host) - if err != nil { - return s3shared.NewInvalidARNError(arn.AccessPointARN(a), err) - } - - return nil -} - -func (a accessPointEndpointBuilder) hostPrefixLabelValues() map[string]string { - return map[string]string{ - accessPointPrefixLabel: arn.AccessPointARN(a).AccessPointName, - accountIDPrefixLabel: arn.AccessPointARN(a).AccountID, - } -} - -// s3ObjectLambdaAccessPointEndpointBuilder represents the endpoint builder for an s3 object lambda access point arn -type s3ObjectLambdaAccessPointEndpointBuilder arn.S3ObjectLambdaAccessPointARN - -// build builds the endpoint for corresponding access point arn -// -// For building an endpoint from access point arn, format used is: -// - Access point endpoint format : {accesspointName}-{accountId}.s3-object-lambda.{region}.{dnsSuffix} -// - example : myaccesspoint-012345678901.s3-object-lambda.us-west-2.amazonaws.com -// -// Access Point Endpoint requests are signed using "s3-object-lambda" as signing name. -func (a s3ObjectLambdaAccessPointEndpointBuilder) build(req *request.Request) error { - resolveRegion := arn.S3ObjectLambdaAccessPointARN(a).Region - - endpoint, err := resolveRegionalEndpoint(req, resolveRegion, "", EndpointsID) - if err != nil { - return s3shared.NewFailedToResolveEndpointError(arn.S3ObjectLambdaAccessPointARN(a), - req.ClientInfo.PartitionID, resolveRegion, err) - } - - endpoint.URL = endpoints.AddScheme(endpoint.URL, aws.BoolValue(req.Config.DisableSSL)) - - endpoint.SigningName = s3ObjectsLambdaNamespace - - if !hasCustomEndpoint(req) { - if err = updateRequestEndpoint(req, endpoint.URL); err != nil { - return err - } - - updateS3HostPrefixForS3ObjectLambda(req) - } - - protocol.HostPrefixBuilder{ - Prefix: accessPointPrefixTemplate, - LabelsFn: a.hostPrefixLabelValues, - }.Build(req) - - // signer redirection - redirectSigner(req, endpoint.SigningName, endpoint.SigningRegion) - - err = protocol.ValidateEndpointHost(req.Operation.Name, req.HTTPRequest.URL.Host) - if err != nil { - return s3shared.NewInvalidARNError(arn.S3ObjectLambdaAccessPointARN(a), err) - } - - return nil -} - -func (a s3ObjectLambdaAccessPointEndpointBuilder) hostPrefixLabelValues() map[string]string { - return map[string]string{ - accessPointPrefixLabel: arn.S3ObjectLambdaAccessPointARN(a).AccessPointName, - accountIDPrefixLabel: arn.S3ObjectLambdaAccessPointARN(a).AccountID, - } -} - -// outpostAccessPointEndpointBuilder represents the Endpoint builder for outpost access point arn. -type outpostAccessPointEndpointBuilder arn.OutpostAccessPointARN - -// build builds an endpoint corresponding to the outpost access point arn. -// -// For building an endpoint from outpost access point arn, format used is: -// - Outpost access point endpoint format : {accesspointName}-{accountId}.{outpostId}.s3-outposts.{region}.{dnsSuffix} -// - example : myaccesspoint-012345678901.op-01234567890123456.s3-outposts.us-west-2.amazonaws.com -// -// Outpost AccessPoint Endpoint request are signed using "s3-outposts" as signing name. -func (o outpostAccessPointEndpointBuilder) build(req *request.Request) error { - resolveRegion := o.Region - resolveService := o.Service - - endpointsID := resolveService - if resolveService == s3OutpostsNamespace { - endpointsID = "s3" - } - - endpoint, err := resolveRegionalEndpoint(req, resolveRegion, "", endpointsID) - if err != nil { - return s3shared.NewFailedToResolveEndpointError(o, - req.ClientInfo.PartitionID, resolveRegion, err) - } - - endpoint.URL = endpoints.AddScheme(endpoint.URL, aws.BoolValue(req.Config.DisableSSL)) - - if !hasCustomEndpoint(req) { - if err = updateRequestEndpoint(req, endpoint.URL); err != nil { - return err - } - updateHostPrefix(req, endpointsID, resolveService) - } - - protocol.HostPrefixBuilder{ - Prefix: outpostAccessPointPrefixTemplate, - LabelsFn: o.hostPrefixLabelValues, - }.Build(req) - - // set the signing region, name to resolved names from ARN - redirectSigner(req, resolveService, resolveRegion) - - err = protocol.ValidateEndpointHost(req.Operation.Name, req.HTTPRequest.URL.Host) - if err != nil { - return s3shared.NewInvalidARNError(o, err) - } - - return nil -} - -func (o outpostAccessPointEndpointBuilder) hostPrefixLabelValues() map[string]string { - return map[string]string{ - accessPointPrefixLabel: o.AccessPointName, - accountIDPrefixLabel: o.AccountID, - outpostPrefixLabel: o.OutpostID, - } -} - -func resolveRegionalEndpoint(r *request.Request, region, resolvedRegion, endpointsID string) (endpoints.ResolvedEndpoint, error) { - return r.Config.EndpointResolver.EndpointFor(endpointsID, region, func(opts *endpoints.Options) { - opts.DisableSSL = aws.BoolValue(r.Config.DisableSSL) - opts.UseDualStack = aws.BoolValue(r.Config.UseDualStack) - opts.UseDualStackEndpoint = r.Config.UseDualStackEndpoint - opts.UseFIPSEndpoint = r.Config.UseFIPSEndpoint - opts.S3UsEast1RegionalEndpoint = endpoints.RegionalS3UsEast1Endpoint - opts.ResolvedRegion = resolvedRegion - opts.Logger = r.Config.Logger - opts.LogDeprecated = r.Config.LogLevel.Matches(aws.LogDebugWithDeprecated) - }) -} - -func updateRequestEndpoint(r *request.Request, endpoint string) (err error) { - r.HTTPRequest.URL, err = url.Parse(endpoint + r.Operation.HTTPPath) - if err != nil { - return awserr.New(request.ErrCodeSerialization, - "failed to parse endpoint URL", err) - } - - return nil -} - -// redirectSigner sets signing name, signing region for a request -func redirectSigner(req *request.Request, signingName string, signingRegion string) { - req.ClientInfo.SigningName = signingName - req.ClientInfo.SigningRegion = signingRegion -} - -func updateS3HostForS3AccessPoint(req *request.Request) { - updateHostPrefix(req, "s3", s3AccessPointNamespace) -} - -func updateS3HostPrefixForS3ObjectLambda(req *request.Request) { - updateHostPrefix(req, "s3", s3ObjectsLambdaNamespace) -} - -func updateHostPrefix(req *request.Request, oldEndpointPrefix, newEndpointPrefix string) { - host := req.HTTPRequest.URL.Host - if strings.HasPrefix(host, oldEndpointPrefix) { - // replace service hostlabel oldEndpointPrefix to newEndpointPrefix - req.HTTPRequest.URL.Host = newEndpointPrefix + host[len(oldEndpointPrefix):] - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go b/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go deleted file mode 100644 index cd6a2e8ae4..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/errors.go +++ /dev/null @@ -1,60 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package s3 - -const ( - - // ErrCodeBucketAlreadyExists for service response error code - // "BucketAlreadyExists". - // - // The requested bucket name is not available. The bucket namespace is shared - // by all users of the system. Select a different name and try again. - ErrCodeBucketAlreadyExists = "BucketAlreadyExists" - - // ErrCodeBucketAlreadyOwnedByYou for service response error code - // "BucketAlreadyOwnedByYou". - // - // The bucket you tried to create already exists, and you own it. Amazon S3 - // returns this error in all Amazon Web Services Regions except in the North - // Virginia Region. For legacy compatibility, if you re-create an existing bucket - // that you already own in the North Virginia Region, Amazon S3 returns 200 - // OK and resets the bucket access control lists (ACLs). - ErrCodeBucketAlreadyOwnedByYou = "BucketAlreadyOwnedByYou" - - // ErrCodeInvalidObjectState for service response error code - // "InvalidObjectState". - // - // Object is archived and inaccessible until restored. - ErrCodeInvalidObjectState = "InvalidObjectState" - - // ErrCodeNoSuchBucket for service response error code - // "NoSuchBucket". - // - // The specified bucket does not exist. - ErrCodeNoSuchBucket = "NoSuchBucket" - - // ErrCodeNoSuchKey for service response error code - // "NoSuchKey". - // - // The specified key does not exist. - ErrCodeNoSuchKey = "NoSuchKey" - - // ErrCodeNoSuchUpload for service response error code - // "NoSuchUpload". - // - // The specified multipart upload does not exist. - ErrCodeNoSuchUpload = "NoSuchUpload" - - // ErrCodeObjectAlreadyInActiveTierError for service response error code - // "ObjectAlreadyInActiveTierError". - // - // This action is not allowed against this storage tier. - ErrCodeObjectAlreadyInActiveTierError = "ObjectAlreadyInActiveTierError" - - // ErrCodeObjectNotInActiveTierError for service response error code - // "ObjectNotInActiveTierError". - // - // The source object of the COPY action is not in the active tier and is only - // stored in Amazon S3 Glacier. - ErrCodeObjectNotInActiveTierError = "ObjectNotInActiveTierError" -) diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go b/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go deleted file mode 100644 index 81cdec1ae7..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/host_style_bucket.go +++ /dev/null @@ -1,136 +0,0 @@ -package s3 - -import ( - "fmt" - "net/url" - "regexp" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" -) - -// an operationBlacklist is a list of operation names that should a -// request handler should not be executed with. -type operationBlacklist []string - -// Continue will return true of the Request's operation name is not -// in the blacklist. False otherwise. -func (b operationBlacklist) Continue(r *request.Request) bool { - for i := 0; i < len(b); i++ { - if b[i] == r.Operation.Name { - return false - } - } - return true -} - -var accelerateOpBlacklist = operationBlacklist{ - opListBuckets, opCreateBucket, opDeleteBucket, -} - -// Automatically add the bucket name to the endpoint domain -// if possible. This style of bucket is valid for all bucket names which are -// DNS compatible and do not contain "." -func updateEndpointForS3Config(r *request.Request, bucketName string) { - forceHostStyle := aws.BoolValue(r.Config.S3ForcePathStyle) - accelerate := aws.BoolValue(r.Config.S3UseAccelerate) - - if accelerate && accelerateOpBlacklist.Continue(r) { - if forceHostStyle { - if r.Config.Logger != nil { - r.Config.Logger.Log("ERROR: aws.Config.S3UseAccelerate is not compatible with aws.Config.S3ForcePathStyle, ignoring S3ForcePathStyle.") - } - } - updateEndpointForAccelerate(r, bucketName) - } else if !forceHostStyle && r.Operation.Name != opGetBucketLocation { - updateEndpointForHostStyle(r, bucketName) - } -} - -func updateEndpointForHostStyle(r *request.Request, bucketName string) { - if !hostCompatibleBucketName(r.HTTPRequest.URL, bucketName) { - // bucket name must be valid to put into the host - return - } - - moveBucketToHost(r.HTTPRequest.URL, bucketName) -} - -var ( - accelElem = []byte("s3-accelerate.dualstack.") -) - -func updateEndpointForAccelerate(r *request.Request, bucketName string) { - if !hostCompatibleBucketName(r.HTTPRequest.URL, bucketName) { - r.Error = awserr.New("InvalidParameterException", - fmt.Sprintf("bucket name %s is not compatible with S3 Accelerate", bucketName), - nil) - return - } - - parts := strings.Split(r.HTTPRequest.URL.Host, ".") - if len(parts) < 3 { - r.Error = awserr.New("InvalidParameterExecption", - fmt.Sprintf("unable to update endpoint host for S3 accelerate, hostname invalid, %s", - r.HTTPRequest.URL.Host), nil) - return - } - - if parts[0] == "s3" || strings.HasPrefix(parts[0], "s3-") { - parts[0] = "s3-accelerate" - } - for i := 1; i+1 < len(parts); i++ { - if parts[i] == aws.StringValue(r.Config.Region) { - parts = append(parts[:i], parts[i+1:]...) - break - } - } - - r.HTTPRequest.URL.Host = strings.Join(parts, ".") - - moveBucketToHost(r.HTTPRequest.URL, bucketName) -} - -// Attempts to retrieve the bucket name from the request input parameters. -// If no bucket is found, or the field is empty "", false will be returned. -func bucketNameFromReqParams(params interface{}) (string, bool) { - if iface, ok := params.(bucketGetter); ok { - b := iface.getBucket() - return b, len(b) > 0 - } - - return "", false -} - -// hostCompatibleBucketName returns true if the request should -// put the bucket in the host. This is false if S3ForcePathStyle is -// explicitly set or if the bucket is not DNS compatible. -func hostCompatibleBucketName(u *url.URL, bucket string) bool { - // Bucket might be DNS compatible but dots in the hostname will fail - // certificate validation, so do not use host-style. - if u.Scheme == "https" && strings.Contains(bucket, ".") { - return false - } - - // if the bucket is DNS compatible - return dnsCompatibleBucketName(bucket) -} - -var reDomain = regexp.MustCompile(`^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$`) -var reIPAddress = regexp.MustCompile(`^(\d+\.){3}\d+$`) - -// dnsCompatibleBucketName returns true if the bucket name is DNS compatible. -// Buckets created outside of the classic region MUST be DNS compatible. -func dnsCompatibleBucketName(bucket string) bool { - return reDomain.MatchString(bucket) && - !reIPAddress.MatchString(bucket) && - !strings.Contains(bucket, "..") -} - -// moveBucketToHost moves the bucket name from the URI path to URL host. -func moveBucketToHost(u *url.URL, bucket string) { - u.Host = bucket + "." + u.Host - removeBucketFromPath(u) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers.go b/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers.go deleted file mode 100644 index 308b7d473e..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers.go +++ /dev/null @@ -1,9 +0,0 @@ -//go:build !go1.6 -// +build !go1.6 - -package s3 - -import "github.com/aws/aws-sdk-go/aws/request" - -func platformRequestHandlers(r *request.Request) { -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6.go b/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6.go deleted file mode 100644 index 339019d321..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/platform_handlers_go1.6.go +++ /dev/null @@ -1,29 +0,0 @@ -//go:build go1.6 -// +build go1.6 - -package s3 - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" -) - -func platformRequestHandlers(r *request.Request) { - if r.Operation.HTTPMethod == "PUT" { - // 100-Continue should only be used on put requests. - r.Handlers.Sign.PushBack(add100Continue) - } -} - -func add100Continue(r *request.Request) { - if aws.BoolValue(r.Config.S3Disable100Continue) { - return - } - if r.HTTPRequest.ContentLength < 1024*1024*2 { - // Ignore requests smaller than 2MB. This helps prevent delaying - // requests unnecessarily. - return - } - - r.HTTPRequest.Header.Set("Expect", "100-Continue") -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/service.go b/vendor/github.com/aws/aws-sdk-go/service/s3/service.go deleted file mode 100644 index 3e75d0e942..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/service.go +++ /dev/null @@ -1,108 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package s3 - -import ( - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/client" - "github.com/aws/aws-sdk-go/aws/client/metadata" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/aws/signer/v4" - "github.com/aws/aws-sdk-go/private/protocol/restxml" -) - -// S3 provides the API operation methods for making requests to -// Amazon Simple Storage Service. See this package's package overview docs -// for details on the service. -// -// S3 methods are safe to use concurrently. It is not safe to -// modify mutate any of the struct's properties though. -type S3 struct { - *client.Client -} - -// Used for custom client initialization logic -var initClient func(*client.Client) - -// Used for custom request initialization logic -var initRequest func(*request.Request) - -// Service information constants -const ( - ServiceName = "s3" // Name of service. - EndpointsID = ServiceName // ID to lookup a service endpoint with. - ServiceID = "S3" // ServiceID is a unique identifier of a specific service. -) - -// New creates a new instance of the S3 client with a session. -// If additional configuration is needed for the client instance use the optional -// aws.Config parameter to add your extra config. -// -// Example: -// -// mySession := session.Must(session.NewSession()) -// -// // Create a S3 client from just a session. -// svc := s3.New(mySession) -// -// // Create a S3 client with additional configuration -// svc := s3.New(mySession, aws.NewConfig().WithRegion("us-west-2")) -func New(p client.ConfigProvider, cfgs ...*aws.Config) *S3 { - c := p.ClientConfig(EndpointsID, cfgs...) - if c.SigningNameDerived || len(c.SigningName) == 0 { - c.SigningName = "s3" - } - return newClient(*c.Config, c.Handlers, c.PartitionID, c.Endpoint, c.SigningRegion, c.SigningName, c.ResolvedRegion) -} - -// newClient creates, initializes and returns a new service client instance. -func newClient(cfg aws.Config, handlers request.Handlers, partitionID, endpoint, signingRegion, signingName, resolvedRegion string) *S3 { - svc := &S3{ - Client: client.New( - cfg, - metadata.ClientInfo{ - ServiceName: ServiceName, - ServiceID: ServiceID, - SigningName: signingName, - SigningRegion: signingRegion, - PartitionID: partitionID, - Endpoint: endpoint, - APIVersion: "2006-03-01", - ResolvedRegion: resolvedRegion, - }, - handlers, - ), - } - - // Handlers - svc.Handlers.Sign.PushBackNamed(v4.BuildNamedHandler(v4.SignRequestHandler.Name, func(s *v4.Signer) { - s.DisableURIPathEscaping = true - })) - svc.Handlers.Build.PushBackNamed(restxml.BuildHandler) - svc.Handlers.Unmarshal.PushBackNamed(restxml.UnmarshalHandler) - svc.Handlers.UnmarshalMeta.PushBackNamed(restxml.UnmarshalMetaHandler) - svc.Handlers.UnmarshalError.PushBackNamed(restxml.UnmarshalErrorHandler) - - svc.Handlers.BuildStream.PushBackNamed(restxml.BuildHandler) - svc.Handlers.UnmarshalStream.PushBackNamed(restxml.UnmarshalHandler) - - // Run custom client initialization if present - if initClient != nil { - initClient(svc.Client) - } - - return svc -} - -// newRequest creates a new request for a S3 operation and runs any -// custom request initialization. -func (c *S3) newRequest(op *request.Operation, params, data interface{}) *request.Request { - req := c.NewRequest(op, params, data) - - // Run custom request initialization if present - if initRequest != nil { - initRequest(req) - } - - return req -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go b/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go deleted file mode 100644 index 57a0bd92ca..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/sse.go +++ /dev/null @@ -1,84 +0,0 @@ -package s3 - -import ( - "crypto/md5" - "encoding/base64" - "net/http" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" -) - -var errSSERequiresSSL = awserr.New("ConfigError", "cannot send SSE keys over HTTP.", nil) - -func validateSSERequiresSSL(r *request.Request) { - if r.HTTPRequest.URL.Scheme == "https" { - return - } - - if iface, ok := r.Params.(sseCustomerKeyGetter); ok { - if len(iface.getSSECustomerKey()) > 0 { - r.Error = errSSERequiresSSL - return - } - } - - if iface, ok := r.Params.(copySourceSSECustomerKeyGetter); ok { - if len(iface.getCopySourceSSECustomerKey()) > 0 { - r.Error = errSSERequiresSSL - return - } - } -} - -const ( - sseKeyHeader = "x-amz-server-side-encryption-customer-key" - sseKeyMD5Header = sseKeyHeader + "-md5" -) - -func computeSSEKeyMD5(r *request.Request) { - var key string - if g, ok := r.Params.(sseCustomerKeyGetter); ok { - key = g.getSSECustomerKey() - } - - computeKeyMD5(sseKeyHeader, sseKeyMD5Header, key, r.HTTPRequest) -} - -const ( - copySrcSSEKeyHeader = "x-amz-copy-source-server-side-encryption-customer-key" - copySrcSSEKeyMD5Header = copySrcSSEKeyHeader + "-md5" -) - -func computeCopySourceSSEKeyMD5(r *request.Request) { - var key string - if g, ok := r.Params.(copySourceSSECustomerKeyGetter); ok { - key = g.getCopySourceSSECustomerKey() - } - - computeKeyMD5(copySrcSSEKeyHeader, copySrcSSEKeyMD5Header, key, r.HTTPRequest) -} - -func computeKeyMD5(keyHeader, keyMD5Header, key string, r *http.Request) { - if len(key) == 0 { - // Backwards compatiablity where user just set the header value instead - // of using the API parameter, or setting the header value for an - // operation without the parameters modeled. - key = r.Header.Get(keyHeader) - if len(key) == 0 { - return - } - - // In backwards compatible, the header's value is not base64 encoded, - // and needs to be encoded and updated by the SDK's customizations. - b64Key := base64.StdEncoding.EncodeToString([]byte(key)) - r.Header.Set(keyHeader, b64Key) - } - - // Only update Key's MD5 if not already set. - if len(r.Header.Get(keyMD5Header)) == 0 { - sum := md5.Sum([]byte(key)) - keyMD5 := base64.StdEncoding.EncodeToString(sum[:]) - r.Header.Set(keyMD5Header, keyMD5) - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error.go b/vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error.go deleted file mode 100644 index 096adc091d..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/statusok_error.go +++ /dev/null @@ -1,47 +0,0 @@ -package s3 - -import ( - "bytes" - "io" - "io/ioutil" - "net/http" - - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/internal/sdkio" -) - -func copyMultipartStatusOKUnmarshalError(r *request.Request) { - b, err := ioutil.ReadAll(r.HTTPResponse.Body) - r.HTTPResponse.Body.Close() - if err != nil { - r.Error = awserr.NewRequestFailure( - awserr.New(request.ErrCodeSerialization, "unable to read response body", err), - r.HTTPResponse.StatusCode, - r.RequestID, - ) - // Note, some middleware later in the stack like restxml.Unmarshal expect a valid, non-closed Body - // even in case of an error, so we replace it with an empty Reader. - r.HTTPResponse.Body = ioutil.NopCloser(bytes.NewBuffer(nil)) - return - } - - body := bytes.NewReader(b) - r.HTTPResponse.Body = ioutil.NopCloser(body) - defer body.Seek(0, sdkio.SeekStart) - - unmarshalError(r) - if err, ok := r.Error.(awserr.Error); ok && err != nil { - if err.Code() == request.ErrCodeSerialization && - err.OrigErr() != io.EOF { - r.Error = nil - return - } - // if empty payload - if err.OrigErr() == io.EOF { - r.HTTPResponse.StatusCode = http.StatusInternalServerError - } else { - r.HTTPResponse.StatusCode = http.StatusServiceUnavailable - } - } -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go b/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go deleted file mode 100644 index 6eecf66910..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/unmarshal_error.go +++ /dev/null @@ -1,114 +0,0 @@ -package s3 - -import ( - "bytes" - "encoding/xml" - "fmt" - "io" - "io/ioutil" - "net/http" - "strings" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awserr" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil" -) - -type xmlErrorResponse struct { - XMLName xml.Name `xml:"Error"` - Code string `xml:"Code"` - Message string `xml:"Message"` -} - -func unmarshalError(r *request.Request) { - defer r.HTTPResponse.Body.Close() - defer io.Copy(ioutil.Discard, r.HTTPResponse.Body) - - // Bucket exists in a different region, and request needs - // to be made to the correct region. - if r.HTTPResponse.StatusCode == http.StatusMovedPermanently { - msg := fmt.Sprintf( - "incorrect region, the bucket is not in '%s' region at endpoint '%s'", - aws.StringValue(r.Config.Region), - aws.StringValue(r.Config.Endpoint), - ) - if v := r.HTTPResponse.Header.Get("x-amz-bucket-region"); len(v) != 0 { - msg += fmt.Sprintf(", bucket is in '%s' region", v) - } - r.Error = awserr.NewRequestFailure( - awserr.New("BucketRegionError", msg, nil), - r.HTTPResponse.StatusCode, - r.RequestID, - ) - return - } - - // Attempt to parse error from body if it is known - var errResp xmlErrorResponse - var err error - if r.HTTPResponse.StatusCode >= 200 && r.HTTPResponse.StatusCode < 300 { - err = s3unmarshalXMLError(&errResp, r.HTTPResponse.Body) - } else { - err = xmlutil.UnmarshalXMLError(&errResp, r.HTTPResponse.Body) - } - - if err != nil { - var errorMsg string - if err == io.EOF { - errorMsg = "empty response payload" - } else { - errorMsg = "failed to unmarshal error message" - } - - r.Error = awserr.NewRequestFailure( - awserr.New(request.ErrCodeSerialization, - errorMsg, err), - r.HTTPResponse.StatusCode, - r.RequestID, - ) - return - } - - // Fallback to status code converted to message if still no error code - if len(errResp.Code) == 0 { - statusText := http.StatusText(r.HTTPResponse.StatusCode) - errResp.Code = strings.Replace(statusText, " ", "", -1) - errResp.Message = statusText - } - - r.Error = awserr.NewRequestFailure( - awserr.New(errResp.Code, errResp.Message, err), - r.HTTPResponse.StatusCode, - r.RequestID, - ) -} - -// A RequestFailure provides access to the S3 Request ID and Host ID values -// returned from API operation errors. Getting the error as a string will -// return the formated error with the same information as awserr.RequestFailure, -// while also adding the HostID value from the response. -type RequestFailure interface { - awserr.RequestFailure - - // Host ID is the S3 Host ID needed for debug, and contacting support - HostID() string -} - -// s3unmarshalXMLError is s3 specific xml error unmarshaler -// for 200 OK errors and response payloads. -// This function differs from the xmlUtil.UnmarshalXMLError -// func. It does not ignore the EOF error and passes it up. -// Related to bug fix for `s3 200 OK response with empty payload` -func s3unmarshalXMLError(v interface{}, stream io.Reader) error { - var errBuf bytes.Buffer - body := io.TeeReader(stream, &errBuf) - - err := xml.NewDecoder(body).Decode(v) - if err != nil && err != io.EOF { - return awserr.NewUnmarshalError(err, - "failed to unmarshal error message", errBuf.Bytes()) - } - - return err -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go b/vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go deleted file mode 100644 index 2596c694b5..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/s3/waiters.go +++ /dev/null @@ -1,214 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package s3 - -import ( - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/request" -) - -// WaitUntilBucketExists uses the Amazon S3 API operation -// HeadBucket to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *S3) WaitUntilBucketExists(input *HeadBucketInput) error { - return c.WaitUntilBucketExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilBucketExistsWithContext is an extended version of WaitUntilBucketExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) WaitUntilBucketExistsWithContext(ctx aws.Context, input *HeadBucketInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilBucketExists", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(5 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 200, - }, - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 301, - }, - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 403, - }, - { - State: request.RetryWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 404, - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *HeadBucketInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.HeadBucketRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilBucketNotExists uses the Amazon S3 API operation -// HeadBucket to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *S3) WaitUntilBucketNotExists(input *HeadBucketInput) error { - return c.WaitUntilBucketNotExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilBucketNotExistsWithContext is an extended version of WaitUntilBucketNotExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) WaitUntilBucketNotExistsWithContext(ctx aws.Context, input *HeadBucketInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilBucketNotExists", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(5 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 404, - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *HeadBucketInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.HeadBucketRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilObjectExists uses the Amazon S3 API operation -// HeadObject to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *S3) WaitUntilObjectExists(input *HeadObjectInput) error { - return c.WaitUntilObjectExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilObjectExistsWithContext is an extended version of WaitUntilObjectExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) WaitUntilObjectExistsWithContext(ctx aws.Context, input *HeadObjectInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilObjectExists", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(5 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 200, - }, - { - State: request.RetryWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 404, - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *HeadObjectInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.HeadObjectRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} - -// WaitUntilObjectNotExists uses the Amazon S3 API operation -// HeadObject to wait for a condition to be met before returning. -// If the condition is not met within the max attempt window, an error will -// be returned. -func (c *S3) WaitUntilObjectNotExists(input *HeadObjectInput) error { - return c.WaitUntilObjectNotExistsWithContext(aws.BackgroundContext(), input) -} - -// WaitUntilObjectNotExistsWithContext is an extended version of WaitUntilObjectNotExists. -// With the support for passing in a context and options to configure the -// Waiter and the underlying request options. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *S3) WaitUntilObjectNotExistsWithContext(ctx aws.Context, input *HeadObjectInput, opts ...request.WaiterOption) error { - w := request.Waiter{ - Name: "WaitUntilObjectNotExists", - MaxAttempts: 20, - Delay: request.ConstantWaiterDelay(5 * time.Second), - Acceptors: []request.WaiterAcceptor{ - { - State: request.SuccessWaiterState, - Matcher: request.StatusWaiterMatch, - Expected: 404, - }, - }, - Logger: c.Config.Logger, - NewRequest: func(opts []request.Option) (*request.Request, error) { - var inCpy *HeadObjectInput - if input != nil { - tmp := *input - inCpy = &tmp - } - req, _ := c.HeadObjectRequest(inCpy) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return req, nil - }, - } - w.ApplyOptions(opts...) - - return w.WaitWithContext(ctx) -} diff --git a/vendor/github.com/aws/aws-sdk-go/service/wafv2/api.go b/vendor/github.com/aws/aws-sdk-go/service/wafv2/api.go deleted file mode 100644 index bb27069c2e..0000000000 --- a/vendor/github.com/aws/aws-sdk-go/service/wafv2/api.go +++ /dev/null @@ -1,23986 +0,0 @@ -// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. - -package wafv2 - -import ( - "fmt" - "time" - - "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/awsutil" - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/private/protocol" - "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" -) - -const opAssociateWebACL = "AssociateWebACL" - -// AssociateWebACLRequest generates a "aws/request.Request" representing the -// client's request for the AssociateWebACL operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See AssociateWebACL for more information on using the AssociateWebACL -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the AssociateWebACLRequest method. -// req, resp := client.AssociateWebACLRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/AssociateWebACL -func (c *WAFV2) AssociateWebACLRequest(input *AssociateWebACLInput) (req *request.Request, output *AssociateWebACLOutput) { - op := &request.Operation{ - Name: opAssociateWebACL, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &AssociateWebACLInput{} - } - - output = &AssociateWebACLOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// AssociateWebACL API operation for AWS WAFV2. -// -// Associates a web ACL with a regional application resource, to protect the -// resource. A regional application can be an Application Load Balancer (ALB), -// an Amazon API Gateway REST API, an AppSync GraphQL API, or an Amazon Cognito -// user pool. -// -// For Amazon CloudFront, don't use this call. Instead, use your CloudFront -// distribution configuration. To associate a web ACL, in the CloudFront call -// UpdateDistribution, set the web ACL ID to the Amazon Resource Name (ARN) -// of the web ACL. For information, see UpdateDistribution (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_UpdateDistribution.html). -// -// When you make changes to web ACLs or web ACL components, like rules and rule -// groups, WAF propagates the changes everywhere that the web ACL and its components -// are stored and used. Your changes are applied within seconds, but there might -// be a brief period of inconsistency when the changes have arrived in some -// places and not in others. So, for example, if you change a rule action setting, -// the action might be the old action in one area and the new action in another -// area. Or if you add an IP address to an IP set used in a blocking rule, the -// new address might briefly be blocked in one area while still allowed in another. -// This temporary inconsistency can occur when you first associate a web ACL -// with an Amazon Web Services resource and when you change a web ACL that is -// already associated with a resource. Generally, any inconsistencies of this -// type last only a few seconds. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation AssociateWebACL for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFUnavailableEntityException -// WAF couldn’t retrieve a resource that you specified for this operation. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. Verify the resources that you -// are specifying in your request parameters and then retry the operation. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/AssociateWebACL -func (c *WAFV2) AssociateWebACL(input *AssociateWebACLInput) (*AssociateWebACLOutput, error) { - req, out := c.AssociateWebACLRequest(input) - return out, req.Send() -} - -// AssociateWebACLWithContext is the same as AssociateWebACL with the addition of -// the ability to pass a context and additional request options. -// -// See AssociateWebACL for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) AssociateWebACLWithContext(ctx aws.Context, input *AssociateWebACLInput, opts ...request.Option) (*AssociateWebACLOutput, error) { - req, out := c.AssociateWebACLRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCheckCapacity = "CheckCapacity" - -// CheckCapacityRequest generates a "aws/request.Request" representing the -// client's request for the CheckCapacity operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CheckCapacity for more information on using the CheckCapacity -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the CheckCapacityRequest method. -// req, resp := client.CheckCapacityRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CheckCapacity -func (c *WAFV2) CheckCapacityRequest(input *CheckCapacityInput) (req *request.Request, output *CheckCapacityOutput) { - op := &request.Operation{ - Name: opCheckCapacity, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CheckCapacityInput{} - } - - output = &CheckCapacityOutput{} - req = c.newRequest(op, input, output) - return -} - -// CheckCapacity API operation for AWS WAFV2. -// -// Returns the web ACL capacity unit (WCU) requirements for a specified scope -// and set of rules. You can use this to check the capacity requirements for -// the rules you want to use in a RuleGroup or WebACL. -// -// WAF uses WCUs to calculate and control the operating resources that are used -// to run your rules, rule groups, and web ACLs. WAF calculates capacity differently -// for each rule type, to reflect the relative cost of each rule. Simple rules -// that cost little to run use fewer WCUs than more complex rules that use more -// processing power. Rule group capacity is fixed at creation, which helps users -// plan their web ACL WCU usage when they use a rule group. The WCU limit for -// web ACLs is 1,500. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation CheckCapacity for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFLimitsExceededException -// WAF couldn’t perform the operation because you exceeded your resource limit. -// For example, the maximum number of WebACL objects that you can create for -// an Amazon Web Services account. For more information, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the WAF Developer Guide. -// -// - WAFInvalidResourceException -// WAF couldn’t perform the operation because the resource that you requested -// isn’t valid. Check the resource, and try again. -// -// - WAFUnavailableEntityException -// WAF couldn’t retrieve a resource that you specified for this operation. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. Verify the resources that you -// are specifying in your request parameters and then retry the operation. -// -// - WAFSubscriptionNotFoundException -// You tried to use a managed rule group that's available by subscription, but -// you aren't subscribed to it yet. -// -// - WAFExpiredManagedRuleGroupVersionException -// The operation failed because the specified version for the managed rule group -// has expired. You can retrieve the available versions for the managed rule -// group by calling ListAvailableManagedRuleGroupVersions. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CheckCapacity -func (c *WAFV2) CheckCapacity(input *CheckCapacityInput) (*CheckCapacityOutput, error) { - req, out := c.CheckCapacityRequest(input) - return out, req.Send() -} - -// CheckCapacityWithContext is the same as CheckCapacity with the addition of -// the ability to pass a context and additional request options. -// -// See CheckCapacity for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) CheckCapacityWithContext(ctx aws.Context, input *CheckCapacityInput, opts ...request.Option) (*CheckCapacityOutput, error) { - req, out := c.CheckCapacityRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateIPSet = "CreateIPSet" - -// CreateIPSetRequest generates a "aws/request.Request" representing the -// client's request for the CreateIPSet operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateIPSet for more information on using the CreateIPSet -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the CreateIPSetRequest method. -// req, resp := client.CreateIPSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CreateIPSet -func (c *WAFV2) CreateIPSetRequest(input *CreateIPSetInput) (req *request.Request, output *CreateIPSetOutput) { - op := &request.Operation{ - Name: opCreateIPSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateIPSetInput{} - } - - output = &CreateIPSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateIPSet API operation for AWS WAFV2. -// -// Creates an IPSet, which you use to identify web requests that originate from -// specific IP addresses or ranges of IP addresses. For example, if you're receiving -// a lot of requests from a ranges of IP addresses, you can configure WAF to -// block them using an IPSet that lists those IP addresses. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation CreateIPSet for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFDuplicateItemException -// WAF couldn’t perform the operation because the resource that you tried -// to save is a duplicate of an existing one. -// -// - WAFOptimisticLockException -// WAF couldn’t save your changes because you tried to update or delete a -// resource that has changed since you last retrieved it. Get the resource again, -// make any changes you need to make to the new copy, and retry your operation. -// -// - WAFLimitsExceededException -// WAF couldn’t perform the operation because you exceeded your resource limit. -// For example, the maximum number of WebACL objects that you can create for -// an Amazon Web Services account. For more information, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the WAF Developer Guide. -// -// - WAFTagOperationException -// An error occurred during the tagging operation. Retry your request. -// -// - WAFTagOperationInternalErrorException -// WAF couldn’t perform your tagging operation because of an internal error. -// Retry your request. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CreateIPSet -func (c *WAFV2) CreateIPSet(input *CreateIPSetInput) (*CreateIPSetOutput, error) { - req, out := c.CreateIPSetRequest(input) - return out, req.Send() -} - -// CreateIPSetWithContext is the same as CreateIPSet with the addition of -// the ability to pass a context and additional request options. -// -// See CreateIPSet for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) CreateIPSetWithContext(ctx aws.Context, input *CreateIPSetInput, opts ...request.Option) (*CreateIPSetOutput, error) { - req, out := c.CreateIPSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateRegexPatternSet = "CreateRegexPatternSet" - -// CreateRegexPatternSetRequest generates a "aws/request.Request" representing the -// client's request for the CreateRegexPatternSet operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateRegexPatternSet for more information on using the CreateRegexPatternSet -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the CreateRegexPatternSetRequest method. -// req, resp := client.CreateRegexPatternSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CreateRegexPatternSet -func (c *WAFV2) CreateRegexPatternSetRequest(input *CreateRegexPatternSetInput) (req *request.Request, output *CreateRegexPatternSetOutput) { - op := &request.Operation{ - Name: opCreateRegexPatternSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateRegexPatternSetInput{} - } - - output = &CreateRegexPatternSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateRegexPatternSet API operation for AWS WAFV2. -// -// Creates a RegexPatternSet, which you reference in a RegexPatternSetReferenceStatement, -// to have WAF inspect a web request component for the specified patterns. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation CreateRegexPatternSet for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFDuplicateItemException -// WAF couldn’t perform the operation because the resource that you tried -// to save is a duplicate of an existing one. -// -// - WAFOptimisticLockException -// WAF couldn’t save your changes because you tried to update or delete a -// resource that has changed since you last retrieved it. Get the resource again, -// make any changes you need to make to the new copy, and retry your operation. -// -// - WAFLimitsExceededException -// WAF couldn’t perform the operation because you exceeded your resource limit. -// For example, the maximum number of WebACL objects that you can create for -// an Amazon Web Services account. For more information, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the WAF Developer Guide. -// -// - WAFTagOperationException -// An error occurred during the tagging operation. Retry your request. -// -// - WAFTagOperationInternalErrorException -// WAF couldn’t perform your tagging operation because of an internal error. -// Retry your request. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CreateRegexPatternSet -func (c *WAFV2) CreateRegexPatternSet(input *CreateRegexPatternSetInput) (*CreateRegexPatternSetOutput, error) { - req, out := c.CreateRegexPatternSetRequest(input) - return out, req.Send() -} - -// CreateRegexPatternSetWithContext is the same as CreateRegexPatternSet with the addition of -// the ability to pass a context and additional request options. -// -// See CreateRegexPatternSet for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) CreateRegexPatternSetWithContext(ctx aws.Context, input *CreateRegexPatternSetInput, opts ...request.Option) (*CreateRegexPatternSetOutput, error) { - req, out := c.CreateRegexPatternSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateRuleGroup = "CreateRuleGroup" - -// CreateRuleGroupRequest generates a "aws/request.Request" representing the -// client's request for the CreateRuleGroup operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateRuleGroup for more information on using the CreateRuleGroup -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the CreateRuleGroupRequest method. -// req, resp := client.CreateRuleGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CreateRuleGroup -func (c *WAFV2) CreateRuleGroupRequest(input *CreateRuleGroupInput) (req *request.Request, output *CreateRuleGroupOutput) { - op := &request.Operation{ - Name: opCreateRuleGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateRuleGroupInput{} - } - - output = &CreateRuleGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateRuleGroup API operation for AWS WAFV2. -// -// Creates a RuleGroup per the specifications provided. -// -// A rule group defines a collection of rules to inspect and control web requests -// that you can use in a WebACL. When you create a rule group, you define an -// immutable capacity limit. If you update a rule group, you must stay within -// the capacity. This allows others to reuse the rule group with confidence -// in its capacity requirements. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation CreateRuleGroup for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFDuplicateItemException -// WAF couldn’t perform the operation because the resource that you tried -// to save is a duplicate of an existing one. -// -// - WAFOptimisticLockException -// WAF couldn’t save your changes because you tried to update or delete a -// resource that has changed since you last retrieved it. Get the resource again, -// make any changes you need to make to the new copy, and retry your operation. -// -// - WAFLimitsExceededException -// WAF couldn’t perform the operation because you exceeded your resource limit. -// For example, the maximum number of WebACL objects that you can create for -// an Amazon Web Services account. For more information, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the WAF Developer Guide. -// -// - WAFUnavailableEntityException -// WAF couldn’t retrieve a resource that you specified for this operation. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. Verify the resources that you -// are specifying in your request parameters and then retry the operation. -// -// - WAFTagOperationException -// An error occurred during the tagging operation. Retry your request. -// -// - WAFTagOperationInternalErrorException -// WAF couldn’t perform your tagging operation because of an internal error. -// Retry your request. -// -// - WAFSubscriptionNotFoundException -// You tried to use a managed rule group that's available by subscription, but -// you aren't subscribed to it yet. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CreateRuleGroup -func (c *WAFV2) CreateRuleGroup(input *CreateRuleGroupInput) (*CreateRuleGroupOutput, error) { - req, out := c.CreateRuleGroupRequest(input) - return out, req.Send() -} - -// CreateRuleGroupWithContext is the same as CreateRuleGroup with the addition of -// the ability to pass a context and additional request options. -// -// See CreateRuleGroup for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) CreateRuleGroupWithContext(ctx aws.Context, input *CreateRuleGroupInput, opts ...request.Option) (*CreateRuleGroupOutput, error) { - req, out := c.CreateRuleGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opCreateWebACL = "CreateWebACL" - -// CreateWebACLRequest generates a "aws/request.Request" representing the -// client's request for the CreateWebACL operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See CreateWebACL for more information on using the CreateWebACL -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the CreateWebACLRequest method. -// req, resp := client.CreateWebACLRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CreateWebACL -func (c *WAFV2) CreateWebACLRequest(input *CreateWebACLInput) (req *request.Request, output *CreateWebACLOutput) { - op := &request.Operation{ - Name: opCreateWebACL, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &CreateWebACLInput{} - } - - output = &CreateWebACLOutput{} - req = c.newRequest(op, input, output) - return -} - -// CreateWebACL API operation for AWS WAFV2. -// -// Creates a WebACL per the specifications provided. -// -// A web ACL defines a collection of rules to use to inspect and control web -// requests. Each rule has an action defined (allow, block, or count) for requests -// that match the statement of the rule. In the web ACL, you assign a default -// action to take (allow, block) for any request that does not match any of -// the rules. The rules in a web ACL can be a combination of the types Rule, -// RuleGroup, and managed rule group. You can associate a web ACL with one or -// more Amazon Web Services resources to protect. The resources can be an Amazon -// CloudFront distribution, an Amazon API Gateway REST API, an Application Load -// Balancer, an AppSync GraphQL API, or an Amazon Cognito user pool. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation CreateWebACL for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFDuplicateItemException -// WAF couldn’t perform the operation because the resource that you tried -// to save is a duplicate of an existing one. -// -// - WAFOptimisticLockException -// WAF couldn’t save your changes because you tried to update or delete a -// resource that has changed since you last retrieved it. Get the resource again, -// make any changes you need to make to the new copy, and retry your operation. -// -// - WAFLimitsExceededException -// WAF couldn’t perform the operation because you exceeded your resource limit. -// For example, the maximum number of WebACL objects that you can create for -// an Amazon Web Services account. For more information, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the WAF Developer Guide. -// -// - WAFInvalidResourceException -// WAF couldn’t perform the operation because the resource that you requested -// isn’t valid. Check the resource, and try again. -// -// - WAFUnavailableEntityException -// WAF couldn’t retrieve a resource that you specified for this operation. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. Verify the resources that you -// are specifying in your request parameters and then retry the operation. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFTagOperationException -// An error occurred during the tagging operation. Retry your request. -// -// - WAFTagOperationInternalErrorException -// WAF couldn’t perform your tagging operation because of an internal error. -// Retry your request. -// -// - WAFSubscriptionNotFoundException -// You tried to use a managed rule group that's available by subscription, but -// you aren't subscribed to it yet. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// - WAFConfigurationWarningException -// The operation failed because you are inspecting the web request body, headers, -// or cookies without specifying how to handle oversize components. Rules that -// inspect the body must either provide an OversizeHandling configuration or -// they must be preceded by a SizeConstraintStatement that blocks the body content -// from being too large. Rules that inspect the headers or cookies must provide -// an OversizeHandling configuration. -// -// Provide the handling configuration and retry your operation. -// -// Alternately, you can suppress this warning by adding the following tag to -// the resource that you provide to this operation: Tag (key:WAF:OversizeFieldsHandlingConstraintOptOut, -// value:true). -// -// - WAFExpiredManagedRuleGroupVersionException -// The operation failed because the specified version for the managed rule group -// has expired. You can retrieve the available versions for the managed rule -// group by calling ListAvailableManagedRuleGroupVersions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/CreateWebACL -func (c *WAFV2) CreateWebACL(input *CreateWebACLInput) (*CreateWebACLOutput, error) { - req, out := c.CreateWebACLRequest(input) - return out, req.Send() -} - -// CreateWebACLWithContext is the same as CreateWebACL with the addition of -// the ability to pass a context and additional request options. -// -// See CreateWebACL for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) CreateWebACLWithContext(ctx aws.Context, input *CreateWebACLInput, opts ...request.Option) (*CreateWebACLOutput, error) { - req, out := c.CreateWebACLRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteFirewallManagerRuleGroups = "DeleteFirewallManagerRuleGroups" - -// DeleteFirewallManagerRuleGroupsRequest generates a "aws/request.Request" representing the -// client's request for the DeleteFirewallManagerRuleGroups operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteFirewallManagerRuleGroups for more information on using the DeleteFirewallManagerRuleGroups -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteFirewallManagerRuleGroupsRequest method. -// req, resp := client.DeleteFirewallManagerRuleGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteFirewallManagerRuleGroups -func (c *WAFV2) DeleteFirewallManagerRuleGroupsRequest(input *DeleteFirewallManagerRuleGroupsInput) (req *request.Request, output *DeleteFirewallManagerRuleGroupsOutput) { - op := &request.Operation{ - Name: opDeleteFirewallManagerRuleGroups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteFirewallManagerRuleGroupsInput{} - } - - output = &DeleteFirewallManagerRuleGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// DeleteFirewallManagerRuleGroups API operation for AWS WAFV2. -// -// Deletes all rule groups that are managed by Firewall Manager for the specified -// web ACL. -// -// You can only use this if ManagedByFirewallManager is false in the specified -// WebACL. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation DeleteFirewallManagerRuleGroups for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFOptimisticLockException -// WAF couldn’t save your changes because you tried to update or delete a -// resource that has changed since you last retrieved it. Get the resource again, -// make any changes you need to make to the new copy, and retry your operation. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteFirewallManagerRuleGroups -func (c *WAFV2) DeleteFirewallManagerRuleGroups(input *DeleteFirewallManagerRuleGroupsInput) (*DeleteFirewallManagerRuleGroupsOutput, error) { - req, out := c.DeleteFirewallManagerRuleGroupsRequest(input) - return out, req.Send() -} - -// DeleteFirewallManagerRuleGroupsWithContext is the same as DeleteFirewallManagerRuleGroups with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteFirewallManagerRuleGroups for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) DeleteFirewallManagerRuleGroupsWithContext(ctx aws.Context, input *DeleteFirewallManagerRuleGroupsInput, opts ...request.Option) (*DeleteFirewallManagerRuleGroupsOutput, error) { - req, out := c.DeleteFirewallManagerRuleGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteIPSet = "DeleteIPSet" - -// DeleteIPSetRequest generates a "aws/request.Request" representing the -// client's request for the DeleteIPSet operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteIPSet for more information on using the DeleteIPSet -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteIPSetRequest method. -// req, resp := client.DeleteIPSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteIPSet -func (c *WAFV2) DeleteIPSetRequest(input *DeleteIPSetInput) (req *request.Request, output *DeleteIPSetOutput) { - op := &request.Operation{ - Name: opDeleteIPSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteIPSetInput{} - } - - output = &DeleteIPSetOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteIPSet API operation for AWS WAFV2. -// -// Deletes the specified IPSet. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation DeleteIPSet for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFOptimisticLockException -// WAF couldn’t save your changes because you tried to update or delete a -// resource that has changed since you last retrieved it. Get the resource again, -// make any changes you need to make to the new copy, and retry your operation. -// -// - WAFAssociatedItemException -// WAF couldn’t perform the operation because your resource is being used -// by another resource or it’s associated with another resource. -// -// - WAFTagOperationException -// An error occurred during the tagging operation. Retry your request. -// -// - WAFTagOperationInternalErrorException -// WAF couldn’t perform your tagging operation because of an internal error. -// Retry your request. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteIPSet -func (c *WAFV2) DeleteIPSet(input *DeleteIPSetInput) (*DeleteIPSetOutput, error) { - req, out := c.DeleteIPSetRequest(input) - return out, req.Send() -} - -// DeleteIPSetWithContext is the same as DeleteIPSet with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteIPSet for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) DeleteIPSetWithContext(ctx aws.Context, input *DeleteIPSetInput, opts ...request.Option) (*DeleteIPSetOutput, error) { - req, out := c.DeleteIPSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteLoggingConfiguration = "DeleteLoggingConfiguration" - -// DeleteLoggingConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the DeleteLoggingConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteLoggingConfiguration for more information on using the DeleteLoggingConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteLoggingConfigurationRequest method. -// req, resp := client.DeleteLoggingConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteLoggingConfiguration -func (c *WAFV2) DeleteLoggingConfigurationRequest(input *DeleteLoggingConfigurationInput) (req *request.Request, output *DeleteLoggingConfigurationOutput) { - op := &request.Operation{ - Name: opDeleteLoggingConfiguration, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteLoggingConfigurationInput{} - } - - output = &DeleteLoggingConfigurationOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteLoggingConfiguration API operation for AWS WAFV2. -// -// Deletes the LoggingConfiguration from the specified web ACL. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation DeleteLoggingConfiguration for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFOptimisticLockException -// WAF couldn’t save your changes because you tried to update or delete a -// resource that has changed since you last retrieved it. Get the resource again, -// make any changes you need to make to the new copy, and retry your operation. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteLoggingConfiguration -func (c *WAFV2) DeleteLoggingConfiguration(input *DeleteLoggingConfigurationInput) (*DeleteLoggingConfigurationOutput, error) { - req, out := c.DeleteLoggingConfigurationRequest(input) - return out, req.Send() -} - -// DeleteLoggingConfigurationWithContext is the same as DeleteLoggingConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteLoggingConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) DeleteLoggingConfigurationWithContext(ctx aws.Context, input *DeleteLoggingConfigurationInput, opts ...request.Option) (*DeleteLoggingConfigurationOutput, error) { - req, out := c.DeleteLoggingConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeletePermissionPolicy = "DeletePermissionPolicy" - -// DeletePermissionPolicyRequest generates a "aws/request.Request" representing the -// client's request for the DeletePermissionPolicy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeletePermissionPolicy for more information on using the DeletePermissionPolicy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeletePermissionPolicyRequest method. -// req, resp := client.DeletePermissionPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeletePermissionPolicy -func (c *WAFV2) DeletePermissionPolicyRequest(input *DeletePermissionPolicyInput) (req *request.Request, output *DeletePermissionPolicyOutput) { - op := &request.Operation{ - Name: opDeletePermissionPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeletePermissionPolicyInput{} - } - - output = &DeletePermissionPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeletePermissionPolicy API operation for AWS WAFV2. -// -// Permanently deletes an IAM policy from the specified rule group. -// -// You must be the owner of the rule group to perform this operation. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation DeletePermissionPolicy for usage and error information. -// -// Returned Error Types: -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeletePermissionPolicy -func (c *WAFV2) DeletePermissionPolicy(input *DeletePermissionPolicyInput) (*DeletePermissionPolicyOutput, error) { - req, out := c.DeletePermissionPolicyRequest(input) - return out, req.Send() -} - -// DeletePermissionPolicyWithContext is the same as DeletePermissionPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See DeletePermissionPolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) DeletePermissionPolicyWithContext(ctx aws.Context, input *DeletePermissionPolicyInput, opts ...request.Option) (*DeletePermissionPolicyOutput, error) { - req, out := c.DeletePermissionPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteRegexPatternSet = "DeleteRegexPatternSet" - -// DeleteRegexPatternSetRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRegexPatternSet operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteRegexPatternSet for more information on using the DeleteRegexPatternSet -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteRegexPatternSetRequest method. -// req, resp := client.DeleteRegexPatternSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteRegexPatternSet -func (c *WAFV2) DeleteRegexPatternSetRequest(input *DeleteRegexPatternSetInput) (req *request.Request, output *DeleteRegexPatternSetOutput) { - op := &request.Operation{ - Name: opDeleteRegexPatternSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteRegexPatternSetInput{} - } - - output = &DeleteRegexPatternSetOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteRegexPatternSet API operation for AWS WAFV2. -// -// Deletes the specified RegexPatternSet. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation DeleteRegexPatternSet for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFOptimisticLockException -// WAF couldn’t save your changes because you tried to update or delete a -// resource that has changed since you last retrieved it. Get the resource again, -// make any changes you need to make to the new copy, and retry your operation. -// -// - WAFAssociatedItemException -// WAF couldn’t perform the operation because your resource is being used -// by another resource or it’s associated with another resource. -// -// - WAFTagOperationException -// An error occurred during the tagging operation. Retry your request. -// -// - WAFTagOperationInternalErrorException -// WAF couldn’t perform your tagging operation because of an internal error. -// Retry your request. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteRegexPatternSet -func (c *WAFV2) DeleteRegexPatternSet(input *DeleteRegexPatternSetInput) (*DeleteRegexPatternSetOutput, error) { - req, out := c.DeleteRegexPatternSetRequest(input) - return out, req.Send() -} - -// DeleteRegexPatternSetWithContext is the same as DeleteRegexPatternSet with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteRegexPatternSet for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) DeleteRegexPatternSetWithContext(ctx aws.Context, input *DeleteRegexPatternSetInput, opts ...request.Option) (*DeleteRegexPatternSetOutput, error) { - req, out := c.DeleteRegexPatternSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteRuleGroup = "DeleteRuleGroup" - -// DeleteRuleGroupRequest generates a "aws/request.Request" representing the -// client's request for the DeleteRuleGroup operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteRuleGroup for more information on using the DeleteRuleGroup -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteRuleGroupRequest method. -// req, resp := client.DeleteRuleGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteRuleGroup -func (c *WAFV2) DeleteRuleGroupRequest(input *DeleteRuleGroupInput) (req *request.Request, output *DeleteRuleGroupOutput) { - op := &request.Operation{ - Name: opDeleteRuleGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteRuleGroupInput{} - } - - output = &DeleteRuleGroupOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteRuleGroup API operation for AWS WAFV2. -// -// Deletes the specified RuleGroup. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation DeleteRuleGroup for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFOptimisticLockException -// WAF couldn’t save your changes because you tried to update or delete a -// resource that has changed since you last retrieved it. Get the resource again, -// make any changes you need to make to the new copy, and retry your operation. -// -// - WAFAssociatedItemException -// WAF couldn’t perform the operation because your resource is being used -// by another resource or it’s associated with another resource. -// -// - WAFTagOperationException -// An error occurred during the tagging operation. Retry your request. -// -// - WAFTagOperationInternalErrorException -// WAF couldn’t perform your tagging operation because of an internal error. -// Retry your request. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteRuleGroup -func (c *WAFV2) DeleteRuleGroup(input *DeleteRuleGroupInput) (*DeleteRuleGroupOutput, error) { - req, out := c.DeleteRuleGroupRequest(input) - return out, req.Send() -} - -// DeleteRuleGroupWithContext is the same as DeleteRuleGroup with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteRuleGroup for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) DeleteRuleGroupWithContext(ctx aws.Context, input *DeleteRuleGroupInput, opts ...request.Option) (*DeleteRuleGroupOutput, error) { - req, out := c.DeleteRuleGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDeleteWebACL = "DeleteWebACL" - -// DeleteWebACLRequest generates a "aws/request.Request" representing the -// client's request for the DeleteWebACL operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DeleteWebACL for more information on using the DeleteWebACL -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DeleteWebACLRequest method. -// req, resp := client.DeleteWebACLRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteWebACL -func (c *WAFV2) DeleteWebACLRequest(input *DeleteWebACLInput) (req *request.Request, output *DeleteWebACLOutput) { - op := &request.Operation{ - Name: opDeleteWebACL, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DeleteWebACLInput{} - } - - output = &DeleteWebACLOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DeleteWebACL API operation for AWS WAFV2. -// -// Deletes the specified WebACL. -// -// You can only use this if ManagedByFirewallManager is false in the specified -// WebACL. -// -// Before deleting any web ACL, first disassociate it from all resources. -// -// - To retrieve a list of the resources that are associated with a web ACL, -// use the following calls: For regional resources, call ListResourcesForWebACL. -// For Amazon CloudFront distributions, use the CloudFront call ListDistributionsByWebACLId. -// For information, see ListDistributionsByWebACLId (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_ListDistributionsByWebACLId.html). -// -// - To disassociate a resource from a web ACL, use the following calls: -// For regional resources, call DisassociateWebACL. For Amazon CloudFront -// distributions, provide an empty web ACL ID in the CloudFront call UpdateDistribution. -// For information, see UpdateDistribution (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_UpdateDistribution.html). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation DeleteWebACL for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFOptimisticLockException -// WAF couldn’t save your changes because you tried to update or delete a -// resource that has changed since you last retrieved it. Get the resource again, -// make any changes you need to make to the new copy, and retry your operation. -// -// - WAFAssociatedItemException -// WAF couldn’t perform the operation because your resource is being used -// by another resource or it’s associated with another resource. -// -// - WAFTagOperationException -// An error occurred during the tagging operation. Retry your request. -// -// - WAFTagOperationInternalErrorException -// WAF couldn’t perform your tagging operation because of an internal error. -// Retry your request. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DeleteWebACL -func (c *WAFV2) DeleteWebACL(input *DeleteWebACLInput) (*DeleteWebACLOutput, error) { - req, out := c.DeleteWebACLRequest(input) - return out, req.Send() -} - -// DeleteWebACLWithContext is the same as DeleteWebACL with the addition of -// the ability to pass a context and additional request options. -// -// See DeleteWebACL for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) DeleteWebACLWithContext(ctx aws.Context, input *DeleteWebACLInput, opts ...request.Option) (*DeleteWebACLOutput, error) { - req, out := c.DeleteWebACLRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDescribeManagedRuleGroup = "DescribeManagedRuleGroup" - -// DescribeManagedRuleGroupRequest generates a "aws/request.Request" representing the -// client's request for the DescribeManagedRuleGroup operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DescribeManagedRuleGroup for more information on using the DescribeManagedRuleGroup -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DescribeManagedRuleGroupRequest method. -// req, resp := client.DescribeManagedRuleGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DescribeManagedRuleGroup -func (c *WAFV2) DescribeManagedRuleGroupRequest(input *DescribeManagedRuleGroupInput) (req *request.Request, output *DescribeManagedRuleGroupOutput) { - op := &request.Operation{ - Name: opDescribeManagedRuleGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DescribeManagedRuleGroupInput{} - } - - output = &DescribeManagedRuleGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// DescribeManagedRuleGroup API operation for AWS WAFV2. -// -// Provides high-level information for a managed rule group, including descriptions -// of the rules. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation DescribeManagedRuleGroup for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFInvalidResourceException -// WAF couldn’t perform the operation because the resource that you requested -// isn’t valid. Check the resource, and try again. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// - WAFExpiredManagedRuleGroupVersionException -// The operation failed because the specified version for the managed rule group -// has expired. You can retrieve the available versions for the managed rule -// group by calling ListAvailableManagedRuleGroupVersions. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DescribeManagedRuleGroup -func (c *WAFV2) DescribeManagedRuleGroup(input *DescribeManagedRuleGroupInput) (*DescribeManagedRuleGroupOutput, error) { - req, out := c.DescribeManagedRuleGroupRequest(input) - return out, req.Send() -} - -// DescribeManagedRuleGroupWithContext is the same as DescribeManagedRuleGroup with the addition of -// the ability to pass a context and additional request options. -// -// See DescribeManagedRuleGroup for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) DescribeManagedRuleGroupWithContext(ctx aws.Context, input *DescribeManagedRuleGroupInput, opts ...request.Option) (*DescribeManagedRuleGroupOutput, error) { - req, out := c.DescribeManagedRuleGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opDisassociateWebACL = "DisassociateWebACL" - -// DisassociateWebACLRequest generates a "aws/request.Request" representing the -// client's request for the DisassociateWebACL operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See DisassociateWebACL for more information on using the DisassociateWebACL -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the DisassociateWebACLRequest method. -// req, resp := client.DisassociateWebACLRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DisassociateWebACL -func (c *WAFV2) DisassociateWebACLRequest(input *DisassociateWebACLInput) (req *request.Request, output *DisassociateWebACLOutput) { - op := &request.Operation{ - Name: opDisassociateWebACL, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &DisassociateWebACLInput{} - } - - output = &DisassociateWebACLOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// DisassociateWebACL API operation for AWS WAFV2. -// -// Disassociates the specified regional application resource from any existing -// web ACL association. A resource can have at most one web ACL association. -// A regional application can be an Application Load Balancer (ALB), an Amazon -// API Gateway REST API, an AppSync GraphQL API, or an Amazon Cognito user pool. -// -// For Amazon CloudFront, don't use this call. Instead, use your CloudFront -// distribution configuration. To disassociate a web ACL, provide an empty web -// ACL ID in the CloudFront call UpdateDistribution. For information, see UpdateDistribution -// (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_UpdateDistribution.html). -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation DisassociateWebACL for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/DisassociateWebACL -func (c *WAFV2) DisassociateWebACL(input *DisassociateWebACLInput) (*DisassociateWebACLOutput, error) { - req, out := c.DisassociateWebACLRequest(input) - return out, req.Send() -} - -// DisassociateWebACLWithContext is the same as DisassociateWebACL with the addition of -// the ability to pass a context and additional request options. -// -// See DisassociateWebACL for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) DisassociateWebACLWithContext(ctx aws.Context, input *DisassociateWebACLInput, opts ...request.Option) (*DisassociateWebACLOutput, error) { - req, out := c.DisassociateWebACLRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGenerateMobileSdkReleaseUrl = "GenerateMobileSdkReleaseUrl" - -// GenerateMobileSdkReleaseUrlRequest generates a "aws/request.Request" representing the -// client's request for the GenerateMobileSdkReleaseUrl operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GenerateMobileSdkReleaseUrl for more information on using the GenerateMobileSdkReleaseUrl -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GenerateMobileSdkReleaseUrlRequest method. -// req, resp := client.GenerateMobileSdkReleaseUrlRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GenerateMobileSdkReleaseUrl -func (c *WAFV2) GenerateMobileSdkReleaseUrlRequest(input *GenerateMobileSdkReleaseUrlInput) (req *request.Request, output *GenerateMobileSdkReleaseUrlOutput) { - op := &request.Operation{ - Name: opGenerateMobileSdkReleaseUrl, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GenerateMobileSdkReleaseUrlInput{} - } - - output = &GenerateMobileSdkReleaseUrlOutput{} - req = c.newRequest(op, input, output) - return -} - -// GenerateMobileSdkReleaseUrl API operation for AWS WAFV2. -// -// Generates a presigned download URL for the specified release of the mobile -// SDK. -// -// The mobile SDK is not generally available. Customers who have access to the -// mobile SDK can use it to establish and manage WAF tokens for use in HTTP(S) -// requests from a mobile device to WAF. For more information, see WAF client -// application integration (https://docs.aws.amazon.com/waf/latest/developerguide/waf-application-integration.html) -// in the WAF Developer Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation GenerateMobileSdkReleaseUrl for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GenerateMobileSdkReleaseUrl -func (c *WAFV2) GenerateMobileSdkReleaseUrl(input *GenerateMobileSdkReleaseUrlInput) (*GenerateMobileSdkReleaseUrlOutput, error) { - req, out := c.GenerateMobileSdkReleaseUrlRequest(input) - return out, req.Send() -} - -// GenerateMobileSdkReleaseUrlWithContext is the same as GenerateMobileSdkReleaseUrl with the addition of -// the ability to pass a context and additional request options. -// -// See GenerateMobileSdkReleaseUrl for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) GenerateMobileSdkReleaseUrlWithContext(ctx aws.Context, input *GenerateMobileSdkReleaseUrlInput, opts ...request.Option) (*GenerateMobileSdkReleaseUrlOutput, error) { - req, out := c.GenerateMobileSdkReleaseUrlRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetIPSet = "GetIPSet" - -// GetIPSetRequest generates a "aws/request.Request" representing the -// client's request for the GetIPSet operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetIPSet for more information on using the GetIPSet -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetIPSetRequest method. -// req, resp := client.GetIPSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetIPSet -func (c *WAFV2) GetIPSetRequest(input *GetIPSetInput) (req *request.Request, output *GetIPSetOutput) { - op := &request.Operation{ - Name: opGetIPSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetIPSetInput{} - } - - output = &GetIPSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetIPSet API operation for AWS WAFV2. -// -// Retrieves the specified IPSet. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation GetIPSet for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetIPSet -func (c *WAFV2) GetIPSet(input *GetIPSetInput) (*GetIPSetOutput, error) { - req, out := c.GetIPSetRequest(input) - return out, req.Send() -} - -// GetIPSetWithContext is the same as GetIPSet with the addition of -// the ability to pass a context and additional request options. -// -// See GetIPSet for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) GetIPSetWithContext(ctx aws.Context, input *GetIPSetInput, opts ...request.Option) (*GetIPSetOutput, error) { - req, out := c.GetIPSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetLoggingConfiguration = "GetLoggingConfiguration" - -// GetLoggingConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the GetLoggingConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetLoggingConfiguration for more information on using the GetLoggingConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetLoggingConfigurationRequest method. -// req, resp := client.GetLoggingConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetLoggingConfiguration -func (c *WAFV2) GetLoggingConfigurationRequest(input *GetLoggingConfigurationInput) (req *request.Request, output *GetLoggingConfigurationOutput) { - op := &request.Operation{ - Name: opGetLoggingConfiguration, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetLoggingConfigurationInput{} - } - - output = &GetLoggingConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetLoggingConfiguration API operation for AWS WAFV2. -// -// Returns the LoggingConfiguration for the specified web ACL. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation GetLoggingConfiguration for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetLoggingConfiguration -func (c *WAFV2) GetLoggingConfiguration(input *GetLoggingConfigurationInput) (*GetLoggingConfigurationOutput, error) { - req, out := c.GetLoggingConfigurationRequest(input) - return out, req.Send() -} - -// GetLoggingConfigurationWithContext is the same as GetLoggingConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See GetLoggingConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) GetLoggingConfigurationWithContext(ctx aws.Context, input *GetLoggingConfigurationInput, opts ...request.Option) (*GetLoggingConfigurationOutput, error) { - req, out := c.GetLoggingConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetManagedRuleSet = "GetManagedRuleSet" - -// GetManagedRuleSetRequest generates a "aws/request.Request" representing the -// client's request for the GetManagedRuleSet operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetManagedRuleSet for more information on using the GetManagedRuleSet -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetManagedRuleSetRequest method. -// req, resp := client.GetManagedRuleSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetManagedRuleSet -func (c *WAFV2) GetManagedRuleSetRequest(input *GetManagedRuleSetInput) (req *request.Request, output *GetManagedRuleSetOutput) { - op := &request.Operation{ - Name: opGetManagedRuleSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetManagedRuleSetInput{} - } - - output = &GetManagedRuleSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetManagedRuleSet API operation for AWS WAFV2. -// -// Retrieves the specified managed rule set. -// -// This is intended for use only by vendors of managed rule sets. Vendors are -// Amazon Web Services and Amazon Web Services Marketplace sellers. -// -// Vendors, you can use the managed rule set APIs to provide controlled rollout -// of your versioned managed rule group offerings for your customers. The APIs -// are ListManagedRuleSets, GetManagedRuleSet, PutManagedRuleSetVersions, and -// UpdateManagedRuleSetVersionExpiryDate. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation GetManagedRuleSet for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetManagedRuleSet -func (c *WAFV2) GetManagedRuleSet(input *GetManagedRuleSetInput) (*GetManagedRuleSetOutput, error) { - req, out := c.GetManagedRuleSetRequest(input) - return out, req.Send() -} - -// GetManagedRuleSetWithContext is the same as GetManagedRuleSet with the addition of -// the ability to pass a context and additional request options. -// -// See GetManagedRuleSet for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) GetManagedRuleSetWithContext(ctx aws.Context, input *GetManagedRuleSetInput, opts ...request.Option) (*GetManagedRuleSetOutput, error) { - req, out := c.GetManagedRuleSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetMobileSdkRelease = "GetMobileSdkRelease" - -// GetMobileSdkReleaseRequest generates a "aws/request.Request" representing the -// client's request for the GetMobileSdkRelease operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetMobileSdkRelease for more information on using the GetMobileSdkRelease -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetMobileSdkReleaseRequest method. -// req, resp := client.GetMobileSdkReleaseRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetMobileSdkRelease -func (c *WAFV2) GetMobileSdkReleaseRequest(input *GetMobileSdkReleaseInput) (req *request.Request, output *GetMobileSdkReleaseOutput) { - op := &request.Operation{ - Name: opGetMobileSdkRelease, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetMobileSdkReleaseInput{} - } - - output = &GetMobileSdkReleaseOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetMobileSdkRelease API operation for AWS WAFV2. -// -// Retrieves information for the specified mobile SDK release, including release -// notes and tags. -// -// The mobile SDK is not generally available. Customers who have access to the -// mobile SDK can use it to establish and manage WAF tokens for use in HTTP(S) -// requests from a mobile device to WAF. For more information, see WAF client -// application integration (https://docs.aws.amazon.com/waf/latest/developerguide/waf-application-integration.html) -// in the WAF Developer Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation GetMobileSdkRelease for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetMobileSdkRelease -func (c *WAFV2) GetMobileSdkRelease(input *GetMobileSdkReleaseInput) (*GetMobileSdkReleaseOutput, error) { - req, out := c.GetMobileSdkReleaseRequest(input) - return out, req.Send() -} - -// GetMobileSdkReleaseWithContext is the same as GetMobileSdkRelease with the addition of -// the ability to pass a context and additional request options. -// -// See GetMobileSdkRelease for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) GetMobileSdkReleaseWithContext(ctx aws.Context, input *GetMobileSdkReleaseInput, opts ...request.Option) (*GetMobileSdkReleaseOutput, error) { - req, out := c.GetMobileSdkReleaseRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetPermissionPolicy = "GetPermissionPolicy" - -// GetPermissionPolicyRequest generates a "aws/request.Request" representing the -// client's request for the GetPermissionPolicy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetPermissionPolicy for more information on using the GetPermissionPolicy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetPermissionPolicyRequest method. -// req, resp := client.GetPermissionPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetPermissionPolicy -func (c *WAFV2) GetPermissionPolicyRequest(input *GetPermissionPolicyInput) (req *request.Request, output *GetPermissionPolicyOutput) { - op := &request.Operation{ - Name: opGetPermissionPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetPermissionPolicyInput{} - } - - output = &GetPermissionPolicyOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetPermissionPolicy API operation for AWS WAFV2. -// -// Returns the IAM policy that is attached to the specified rule group. -// -// You must be the owner of the rule group to perform this operation. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation GetPermissionPolicy for usage and error information. -// -// Returned Error Types: -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetPermissionPolicy -func (c *WAFV2) GetPermissionPolicy(input *GetPermissionPolicyInput) (*GetPermissionPolicyOutput, error) { - req, out := c.GetPermissionPolicyRequest(input) - return out, req.Send() -} - -// GetPermissionPolicyWithContext is the same as GetPermissionPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See GetPermissionPolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) GetPermissionPolicyWithContext(ctx aws.Context, input *GetPermissionPolicyInput, opts ...request.Option) (*GetPermissionPolicyOutput, error) { - req, out := c.GetPermissionPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetRateBasedStatementManagedKeys = "GetRateBasedStatementManagedKeys" - -// GetRateBasedStatementManagedKeysRequest generates a "aws/request.Request" representing the -// client's request for the GetRateBasedStatementManagedKeys operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetRateBasedStatementManagedKeys for more information on using the GetRateBasedStatementManagedKeys -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetRateBasedStatementManagedKeysRequest method. -// req, resp := client.GetRateBasedStatementManagedKeysRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetRateBasedStatementManagedKeys -func (c *WAFV2) GetRateBasedStatementManagedKeysRequest(input *GetRateBasedStatementManagedKeysInput) (req *request.Request, output *GetRateBasedStatementManagedKeysOutput) { - op := &request.Operation{ - Name: opGetRateBasedStatementManagedKeys, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetRateBasedStatementManagedKeysInput{} - } - - output = &GetRateBasedStatementManagedKeysOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRateBasedStatementManagedKeys API operation for AWS WAFV2. -// -// Retrieves the keys that are currently blocked by a rate-based rule instance. -// The maximum number of managed keys that can be blocked for a single rate-based -// rule instance is 10,000. If more than 10,000 addresses exceed the rate limit, -// those with the highest rates are blocked. -// -// For a rate-based rule that you've defined inside a rule group, provide the -// name of the rule group reference statement in your request, in addition to -// the rate-based rule name and the web ACL name. -// -// WAF monitors web requests and manages keys independently for each unique -// combination of web ACL, optional rule group, and rate-based rule. For example, -// if you define a rate-based rule inside a rule group, and then use the rule -// group in a web ACL, WAF monitors web requests and manages keys for that web -// ACL, rule group reference statement, and rate-based rule instance. If you -// use the same rule group in a second web ACL, WAF monitors web requests and -// manages keys for this second usage completely independent of your first. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation GetRateBasedStatementManagedKeys for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetRateBasedStatementManagedKeys -func (c *WAFV2) GetRateBasedStatementManagedKeys(input *GetRateBasedStatementManagedKeysInput) (*GetRateBasedStatementManagedKeysOutput, error) { - req, out := c.GetRateBasedStatementManagedKeysRequest(input) - return out, req.Send() -} - -// GetRateBasedStatementManagedKeysWithContext is the same as GetRateBasedStatementManagedKeys with the addition of -// the ability to pass a context and additional request options. -// -// See GetRateBasedStatementManagedKeys for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) GetRateBasedStatementManagedKeysWithContext(ctx aws.Context, input *GetRateBasedStatementManagedKeysInput, opts ...request.Option) (*GetRateBasedStatementManagedKeysOutput, error) { - req, out := c.GetRateBasedStatementManagedKeysRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetRegexPatternSet = "GetRegexPatternSet" - -// GetRegexPatternSetRequest generates a "aws/request.Request" representing the -// client's request for the GetRegexPatternSet operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetRegexPatternSet for more information on using the GetRegexPatternSet -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetRegexPatternSetRequest method. -// req, resp := client.GetRegexPatternSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetRegexPatternSet -func (c *WAFV2) GetRegexPatternSetRequest(input *GetRegexPatternSetInput) (req *request.Request, output *GetRegexPatternSetOutput) { - op := &request.Operation{ - Name: opGetRegexPatternSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetRegexPatternSetInput{} - } - - output = &GetRegexPatternSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRegexPatternSet API operation for AWS WAFV2. -// -// Retrieves the specified RegexPatternSet. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation GetRegexPatternSet for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetRegexPatternSet -func (c *WAFV2) GetRegexPatternSet(input *GetRegexPatternSetInput) (*GetRegexPatternSetOutput, error) { - req, out := c.GetRegexPatternSetRequest(input) - return out, req.Send() -} - -// GetRegexPatternSetWithContext is the same as GetRegexPatternSet with the addition of -// the ability to pass a context and additional request options. -// -// See GetRegexPatternSet for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) GetRegexPatternSetWithContext(ctx aws.Context, input *GetRegexPatternSetInput, opts ...request.Option) (*GetRegexPatternSetOutput, error) { - req, out := c.GetRegexPatternSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetRuleGroup = "GetRuleGroup" - -// GetRuleGroupRequest generates a "aws/request.Request" representing the -// client's request for the GetRuleGroup operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetRuleGroup for more information on using the GetRuleGroup -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetRuleGroupRequest method. -// req, resp := client.GetRuleGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetRuleGroup -func (c *WAFV2) GetRuleGroupRequest(input *GetRuleGroupInput) (req *request.Request, output *GetRuleGroupOutput) { - op := &request.Operation{ - Name: opGetRuleGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetRuleGroupInput{} - } - - output = &GetRuleGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetRuleGroup API operation for AWS WAFV2. -// -// Retrieves the specified RuleGroup. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation GetRuleGroup for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetRuleGroup -func (c *WAFV2) GetRuleGroup(input *GetRuleGroupInput) (*GetRuleGroupOutput, error) { - req, out := c.GetRuleGroupRequest(input) - return out, req.Send() -} - -// GetRuleGroupWithContext is the same as GetRuleGroup with the addition of -// the ability to pass a context and additional request options. -// -// See GetRuleGroup for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) GetRuleGroupWithContext(ctx aws.Context, input *GetRuleGroupInput, opts ...request.Option) (*GetRuleGroupOutput, error) { - req, out := c.GetRuleGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetSampledRequests = "GetSampledRequests" - -// GetSampledRequestsRequest generates a "aws/request.Request" representing the -// client's request for the GetSampledRequests operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetSampledRequests for more information on using the GetSampledRequests -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetSampledRequestsRequest method. -// req, resp := client.GetSampledRequestsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetSampledRequests -func (c *WAFV2) GetSampledRequestsRequest(input *GetSampledRequestsInput) (req *request.Request, output *GetSampledRequestsOutput) { - op := &request.Operation{ - Name: opGetSampledRequests, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetSampledRequestsInput{} - } - - output = &GetSampledRequestsOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetSampledRequests API operation for AWS WAFV2. -// -// Gets detailed information about a specified number of requests--a sample--that -// WAF randomly selects from among the first 5,000 requests that your Amazon -// Web Services resource received during a time range that you choose. You can -// specify a sample size of up to 500 requests, and you can specify any time -// range in the previous three hours. -// -// GetSampledRequests returns a time range, which is usually the time range -// that you specified. However, if your resource (such as a CloudFront distribution) -// received 5,000 requests before the specified time range elapsed, GetSampledRequests -// returns an updated time range. This new time range indicates the actual period -// during which WAF selected the requests in the sample. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation GetSampledRequests for usage and error information. -// -// Returned Error Types: -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetSampledRequests -func (c *WAFV2) GetSampledRequests(input *GetSampledRequestsInput) (*GetSampledRequestsOutput, error) { - req, out := c.GetSampledRequestsRequest(input) - return out, req.Send() -} - -// GetSampledRequestsWithContext is the same as GetSampledRequests with the addition of -// the ability to pass a context and additional request options. -// -// See GetSampledRequests for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) GetSampledRequestsWithContext(ctx aws.Context, input *GetSampledRequestsInput, opts ...request.Option) (*GetSampledRequestsOutput, error) { - req, out := c.GetSampledRequestsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetWebACL = "GetWebACL" - -// GetWebACLRequest generates a "aws/request.Request" representing the -// client's request for the GetWebACL operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetWebACL for more information on using the GetWebACL -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetWebACLRequest method. -// req, resp := client.GetWebACLRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetWebACL -func (c *WAFV2) GetWebACLRequest(input *GetWebACLInput) (req *request.Request, output *GetWebACLOutput) { - op := &request.Operation{ - Name: opGetWebACL, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetWebACLInput{} - } - - output = &GetWebACLOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetWebACL API operation for AWS WAFV2. -// -// Retrieves the specified WebACL. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation GetWebACL for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetWebACL -func (c *WAFV2) GetWebACL(input *GetWebACLInput) (*GetWebACLOutput, error) { - req, out := c.GetWebACLRequest(input) - return out, req.Send() -} - -// GetWebACLWithContext is the same as GetWebACL with the addition of -// the ability to pass a context and additional request options. -// -// See GetWebACL for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) GetWebACLWithContext(ctx aws.Context, input *GetWebACLInput, opts ...request.Option) (*GetWebACLOutput, error) { - req, out := c.GetWebACLRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opGetWebACLForResource = "GetWebACLForResource" - -// GetWebACLForResourceRequest generates a "aws/request.Request" representing the -// client's request for the GetWebACLForResource operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See GetWebACLForResource for more information on using the GetWebACLForResource -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the GetWebACLForResourceRequest method. -// req, resp := client.GetWebACLForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetWebACLForResource -func (c *WAFV2) GetWebACLForResourceRequest(input *GetWebACLForResourceInput) (req *request.Request, output *GetWebACLForResourceOutput) { - op := &request.Operation{ - Name: opGetWebACLForResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &GetWebACLForResourceInput{} - } - - output = &GetWebACLForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// GetWebACLForResource API operation for AWS WAFV2. -// -// Retrieves the WebACL for the specified resource. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation GetWebACLForResource for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFUnavailableEntityException -// WAF couldn’t retrieve a resource that you specified for this operation. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. Verify the resources that you -// are specifying in your request parameters and then retry the operation. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/GetWebACLForResource -func (c *WAFV2) GetWebACLForResource(input *GetWebACLForResourceInput) (*GetWebACLForResourceOutput, error) { - req, out := c.GetWebACLForResourceRequest(input) - return out, req.Send() -} - -// GetWebACLForResourceWithContext is the same as GetWebACLForResource with the addition of -// the ability to pass a context and additional request options. -// -// See GetWebACLForResource for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) GetWebACLForResourceWithContext(ctx aws.Context, input *GetWebACLForResourceInput, opts ...request.Option) (*GetWebACLForResourceOutput, error) { - req, out := c.GetWebACLForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListAvailableManagedRuleGroupVersions = "ListAvailableManagedRuleGroupVersions" - -// ListAvailableManagedRuleGroupVersionsRequest generates a "aws/request.Request" representing the -// client's request for the ListAvailableManagedRuleGroupVersions operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListAvailableManagedRuleGroupVersions for more information on using the ListAvailableManagedRuleGroupVersions -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListAvailableManagedRuleGroupVersionsRequest method. -// req, resp := client.ListAvailableManagedRuleGroupVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListAvailableManagedRuleGroupVersions -func (c *WAFV2) ListAvailableManagedRuleGroupVersionsRequest(input *ListAvailableManagedRuleGroupVersionsInput) (req *request.Request, output *ListAvailableManagedRuleGroupVersionsOutput) { - op := &request.Operation{ - Name: opListAvailableManagedRuleGroupVersions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListAvailableManagedRuleGroupVersionsInput{} - } - - output = &ListAvailableManagedRuleGroupVersionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAvailableManagedRuleGroupVersions API operation for AWS WAFV2. -// -// Returns a list of the available versions for the specified managed rule group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation ListAvailableManagedRuleGroupVersions for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListAvailableManagedRuleGroupVersions -func (c *WAFV2) ListAvailableManagedRuleGroupVersions(input *ListAvailableManagedRuleGroupVersionsInput) (*ListAvailableManagedRuleGroupVersionsOutput, error) { - req, out := c.ListAvailableManagedRuleGroupVersionsRequest(input) - return out, req.Send() -} - -// ListAvailableManagedRuleGroupVersionsWithContext is the same as ListAvailableManagedRuleGroupVersions with the addition of -// the ability to pass a context and additional request options. -// -// See ListAvailableManagedRuleGroupVersions for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) ListAvailableManagedRuleGroupVersionsWithContext(ctx aws.Context, input *ListAvailableManagedRuleGroupVersionsInput, opts ...request.Option) (*ListAvailableManagedRuleGroupVersionsOutput, error) { - req, out := c.ListAvailableManagedRuleGroupVersionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListAvailableManagedRuleGroups = "ListAvailableManagedRuleGroups" - -// ListAvailableManagedRuleGroupsRequest generates a "aws/request.Request" representing the -// client's request for the ListAvailableManagedRuleGroups operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListAvailableManagedRuleGroups for more information on using the ListAvailableManagedRuleGroups -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListAvailableManagedRuleGroupsRequest method. -// req, resp := client.ListAvailableManagedRuleGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListAvailableManagedRuleGroups -func (c *WAFV2) ListAvailableManagedRuleGroupsRequest(input *ListAvailableManagedRuleGroupsInput) (req *request.Request, output *ListAvailableManagedRuleGroupsOutput) { - op := &request.Operation{ - Name: opListAvailableManagedRuleGroups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListAvailableManagedRuleGroupsInput{} - } - - output = &ListAvailableManagedRuleGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListAvailableManagedRuleGroups API operation for AWS WAFV2. -// -// Retrieves an array of managed rule groups that are available for you to use. -// This list includes all Amazon Web Services Managed Rules rule groups and -// all of the Amazon Web Services Marketplace managed rule groups that you're -// subscribed to. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation ListAvailableManagedRuleGroups for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListAvailableManagedRuleGroups -func (c *WAFV2) ListAvailableManagedRuleGroups(input *ListAvailableManagedRuleGroupsInput) (*ListAvailableManagedRuleGroupsOutput, error) { - req, out := c.ListAvailableManagedRuleGroupsRequest(input) - return out, req.Send() -} - -// ListAvailableManagedRuleGroupsWithContext is the same as ListAvailableManagedRuleGroups with the addition of -// the ability to pass a context and additional request options. -// -// See ListAvailableManagedRuleGroups for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) ListAvailableManagedRuleGroupsWithContext(ctx aws.Context, input *ListAvailableManagedRuleGroupsInput, opts ...request.Option) (*ListAvailableManagedRuleGroupsOutput, error) { - req, out := c.ListAvailableManagedRuleGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListIPSets = "ListIPSets" - -// ListIPSetsRequest generates a "aws/request.Request" representing the -// client's request for the ListIPSets operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListIPSets for more information on using the ListIPSets -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListIPSetsRequest method. -// req, resp := client.ListIPSetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListIPSets -func (c *WAFV2) ListIPSetsRequest(input *ListIPSetsInput) (req *request.Request, output *ListIPSetsOutput) { - op := &request.Operation{ - Name: opListIPSets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListIPSetsInput{} - } - - output = &ListIPSetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListIPSets API operation for AWS WAFV2. -// -// Retrieves an array of IPSetSummary objects for the IP sets that you manage. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation ListIPSets for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListIPSets -func (c *WAFV2) ListIPSets(input *ListIPSetsInput) (*ListIPSetsOutput, error) { - req, out := c.ListIPSetsRequest(input) - return out, req.Send() -} - -// ListIPSetsWithContext is the same as ListIPSets with the addition of -// the ability to pass a context and additional request options. -// -// See ListIPSets for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) ListIPSetsWithContext(ctx aws.Context, input *ListIPSetsInput, opts ...request.Option) (*ListIPSetsOutput, error) { - req, out := c.ListIPSetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListLoggingConfigurations = "ListLoggingConfigurations" - -// ListLoggingConfigurationsRequest generates a "aws/request.Request" representing the -// client's request for the ListLoggingConfigurations operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListLoggingConfigurations for more information on using the ListLoggingConfigurations -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListLoggingConfigurationsRequest method. -// req, resp := client.ListLoggingConfigurationsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListLoggingConfigurations -func (c *WAFV2) ListLoggingConfigurationsRequest(input *ListLoggingConfigurationsInput) (req *request.Request, output *ListLoggingConfigurationsOutput) { - op := &request.Operation{ - Name: opListLoggingConfigurations, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListLoggingConfigurationsInput{} - } - - output = &ListLoggingConfigurationsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListLoggingConfigurations API operation for AWS WAFV2. -// -// Retrieves an array of your LoggingConfiguration objects. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation ListLoggingConfigurations for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListLoggingConfigurations -func (c *WAFV2) ListLoggingConfigurations(input *ListLoggingConfigurationsInput) (*ListLoggingConfigurationsOutput, error) { - req, out := c.ListLoggingConfigurationsRequest(input) - return out, req.Send() -} - -// ListLoggingConfigurationsWithContext is the same as ListLoggingConfigurations with the addition of -// the ability to pass a context and additional request options. -// -// See ListLoggingConfigurations for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) ListLoggingConfigurationsWithContext(ctx aws.Context, input *ListLoggingConfigurationsInput, opts ...request.Option) (*ListLoggingConfigurationsOutput, error) { - req, out := c.ListLoggingConfigurationsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListManagedRuleSets = "ListManagedRuleSets" - -// ListManagedRuleSetsRequest generates a "aws/request.Request" representing the -// client's request for the ListManagedRuleSets operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListManagedRuleSets for more information on using the ListManagedRuleSets -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListManagedRuleSetsRequest method. -// req, resp := client.ListManagedRuleSetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListManagedRuleSets -func (c *WAFV2) ListManagedRuleSetsRequest(input *ListManagedRuleSetsInput) (req *request.Request, output *ListManagedRuleSetsOutput) { - op := &request.Operation{ - Name: opListManagedRuleSets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListManagedRuleSetsInput{} - } - - output = &ListManagedRuleSetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListManagedRuleSets API operation for AWS WAFV2. -// -// Retrieves the managed rule sets that you own. -// -// This is intended for use only by vendors of managed rule sets. Vendors are -// Amazon Web Services and Amazon Web Services Marketplace sellers. -// -// Vendors, you can use the managed rule set APIs to provide controlled rollout -// of your versioned managed rule group offerings for your customers. The APIs -// are ListManagedRuleSets, GetManagedRuleSet, PutManagedRuleSetVersions, and -// UpdateManagedRuleSetVersionExpiryDate. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation ListManagedRuleSets for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListManagedRuleSets -func (c *WAFV2) ListManagedRuleSets(input *ListManagedRuleSetsInput) (*ListManagedRuleSetsOutput, error) { - req, out := c.ListManagedRuleSetsRequest(input) - return out, req.Send() -} - -// ListManagedRuleSetsWithContext is the same as ListManagedRuleSets with the addition of -// the ability to pass a context and additional request options. -// -// See ListManagedRuleSets for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) ListManagedRuleSetsWithContext(ctx aws.Context, input *ListManagedRuleSetsInput, opts ...request.Option) (*ListManagedRuleSetsOutput, error) { - req, out := c.ListManagedRuleSetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListMobileSdkReleases = "ListMobileSdkReleases" - -// ListMobileSdkReleasesRequest generates a "aws/request.Request" representing the -// client's request for the ListMobileSdkReleases operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListMobileSdkReleases for more information on using the ListMobileSdkReleases -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListMobileSdkReleasesRequest method. -// req, resp := client.ListMobileSdkReleasesRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListMobileSdkReleases -func (c *WAFV2) ListMobileSdkReleasesRequest(input *ListMobileSdkReleasesInput) (req *request.Request, output *ListMobileSdkReleasesOutput) { - op := &request.Operation{ - Name: opListMobileSdkReleases, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListMobileSdkReleasesInput{} - } - - output = &ListMobileSdkReleasesOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListMobileSdkReleases API operation for AWS WAFV2. -// -// Retrieves a list of the available releases for the mobile SDK and the specified -// device platform. -// -// The mobile SDK is not generally available. Customers who have access to the -// mobile SDK can use it to establish and manage WAF tokens for use in HTTP(S) -// requests from a mobile device to WAF. For more information, see WAF client -// application integration (https://docs.aws.amazon.com/waf/latest/developerguide/waf-application-integration.html) -// in the WAF Developer Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation ListMobileSdkReleases for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListMobileSdkReleases -func (c *WAFV2) ListMobileSdkReleases(input *ListMobileSdkReleasesInput) (*ListMobileSdkReleasesOutput, error) { - req, out := c.ListMobileSdkReleasesRequest(input) - return out, req.Send() -} - -// ListMobileSdkReleasesWithContext is the same as ListMobileSdkReleases with the addition of -// the ability to pass a context and additional request options. -// -// See ListMobileSdkReleases for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) ListMobileSdkReleasesWithContext(ctx aws.Context, input *ListMobileSdkReleasesInput, opts ...request.Option) (*ListMobileSdkReleasesOutput, error) { - req, out := c.ListMobileSdkReleasesRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListRegexPatternSets = "ListRegexPatternSets" - -// ListRegexPatternSetsRequest generates a "aws/request.Request" representing the -// client's request for the ListRegexPatternSets operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListRegexPatternSets for more information on using the ListRegexPatternSets -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListRegexPatternSetsRequest method. -// req, resp := client.ListRegexPatternSetsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListRegexPatternSets -func (c *WAFV2) ListRegexPatternSetsRequest(input *ListRegexPatternSetsInput) (req *request.Request, output *ListRegexPatternSetsOutput) { - op := &request.Operation{ - Name: opListRegexPatternSets, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListRegexPatternSetsInput{} - } - - output = &ListRegexPatternSetsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListRegexPatternSets API operation for AWS WAFV2. -// -// Retrieves an array of RegexPatternSetSummary objects for the regex pattern -// sets that you manage. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation ListRegexPatternSets for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListRegexPatternSets -func (c *WAFV2) ListRegexPatternSets(input *ListRegexPatternSetsInput) (*ListRegexPatternSetsOutput, error) { - req, out := c.ListRegexPatternSetsRequest(input) - return out, req.Send() -} - -// ListRegexPatternSetsWithContext is the same as ListRegexPatternSets with the addition of -// the ability to pass a context and additional request options. -// -// See ListRegexPatternSets for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) ListRegexPatternSetsWithContext(ctx aws.Context, input *ListRegexPatternSetsInput, opts ...request.Option) (*ListRegexPatternSetsOutput, error) { - req, out := c.ListRegexPatternSetsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListResourcesForWebACL = "ListResourcesForWebACL" - -// ListResourcesForWebACLRequest generates a "aws/request.Request" representing the -// client's request for the ListResourcesForWebACL operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListResourcesForWebACL for more information on using the ListResourcesForWebACL -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListResourcesForWebACLRequest method. -// req, resp := client.ListResourcesForWebACLRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListResourcesForWebACL -func (c *WAFV2) ListResourcesForWebACLRequest(input *ListResourcesForWebACLInput) (req *request.Request, output *ListResourcesForWebACLOutput) { - op := &request.Operation{ - Name: opListResourcesForWebACL, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListResourcesForWebACLInput{} - } - - output = &ListResourcesForWebACLOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListResourcesForWebACL API operation for AWS WAFV2. -// -// Retrieves an array of the Amazon Resource Names (ARNs) for the regional resources -// that are associated with the specified web ACL. If you want the list of Amazon -// CloudFront resources, use the CloudFront call ListDistributionsByWebACLId. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation ListResourcesForWebACL for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListResourcesForWebACL -func (c *WAFV2) ListResourcesForWebACL(input *ListResourcesForWebACLInput) (*ListResourcesForWebACLOutput, error) { - req, out := c.ListResourcesForWebACLRequest(input) - return out, req.Send() -} - -// ListResourcesForWebACLWithContext is the same as ListResourcesForWebACL with the addition of -// the ability to pass a context and additional request options. -// -// See ListResourcesForWebACL for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) ListResourcesForWebACLWithContext(ctx aws.Context, input *ListResourcesForWebACLInput, opts ...request.Option) (*ListResourcesForWebACLOutput, error) { - req, out := c.ListResourcesForWebACLRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListRuleGroups = "ListRuleGroups" - -// ListRuleGroupsRequest generates a "aws/request.Request" representing the -// client's request for the ListRuleGroups operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListRuleGroups for more information on using the ListRuleGroups -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListRuleGroupsRequest method. -// req, resp := client.ListRuleGroupsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListRuleGroups -func (c *WAFV2) ListRuleGroupsRequest(input *ListRuleGroupsInput) (req *request.Request, output *ListRuleGroupsOutput) { - op := &request.Operation{ - Name: opListRuleGroups, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListRuleGroupsInput{} - } - - output = &ListRuleGroupsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListRuleGroups API operation for AWS WAFV2. -// -// Retrieves an array of RuleGroupSummary objects for the rule groups that you -// manage. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation ListRuleGroups for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListRuleGroups -func (c *WAFV2) ListRuleGroups(input *ListRuleGroupsInput) (*ListRuleGroupsOutput, error) { - req, out := c.ListRuleGroupsRequest(input) - return out, req.Send() -} - -// ListRuleGroupsWithContext is the same as ListRuleGroups with the addition of -// the ability to pass a context and additional request options. -// -// See ListRuleGroups for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) ListRuleGroupsWithContext(ctx aws.Context, input *ListRuleGroupsInput, opts ...request.Option) (*ListRuleGroupsOutput, error) { - req, out := c.ListRuleGroupsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListTagsForResource = "ListTagsForResource" - -// ListTagsForResourceRequest generates a "aws/request.Request" representing the -// client's request for the ListTagsForResource operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListTagsForResource for more information on using the ListTagsForResource -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListTagsForResourceRequest method. -// req, resp := client.ListTagsForResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListTagsForResource -func (c *WAFV2) ListTagsForResourceRequest(input *ListTagsForResourceInput) (req *request.Request, output *ListTagsForResourceOutput) { - op := &request.Operation{ - Name: opListTagsForResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListTagsForResourceInput{} - } - - output = &ListTagsForResourceOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListTagsForResource API operation for AWS WAFV2. -// -// Retrieves the TagInfoForResource for the specified resource. Tags are key:value -// pairs that you can use to categorize and manage your resources, for purposes -// like billing. For example, you might set the tag key to "customer" and the -// value to the customer name or ID. You can specify one or more tags to add -// to each Amazon Web Services resource, up to 50 tags for a resource. -// -// You can tag the Amazon Web Services resources that you manage through WAF: -// web ACLs, rule groups, IP sets, and regex pattern sets. You can't manage -// or view tags through the WAF console. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation ListTagsForResource for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFTagOperationException -// An error occurred during the tagging operation. Retry your request. -// -// - WAFTagOperationInternalErrorException -// WAF couldn’t perform your tagging operation because of an internal error. -// Retry your request. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListTagsForResource -func (c *WAFV2) ListTagsForResource(input *ListTagsForResourceInput) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - return out, req.Send() -} - -// ListTagsForResourceWithContext is the same as ListTagsForResource with the addition of -// the ability to pass a context and additional request options. -// -// See ListTagsForResource for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) ListTagsForResourceWithContext(ctx aws.Context, input *ListTagsForResourceInput, opts ...request.Option) (*ListTagsForResourceOutput, error) { - req, out := c.ListTagsForResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opListWebACLs = "ListWebACLs" - -// ListWebACLsRequest generates a "aws/request.Request" representing the -// client's request for the ListWebACLs operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See ListWebACLs for more information on using the ListWebACLs -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the ListWebACLsRequest method. -// req, resp := client.ListWebACLsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListWebACLs -func (c *WAFV2) ListWebACLsRequest(input *ListWebACLsInput) (req *request.Request, output *ListWebACLsOutput) { - op := &request.Operation{ - Name: opListWebACLs, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &ListWebACLsInput{} - } - - output = &ListWebACLsOutput{} - req = c.newRequest(op, input, output) - return -} - -// ListWebACLs API operation for AWS WAFV2. -// -// Retrieves an array of WebACLSummary objects for the web ACLs that you manage. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation ListWebACLs for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/ListWebACLs -func (c *WAFV2) ListWebACLs(input *ListWebACLsInput) (*ListWebACLsOutput, error) { - req, out := c.ListWebACLsRequest(input) - return out, req.Send() -} - -// ListWebACLsWithContext is the same as ListWebACLs with the addition of -// the ability to pass a context and additional request options. -// -// See ListWebACLs for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) ListWebACLsWithContext(ctx aws.Context, input *ListWebACLsInput, opts ...request.Option) (*ListWebACLsOutput, error) { - req, out := c.ListWebACLsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutLoggingConfiguration = "PutLoggingConfiguration" - -// PutLoggingConfigurationRequest generates a "aws/request.Request" representing the -// client's request for the PutLoggingConfiguration operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutLoggingConfiguration for more information on using the PutLoggingConfiguration -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutLoggingConfigurationRequest method. -// req, resp := client.PutLoggingConfigurationRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/PutLoggingConfiguration -func (c *WAFV2) PutLoggingConfigurationRequest(input *PutLoggingConfigurationInput) (req *request.Request, output *PutLoggingConfigurationOutput) { - op := &request.Operation{ - Name: opPutLoggingConfiguration, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutLoggingConfigurationInput{} - } - - output = &PutLoggingConfigurationOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutLoggingConfiguration API operation for AWS WAFV2. -// -// Enables the specified LoggingConfiguration, to start logging from a web ACL, -// according to the configuration provided. -// -// This operation completely replaces any mutable specifications that you already -// have for a logging configuration with the ones that you provide to this call. -// -// To modify an existing logging configuration, do the following: -// -// # Retrieve it by calling GetLoggingConfiguration -// -// # Update its settings as needed -// -// # Provide the complete logging configuration specification to this call -// -// You can define one logging destination per web ACL. -// -// You can access information about the traffic that WAF inspects using the -// following steps: -// -// Create your logging destination. You can use an Amazon CloudWatch Logs log -// group, an Amazon Simple Storage Service (Amazon S3) bucket, or an Amazon -// Kinesis Data Firehose. -// -// The name that you give the destination must start with aws-waf-logs-. Depending -// on the type of destination, you might need to configure additional settings -// or permissions. -// -// For configuration requirements and pricing information for each destination -// type, see Logging web ACL traffic (https://docs.aws.amazon.com/waf/latest/developerguide/logging.html) -// in the WAF Developer Guide. -// -// Associate your logging destination to your web ACL using a PutLoggingConfiguration -// request. -// -// When you successfully enable logging using a PutLoggingConfiguration request, -// WAF creates an additional role or policy that is required to write logs to -// the logging destination. For an Amazon CloudWatch Logs log group, WAF creates -// a resource policy on the log group. For an Amazon S3 bucket, WAF creates -// a bucket policy. For an Amazon Kinesis Data Firehose, WAF creates a service-linked -// role. -// -// For additional information about web ACL logging, see Logging web ACL traffic -// information (https://docs.aws.amazon.com/waf/latest/developerguide/logging.html) -// in the WAF Developer Guide. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation PutLoggingConfiguration for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFOptimisticLockException -// WAF couldn’t save your changes because you tried to update or delete a -// resource that has changed since you last retrieved it. Get the resource again, -// make any changes you need to make to the new copy, and retry your operation. -// -// - WAFServiceLinkedRoleErrorException -// WAF is not able to access the service linked role. This can be caused by -// a previous PutLoggingConfiguration request, which can lock the service linked -// role for about 20 seconds. Please try your request again. The service linked -// role can also be locked by a previous DeleteServiceLinkedRole request, which -// can lock the role for 15 minutes or more. If you recently made a call to -// DeleteServiceLinkedRole, wait at least 15 minutes and try the request again. -// If you receive this same exception again, you will have to wait additional -// time until the role is unlocked. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// - WAFLimitsExceededException -// WAF couldn’t perform the operation because you exceeded your resource limit. -// For example, the maximum number of WebACL objects that you can create for -// an Amazon Web Services account. For more information, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the WAF Developer Guide. -// -// - WAFLogDestinationPermissionIssueException -// The operation failed because you don't have the permissions that your logging -// configuration requires. For information, see Logging web ACL traffic information -// (https://docs.aws.amazon.com/waf/latest/developerguide/logging.html) in the -// WAF Developer Guide. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/PutLoggingConfiguration -func (c *WAFV2) PutLoggingConfiguration(input *PutLoggingConfigurationInput) (*PutLoggingConfigurationOutput, error) { - req, out := c.PutLoggingConfigurationRequest(input) - return out, req.Send() -} - -// PutLoggingConfigurationWithContext is the same as PutLoggingConfiguration with the addition of -// the ability to pass a context and additional request options. -// -// See PutLoggingConfiguration for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) PutLoggingConfigurationWithContext(ctx aws.Context, input *PutLoggingConfigurationInput, opts ...request.Option) (*PutLoggingConfigurationOutput, error) { - req, out := c.PutLoggingConfigurationRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutManagedRuleSetVersions = "PutManagedRuleSetVersions" - -// PutManagedRuleSetVersionsRequest generates a "aws/request.Request" representing the -// client's request for the PutManagedRuleSetVersions operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutManagedRuleSetVersions for more information on using the PutManagedRuleSetVersions -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutManagedRuleSetVersionsRequest method. -// req, resp := client.PutManagedRuleSetVersionsRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/PutManagedRuleSetVersions -func (c *WAFV2) PutManagedRuleSetVersionsRequest(input *PutManagedRuleSetVersionsInput) (req *request.Request, output *PutManagedRuleSetVersionsOutput) { - op := &request.Operation{ - Name: opPutManagedRuleSetVersions, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutManagedRuleSetVersionsInput{} - } - - output = &PutManagedRuleSetVersionsOutput{} - req = c.newRequest(op, input, output) - return -} - -// PutManagedRuleSetVersions API operation for AWS WAFV2. -// -// Defines the versions of your managed rule set that you are offering to the -// customers. Customers see your offerings as managed rule groups with versioning. -// -// This is intended for use only by vendors of managed rule sets. Vendors are -// Amazon Web Services and Amazon Web Services Marketplace sellers. -// -// Vendors, you can use the managed rule set APIs to provide controlled rollout -// of your versioned managed rule group offerings for your customers. The APIs -// are ListManagedRuleSets, GetManagedRuleSet, PutManagedRuleSetVersions, and -// UpdateManagedRuleSetVersionExpiryDate. -// -// Customers retrieve their managed rule group list by calling ListAvailableManagedRuleGroups. -// The name that you provide here for your managed rule set is the name the -// customer sees for the corresponding managed rule group. Customers can retrieve -// the available versions for a managed rule group by calling ListAvailableManagedRuleGroupVersions. -// You provide a rule group specification for each version. For each managed -// rule set, you must specify a version that you recommend using. -// -// To initiate the expiration of a managed rule group version, use UpdateManagedRuleSetVersionExpiryDate. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation PutManagedRuleSetVersions for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFOptimisticLockException -// WAF couldn’t save your changes because you tried to update or delete a -// resource that has changed since you last retrieved it. Get the resource again, -// make any changes you need to make to the new copy, and retry your operation. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/PutManagedRuleSetVersions -func (c *WAFV2) PutManagedRuleSetVersions(input *PutManagedRuleSetVersionsInput) (*PutManagedRuleSetVersionsOutput, error) { - req, out := c.PutManagedRuleSetVersionsRequest(input) - return out, req.Send() -} - -// PutManagedRuleSetVersionsWithContext is the same as PutManagedRuleSetVersions with the addition of -// the ability to pass a context and additional request options. -// -// See PutManagedRuleSetVersions for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) PutManagedRuleSetVersionsWithContext(ctx aws.Context, input *PutManagedRuleSetVersionsInput, opts ...request.Option) (*PutManagedRuleSetVersionsOutput, error) { - req, out := c.PutManagedRuleSetVersionsRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opPutPermissionPolicy = "PutPermissionPolicy" - -// PutPermissionPolicyRequest generates a "aws/request.Request" representing the -// client's request for the PutPermissionPolicy operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See PutPermissionPolicy for more information on using the PutPermissionPolicy -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the PutPermissionPolicyRequest method. -// req, resp := client.PutPermissionPolicyRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/PutPermissionPolicy -func (c *WAFV2) PutPermissionPolicyRequest(input *PutPermissionPolicyInput) (req *request.Request, output *PutPermissionPolicyOutput) { - op := &request.Operation{ - Name: opPutPermissionPolicy, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &PutPermissionPolicyInput{} - } - - output = &PutPermissionPolicyOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// PutPermissionPolicy API operation for AWS WAFV2. -// -// Attaches an IAM policy to the specified resource. Use this to share a rule -// group across accounts. -// -// You must be the owner of the rule group to perform this operation. -// -// This action is subject to the following restrictions: -// -// - You can attach only one policy with each PutPermissionPolicy request. -// -// - The ARN in the request must be a valid WAF RuleGroup ARN and the rule -// group must exist in the same Region. -// -// - The user making the request must be the owner of the rule group. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation PutPermissionPolicy for usage and error information. -// -// Returned Error Types: -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFInvalidPermissionPolicyException -// The operation failed because the specified policy isn't in the proper format. -// -// The policy specifications must conform to the following: -// -// - The policy must be composed using IAM Policy version 2012-10-17 or version -// 2015-01-01. -// -// - The policy must include specifications for Effect, Action, and Principal. -// -// - Effect must specify Allow. -// -// - Action must specify wafv2:CreateWebACL, wafv2:UpdateWebACL, and wafv2:PutFirewallManagerRuleGroups -// and may optionally specify wafv2:GetRuleGroup. WAF rejects any extra actions -// or wildcard actions in the policy. -// -// - The policy must not include a Resource parameter. -// -// For more information, see IAM Policies (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html). -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/PutPermissionPolicy -func (c *WAFV2) PutPermissionPolicy(input *PutPermissionPolicyInput) (*PutPermissionPolicyOutput, error) { - req, out := c.PutPermissionPolicyRequest(input) - return out, req.Send() -} - -// PutPermissionPolicyWithContext is the same as PutPermissionPolicy with the addition of -// the ability to pass a context and additional request options. -// -// See PutPermissionPolicy for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) PutPermissionPolicyWithContext(ctx aws.Context, input *PutPermissionPolicyInput, opts ...request.Option) (*PutPermissionPolicyOutput, error) { - req, out := c.PutPermissionPolicyRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opTagResource = "TagResource" - -// TagResourceRequest generates a "aws/request.Request" representing the -// client's request for the TagResource operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See TagResource for more information on using the TagResource -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the TagResourceRequest method. -// req, resp := client.TagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/TagResource -func (c *WAFV2) TagResourceRequest(input *TagResourceInput) (req *request.Request, output *TagResourceOutput) { - op := &request.Operation{ - Name: opTagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &TagResourceInput{} - } - - output = &TagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// TagResource API operation for AWS WAFV2. -// -// Associates tags with the specified Amazon Web Services resource. Tags are -// key:value pairs that you can use to categorize and manage your resources, -// for purposes like billing. For example, you might set the tag key to "customer" -// and the value to the customer name or ID. You can specify one or more tags -// to add to each Amazon Web Services resource, up to 50 tags for a resource. -// -// You can tag the Amazon Web Services resources that you manage through WAF: -// web ACLs, rule groups, IP sets, and regex pattern sets. You can't manage -// or view tags through the WAF console. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation TagResource for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFLimitsExceededException -// WAF couldn’t perform the operation because you exceeded your resource limit. -// For example, the maximum number of WebACL objects that you can create for -// an Amazon Web Services account. For more information, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the WAF Developer Guide. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFTagOperationException -// An error occurred during the tagging operation. Retry your request. -// -// - WAFTagOperationInternalErrorException -// WAF couldn’t perform your tagging operation because of an internal error. -// Retry your request. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/TagResource -func (c *WAFV2) TagResource(input *TagResourceInput) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - return out, req.Send() -} - -// TagResourceWithContext is the same as TagResource with the addition of -// the ability to pass a context and additional request options. -// -// See TagResource for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) TagResourceWithContext(ctx aws.Context, input *TagResourceInput, opts ...request.Option) (*TagResourceOutput, error) { - req, out := c.TagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUntagResource = "UntagResource" - -// UntagResourceRequest generates a "aws/request.Request" representing the -// client's request for the UntagResource operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UntagResource for more information on using the UntagResource -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the UntagResourceRequest method. -// req, resp := client.UntagResourceRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UntagResource -func (c *WAFV2) UntagResourceRequest(input *UntagResourceInput) (req *request.Request, output *UntagResourceOutput) { - op := &request.Operation{ - Name: opUntagResource, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UntagResourceInput{} - } - - output = &UntagResourceOutput{} - req = c.newRequest(op, input, output) - req.Handlers.Unmarshal.Swap(jsonrpc.UnmarshalHandler.Name, protocol.UnmarshalDiscardBodyHandler) - return -} - -// UntagResource API operation for AWS WAFV2. -// -// Disassociates tags from an Amazon Web Services resource. Tags are key:value -// pairs that you can associate with Amazon Web Services resources. For example, -// the tag key might be "customer" and the tag value might be "companyA." You -// can specify one or more tags to add to each container. You can add up to -// 50 tags to each Amazon Web Services resource. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation UntagResource for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFTagOperationException -// An error occurred during the tagging operation. Retry your request. -// -// - WAFTagOperationInternalErrorException -// WAF couldn’t perform your tagging operation because of an internal error. -// Retry your request. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UntagResource -func (c *WAFV2) UntagResource(input *UntagResourceInput) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - return out, req.Send() -} - -// UntagResourceWithContext is the same as UntagResource with the addition of -// the ability to pass a context and additional request options. -// -// See UntagResource for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) UntagResourceWithContext(ctx aws.Context, input *UntagResourceInput, opts ...request.Option) (*UntagResourceOutput, error) { - req, out := c.UntagResourceRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateIPSet = "UpdateIPSet" - -// UpdateIPSetRequest generates a "aws/request.Request" representing the -// client's request for the UpdateIPSet operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateIPSet for more information on using the UpdateIPSet -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the UpdateIPSetRequest method. -// req, resp := client.UpdateIPSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UpdateIPSet -func (c *WAFV2) UpdateIPSetRequest(input *UpdateIPSetInput) (req *request.Request, output *UpdateIPSetOutput) { - op := &request.Operation{ - Name: opUpdateIPSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateIPSetInput{} - } - - output = &UpdateIPSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateIPSet API operation for AWS WAFV2. -// -// Updates the specified IPSet. -// -// This operation completely replaces the mutable specifications that you already -// have for the IP set with the ones that you provide to this call. -// -// To modify an IP set, do the following: -// -// # Retrieve it by calling GetIPSet -// -// # Update its settings as needed -// -// # Provide the complete IP set specification to this call -// -// When you make changes to web ACLs or web ACL components, like rules and rule -// groups, WAF propagates the changes everywhere that the web ACL and its components -// are stored and used. Your changes are applied within seconds, but there might -// be a brief period of inconsistency when the changes have arrived in some -// places and not in others. So, for example, if you change a rule action setting, -// the action might be the old action in one area and the new action in another -// area. Or if you add an IP address to an IP set used in a blocking rule, the -// new address might briefly be blocked in one area while still allowed in another. -// This temporary inconsistency can occur when you first associate a web ACL -// with an Amazon Web Services resource and when you change a web ACL that is -// already associated with a resource. Generally, any inconsistencies of this -// type last only a few seconds. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation UpdateIPSet for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFDuplicateItemException -// WAF couldn’t perform the operation because the resource that you tried -// to save is a duplicate of an existing one. -// -// - WAFOptimisticLockException -// WAF couldn’t save your changes because you tried to update or delete a -// resource that has changed since you last retrieved it. Get the resource again, -// make any changes you need to make to the new copy, and retry your operation. -// -// - WAFLimitsExceededException -// WAF couldn’t perform the operation because you exceeded your resource limit. -// For example, the maximum number of WebACL objects that you can create for -// an Amazon Web Services account. For more information, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the WAF Developer Guide. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UpdateIPSet -func (c *WAFV2) UpdateIPSet(input *UpdateIPSetInput) (*UpdateIPSetOutput, error) { - req, out := c.UpdateIPSetRequest(input) - return out, req.Send() -} - -// UpdateIPSetWithContext is the same as UpdateIPSet with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateIPSet for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) UpdateIPSetWithContext(ctx aws.Context, input *UpdateIPSetInput, opts ...request.Option) (*UpdateIPSetOutput, error) { - req, out := c.UpdateIPSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateManagedRuleSetVersionExpiryDate = "UpdateManagedRuleSetVersionExpiryDate" - -// UpdateManagedRuleSetVersionExpiryDateRequest generates a "aws/request.Request" representing the -// client's request for the UpdateManagedRuleSetVersionExpiryDate operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateManagedRuleSetVersionExpiryDate for more information on using the UpdateManagedRuleSetVersionExpiryDate -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the UpdateManagedRuleSetVersionExpiryDateRequest method. -// req, resp := client.UpdateManagedRuleSetVersionExpiryDateRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UpdateManagedRuleSetVersionExpiryDate -func (c *WAFV2) UpdateManagedRuleSetVersionExpiryDateRequest(input *UpdateManagedRuleSetVersionExpiryDateInput) (req *request.Request, output *UpdateManagedRuleSetVersionExpiryDateOutput) { - op := &request.Operation{ - Name: opUpdateManagedRuleSetVersionExpiryDate, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateManagedRuleSetVersionExpiryDateInput{} - } - - output = &UpdateManagedRuleSetVersionExpiryDateOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateManagedRuleSetVersionExpiryDate API operation for AWS WAFV2. -// -// Updates the expiration information for your managed rule set. Use this to -// initiate the expiration of a managed rule group version. After you initiate -// expiration for a version, WAF excludes it from the response to ListAvailableManagedRuleGroupVersions -// for the managed rule group. -// -// This is intended for use only by vendors of managed rule sets. Vendors are -// Amazon Web Services and Amazon Web Services Marketplace sellers. -// -// Vendors, you can use the managed rule set APIs to provide controlled rollout -// of your versioned managed rule group offerings for your customers. The APIs -// are ListManagedRuleSets, GetManagedRuleSet, PutManagedRuleSetVersions, and -// UpdateManagedRuleSetVersionExpiryDate. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation UpdateManagedRuleSetVersionExpiryDate for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFOptimisticLockException -// WAF couldn’t save your changes because you tried to update or delete a -// resource that has changed since you last retrieved it. Get the resource again, -// make any changes you need to make to the new copy, and retry your operation. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UpdateManagedRuleSetVersionExpiryDate -func (c *WAFV2) UpdateManagedRuleSetVersionExpiryDate(input *UpdateManagedRuleSetVersionExpiryDateInput) (*UpdateManagedRuleSetVersionExpiryDateOutput, error) { - req, out := c.UpdateManagedRuleSetVersionExpiryDateRequest(input) - return out, req.Send() -} - -// UpdateManagedRuleSetVersionExpiryDateWithContext is the same as UpdateManagedRuleSetVersionExpiryDate with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateManagedRuleSetVersionExpiryDate for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) UpdateManagedRuleSetVersionExpiryDateWithContext(ctx aws.Context, input *UpdateManagedRuleSetVersionExpiryDateInput, opts ...request.Option) (*UpdateManagedRuleSetVersionExpiryDateOutput, error) { - req, out := c.UpdateManagedRuleSetVersionExpiryDateRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateRegexPatternSet = "UpdateRegexPatternSet" - -// UpdateRegexPatternSetRequest generates a "aws/request.Request" representing the -// client's request for the UpdateRegexPatternSet operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateRegexPatternSet for more information on using the UpdateRegexPatternSet -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the UpdateRegexPatternSetRequest method. -// req, resp := client.UpdateRegexPatternSetRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UpdateRegexPatternSet -func (c *WAFV2) UpdateRegexPatternSetRequest(input *UpdateRegexPatternSetInput) (req *request.Request, output *UpdateRegexPatternSetOutput) { - op := &request.Operation{ - Name: opUpdateRegexPatternSet, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateRegexPatternSetInput{} - } - - output = &UpdateRegexPatternSetOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateRegexPatternSet API operation for AWS WAFV2. -// -// Updates the specified RegexPatternSet. -// -// This operation completely replaces the mutable specifications that you already -// have for the regex pattern set with the ones that you provide to this call. -// -// To modify a regex pattern set, do the following: -// -// # Retrieve it by calling GetRegexPatternSet -// -// # Update its settings as needed -// -// # Provide the complete regex pattern set specification to this call -// -// When you make changes to web ACLs or web ACL components, like rules and rule -// groups, WAF propagates the changes everywhere that the web ACL and its components -// are stored and used. Your changes are applied within seconds, but there might -// be a brief period of inconsistency when the changes have arrived in some -// places and not in others. So, for example, if you change a rule action setting, -// the action might be the old action in one area and the new action in another -// area. Or if you add an IP address to an IP set used in a blocking rule, the -// new address might briefly be blocked in one area while still allowed in another. -// This temporary inconsistency can occur when you first associate a web ACL -// with an Amazon Web Services resource and when you change a web ACL that is -// already associated with a resource. Generally, any inconsistencies of this -// type last only a few seconds. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation UpdateRegexPatternSet for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFDuplicateItemException -// WAF couldn’t perform the operation because the resource that you tried -// to save is a duplicate of an existing one. -// -// - WAFOptimisticLockException -// WAF couldn’t save your changes because you tried to update or delete a -// resource that has changed since you last retrieved it. Get the resource again, -// make any changes you need to make to the new copy, and retry your operation. -// -// - WAFLimitsExceededException -// WAF couldn’t perform the operation because you exceeded your resource limit. -// For example, the maximum number of WebACL objects that you can create for -// an Amazon Web Services account. For more information, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the WAF Developer Guide. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UpdateRegexPatternSet -func (c *WAFV2) UpdateRegexPatternSet(input *UpdateRegexPatternSetInput) (*UpdateRegexPatternSetOutput, error) { - req, out := c.UpdateRegexPatternSetRequest(input) - return out, req.Send() -} - -// UpdateRegexPatternSetWithContext is the same as UpdateRegexPatternSet with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateRegexPatternSet for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) UpdateRegexPatternSetWithContext(ctx aws.Context, input *UpdateRegexPatternSetInput, opts ...request.Option) (*UpdateRegexPatternSetOutput, error) { - req, out := c.UpdateRegexPatternSetRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateRuleGroup = "UpdateRuleGroup" - -// UpdateRuleGroupRequest generates a "aws/request.Request" representing the -// client's request for the UpdateRuleGroup operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateRuleGroup for more information on using the UpdateRuleGroup -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the UpdateRuleGroupRequest method. -// req, resp := client.UpdateRuleGroupRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UpdateRuleGroup -func (c *WAFV2) UpdateRuleGroupRequest(input *UpdateRuleGroupInput) (req *request.Request, output *UpdateRuleGroupOutput) { - op := &request.Operation{ - Name: opUpdateRuleGroup, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateRuleGroupInput{} - } - - output = &UpdateRuleGroupOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateRuleGroup API operation for AWS WAFV2. -// -// Updates the specified RuleGroup. -// -// This operation completely replaces the mutable specifications that you already -// have for the rule group with the ones that you provide to this call. -// -// To modify a rule group, do the following: -// -// # Retrieve it by calling GetRuleGroup -// -// # Update its settings as needed -// -// # Provide the complete rule group specification to this call -// -// When you make changes to web ACLs or web ACL components, like rules and rule -// groups, WAF propagates the changes everywhere that the web ACL and its components -// are stored and used. Your changes are applied within seconds, but there might -// be a brief period of inconsistency when the changes have arrived in some -// places and not in others. So, for example, if you change a rule action setting, -// the action might be the old action in one area and the new action in another -// area. Or if you add an IP address to an IP set used in a blocking rule, the -// new address might briefly be blocked in one area while still allowed in another. -// This temporary inconsistency can occur when you first associate a web ACL -// with an Amazon Web Services resource and when you change a web ACL that is -// already associated with a resource. Generally, any inconsistencies of this -// type last only a few seconds. -// -// A rule group defines a collection of rules to inspect and control web requests -// that you can use in a WebACL. When you create a rule group, you define an -// immutable capacity limit. If you update a rule group, you must stay within -// the capacity. This allows others to reuse the rule group with confidence -// in its capacity requirements. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation UpdateRuleGroup for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFDuplicateItemException -// WAF couldn’t perform the operation because the resource that you tried -// to save is a duplicate of an existing one. -// -// - WAFOptimisticLockException -// WAF couldn’t save your changes because you tried to update or delete a -// resource that has changed since you last retrieved it. Get the resource again, -// make any changes you need to make to the new copy, and retry your operation. -// -// - WAFLimitsExceededException -// WAF couldn’t perform the operation because you exceeded your resource limit. -// For example, the maximum number of WebACL objects that you can create for -// an Amazon Web Services account. For more information, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the WAF Developer Guide. -// -// - WAFUnavailableEntityException -// WAF couldn’t retrieve a resource that you specified for this operation. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. Verify the resources that you -// are specifying in your request parameters and then retry the operation. -// -// - WAFSubscriptionNotFoundException -// You tried to use a managed rule group that's available by subscription, but -// you aren't subscribed to it yet. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// - WAFConfigurationWarningException -// The operation failed because you are inspecting the web request body, headers, -// or cookies without specifying how to handle oversize components. Rules that -// inspect the body must either provide an OversizeHandling configuration or -// they must be preceded by a SizeConstraintStatement that blocks the body content -// from being too large. Rules that inspect the headers or cookies must provide -// an OversizeHandling configuration. -// -// Provide the handling configuration and retry your operation. -// -// Alternately, you can suppress this warning by adding the following tag to -// the resource that you provide to this operation: Tag (key:WAF:OversizeFieldsHandlingConstraintOptOut, -// value:true). -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UpdateRuleGroup -func (c *WAFV2) UpdateRuleGroup(input *UpdateRuleGroupInput) (*UpdateRuleGroupOutput, error) { - req, out := c.UpdateRuleGroupRequest(input) - return out, req.Send() -} - -// UpdateRuleGroupWithContext is the same as UpdateRuleGroup with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateRuleGroup for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) UpdateRuleGroupWithContext(ctx aws.Context, input *UpdateRuleGroupInput, opts ...request.Option) (*UpdateRuleGroupOutput, error) { - req, out := c.UpdateRuleGroupRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -const opUpdateWebACL = "UpdateWebACL" - -// UpdateWebACLRequest generates a "aws/request.Request" representing the -// client's request for the UpdateWebACL operation. The "output" return -// value will be populated with the request's response once the request completes -// successfully. -// -// Use "Send" method on the returned Request to send the API call to the service. -// the "output" return value is not valid until after Send returns without error. -// -// See UpdateWebACL for more information on using the UpdateWebACL -// API call, and error handling. -// -// This method is useful when you want to inject custom logic or configuration -// into the SDK's request lifecycle. Such as custom headers, or retry logic. -// -// // Example sending a request using the UpdateWebACLRequest method. -// req, resp := client.UpdateWebACLRequest(params) -// -// err := req.Send() -// if err == nil { // resp is now filled -// fmt.Println(resp) -// } -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UpdateWebACL -func (c *WAFV2) UpdateWebACLRequest(input *UpdateWebACLInput) (req *request.Request, output *UpdateWebACLOutput) { - op := &request.Operation{ - Name: opUpdateWebACL, - HTTPMethod: "POST", - HTTPPath: "/", - } - - if input == nil { - input = &UpdateWebACLInput{} - } - - output = &UpdateWebACLOutput{} - req = c.newRequest(op, input, output) - return -} - -// UpdateWebACL API operation for AWS WAFV2. -// -// Updates the specified WebACL. While updating a web ACL, WAF provides continuous -// coverage to the resources that you have associated with the web ACL. -// -// This operation completely replaces the mutable specifications that you already -// have for the web ACL with the ones that you provide to this call. -// -// To modify a web ACL, do the following: -// -// # Retrieve it by calling GetWebACL -// -// # Update its settings as needed -// -// # Provide the complete web ACL specification to this call -// -// When you make changes to web ACLs or web ACL components, like rules and rule -// groups, WAF propagates the changes everywhere that the web ACL and its components -// are stored and used. Your changes are applied within seconds, but there might -// be a brief period of inconsistency when the changes have arrived in some -// places and not in others. So, for example, if you change a rule action setting, -// the action might be the old action in one area and the new action in another -// area. Or if you add an IP address to an IP set used in a blocking rule, the -// new address might briefly be blocked in one area while still allowed in another. -// This temporary inconsistency can occur when you first associate a web ACL -// with an Amazon Web Services resource and when you change a web ACL that is -// already associated with a resource. Generally, any inconsistencies of this -// type last only a few seconds. -// -// A web ACL defines a collection of rules to use to inspect and control web -// requests. Each rule has an action defined (allow, block, or count) for requests -// that match the statement of the rule. In the web ACL, you assign a default -// action to take (allow, block) for any request that does not match any of -// the rules. The rules in a web ACL can be a combination of the types Rule, -// RuleGroup, and managed rule group. You can associate a web ACL with one or -// more Amazon Web Services resources to protect. The resources can be an Amazon -// CloudFront distribution, an Amazon API Gateway REST API, an Application Load -// Balancer, an AppSync GraphQL API, or an Amazon Cognito user pool. -// -// Returns awserr.Error for service API and SDK errors. Use runtime type assertions -// with awserr.Error's Code and Message methods to get detailed information about -// the error. -// -// See the AWS API reference guide for AWS WAFV2's -// API operation UpdateWebACL for usage and error information. -// -// Returned Error Types: -// -// - WAFInternalErrorException -// Your request is valid, but WAF couldn’t perform the operation because of -// a system problem. Retry your request. -// -// - WAFInvalidParameterException -// The operation failed because WAF didn't recognize a parameter in the request. -// For example: -// -// - You specified a parameter name or value that isn't valid. -// -// - Your nested statement isn't valid. You might have tried to nest a statement -// that can’t be nested. -// -// - You tried to update a WebACL with a DefaultAction that isn't among the -// types available at DefaultAction. -// -// - Your request references an ARN that is malformed, or corresponds to -// a resource with which a web ACL can't be associated. -// -// - WAFNonexistentItemException -// WAF couldn’t perform the operation because your resource doesn't exist. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. -// -// - WAFDuplicateItemException -// WAF couldn’t perform the operation because the resource that you tried -// to save is a duplicate of an existing one. -// -// - WAFOptimisticLockException -// WAF couldn’t save your changes because you tried to update or delete a -// resource that has changed since you last retrieved it. Get the resource again, -// make any changes you need to make to the new copy, and retry your operation. -// -// - WAFLimitsExceededException -// WAF couldn’t perform the operation because you exceeded your resource limit. -// For example, the maximum number of WebACL objects that you can create for -// an Amazon Web Services account. For more information, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) -// in the WAF Developer Guide. -// -// - WAFInvalidResourceException -// WAF couldn’t perform the operation because the resource that you requested -// isn’t valid. Check the resource, and try again. -// -// - WAFUnavailableEntityException -// WAF couldn’t retrieve a resource that you specified for this operation. -// If you've just created a resource that you're using in this operation, you -// might just need to wait a few minutes. It can take from a few seconds to -// a number of minutes for changes to propagate. Verify the resources that you -// are specifying in your request parameters and then retry the operation. -// -// - WAFSubscriptionNotFoundException -// You tried to use a managed rule group that's available by subscription, but -// you aren't subscribed to it yet. -// -// - WAFInvalidOperationException -// The operation isn't valid. -// -// - WAFExpiredManagedRuleGroupVersionException -// The operation failed because the specified version for the managed rule group -// has expired. You can retrieve the available versions for the managed rule -// group by calling ListAvailableManagedRuleGroupVersions. -// -// - WAFConfigurationWarningException -// The operation failed because you are inspecting the web request body, headers, -// or cookies without specifying how to handle oversize components. Rules that -// inspect the body must either provide an OversizeHandling configuration or -// they must be preceded by a SizeConstraintStatement that blocks the body content -// from being too large. Rules that inspect the headers or cookies must provide -// an OversizeHandling configuration. -// -// Provide the handling configuration and retry your operation. -// -// Alternately, you can suppress this warning by adding the following tag to -// the resource that you provide to this operation: Tag (key:WAF:OversizeFieldsHandlingConstraintOptOut, -// value:true). -// -// See also, https://docs.aws.amazon.com/goto/WebAPI/wafv2-2019-07-29/UpdateWebACL -func (c *WAFV2) UpdateWebACL(input *UpdateWebACLInput) (*UpdateWebACLOutput, error) { - req, out := c.UpdateWebACLRequest(input) - return out, req.Send() -} - -// UpdateWebACLWithContext is the same as UpdateWebACL with the addition of -// the ability to pass a context and additional request options. -// -// See UpdateWebACL for details on how to use this API operation. -// -// The context must be non-nil and will be used for request cancellation. If -// the context is nil a panic will occur. In the future the SDK may create -// sub-contexts for http.Requests. See https://golang.org/pkg/context/ -// for more information on using Contexts. -func (c *WAFV2) UpdateWebACLWithContext(ctx aws.Context, input *UpdateWebACLInput, opts ...request.Option) (*UpdateWebACLOutput, error) { - req, out := c.UpdateWebACLRequest(input) - req.SetContext(ctx) - req.ApplyOptions(opts...) - return out, req.Send() -} - -// Details for your use of the Bot Control managed rule group, used in ManagedRuleGroupConfig. -type AWSManagedRulesBotControlRuleSet struct { - _ struct{} `type:"structure"` - - // The inspection level to use for the Bot Control rule group. The common level - // is the least expensive. The targeted level includes all common level rules - // and adds rules with more advanced inspection criteria. For details, see WAF - // Bot Control rule group (https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-bot.html). - // - // InspectionLevel is a required field - InspectionLevel *string `type:"string" required:"true" enum:"InspectionLevel"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AWSManagedRulesBotControlRuleSet) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AWSManagedRulesBotControlRuleSet) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AWSManagedRulesBotControlRuleSet) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AWSManagedRulesBotControlRuleSet"} - if s.InspectionLevel == nil { - invalidParams.Add(request.NewErrParamRequired("InspectionLevel")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInspectionLevel sets the InspectionLevel field's value. -func (s *AWSManagedRulesBotControlRuleSet) SetInspectionLevel(v string) *AWSManagedRulesBotControlRuleSet { - s.InspectionLevel = &v - return s -} - -// A single action condition for a Condition in a logging filter. -type ActionCondition struct { - _ struct{} `type:"structure"` - - // The action setting that a log record must contain in order to meet the condition. - // This is the action that WAF applied to the web request. - // - // For rule groups, this is either the configured rule action setting, or if - // you've applied a rule action override to the rule, it's the override action. - // The value EXCLUDED_AS_COUNT matches on excluded rules and also on rules that - // have a rule action override of Count. - // - // Action is a required field - Action *string `type:"string" required:"true" enum:"ActionValue"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ActionCondition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ActionCondition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ActionCondition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ActionCondition"} - if s.Action == nil { - invalidParams.Add(request.NewErrParamRequired("Action")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAction sets the Action field's value. -func (s *ActionCondition) SetAction(v string) *ActionCondition { - s.Action = &v - return s -} - -// Inspect all of the elements that WAF has parsed and extracted from the web -// request component that you've identified in your FieldToMatch specifications. -// -// This is used only in the FieldToMatch specification for some web request -// component types. -// -// JSON specification: "All": {} -type All struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s All) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s All) GoString() string { - return s.String() -} - -// Inspect all query arguments of the web request. -// -// This is used only in the FieldToMatch specification for some web request -// component types. -// -// JSON specification: "AllQueryArguments": {} -type AllQueryArguments struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AllQueryArguments) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AllQueryArguments) GoString() string { - return s.String() -} - -// Specifies that WAF should allow the request and optionally defines additional -// custom handling for the request. -// -// This is used in the context of other settings, for example to specify values -// for RuleAction and web ACL DefaultAction. -type AllowAction struct { - _ struct{} `type:"structure"` - - // Defines custom handling for the web request. - // - // For information about customizing web requests and responses, see Customizing - // web requests and responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html) - // in the WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). - CustomRequestHandling *CustomRequestHandling `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AllowAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AllowAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AllowAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AllowAction"} - if s.CustomRequestHandling != nil { - if err := s.CustomRequestHandling.Validate(); err != nil { - invalidParams.AddNested("CustomRequestHandling", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCustomRequestHandling sets the CustomRequestHandling field's value. -func (s *AllowAction) SetCustomRequestHandling(v *CustomRequestHandling) *AllowAction { - s.CustomRequestHandling = v - return s -} - -// A logical rule statement used to combine other rule statements with AND logic. -// You provide more than one Statement within the AndStatement. -type AndStatement struct { - _ struct{} `type:"structure"` - - // The statements to combine with AND logic. You can use any statements that - // can be nested. - // - // Statements is a required field - Statements []*Statement `type:"list" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AndStatement) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AndStatement) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AndStatement) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AndStatement"} - if s.Statements == nil { - invalidParams.Add(request.NewErrParamRequired("Statements")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetStatements sets the Statements field's value. -func (s *AndStatement) SetStatements(v []*Statement) *AndStatement { - s.Statements = v - return s -} - -type AssociateWebACLInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the resource to associate with the web - // ACL. - // - // The ARN must be in one of the following formats: - // - // * For an Application Load Balancer: arn:aws:elasticloadbalancing:region:account-id:loadbalancer/app/load-balancer-name/load-balancer-id - // - // * For an Amazon API Gateway REST API: arn:aws:apigateway:region::/restapis/api-id/stages/stage-name - // - // * For an AppSync GraphQL API: arn:aws:appsync:region:account-id:apis/GraphQLApiId - // - // * For an Amazon Cognito user pool: arn:aws:cognito-idp:region:account-id:userpool/user-pool-id - // - // ResourceArn is a required field - ResourceArn *string `min:"20" type:"string" required:"true"` - - // The Amazon Resource Name (ARN) of the web ACL that you want to associate - // with the resource. - // - // WebACLArn is a required field - WebACLArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AssociateWebACLInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AssociateWebACLInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *AssociateWebACLInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "AssociateWebACLInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - if s.WebACLArn == nil { - invalidParams.Add(request.NewErrParamRequired("WebACLArn")) - } - if s.WebACLArn != nil && len(*s.WebACLArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("WebACLArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *AssociateWebACLInput) SetResourceArn(v string) *AssociateWebACLInput { - s.ResourceArn = &v - return s -} - -// SetWebACLArn sets the WebACLArn field's value. -func (s *AssociateWebACLInput) SetWebACLArn(v string) *AssociateWebACLInput { - s.WebACLArn = &v - return s -} - -type AssociateWebACLOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AssociateWebACLOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s AssociateWebACLOutput) GoString() string { - return s.String() -} - -// Specifies that WAF should block the request and optionally defines additional -// custom handling for the response to the web request. -// -// This is used in the context of other settings, for example to specify values -// for RuleAction and web ACL DefaultAction. -type BlockAction struct { - _ struct{} `type:"structure"` - - // Defines a custom response for the web request. - // - // For information about customizing web requests and responses, see Customizing - // web requests and responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html) - // in the WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). - CustomResponse *CustomResponse `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s BlockAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s BlockAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *BlockAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "BlockAction"} - if s.CustomResponse != nil { - if err := s.CustomResponse.Validate(); err != nil { - invalidParams.AddNested("CustomResponse", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCustomResponse sets the CustomResponse field's value. -func (s *BlockAction) SetCustomResponse(v *CustomResponse) *BlockAction { - s.CustomResponse = v - return s -} - -// Inspect the body of the web request. The body immediately follows the request -// headers. -// -// This is used to indicate the web request component to inspect, in the FieldToMatch -// specification. -type Body struct { - _ struct{} `type:"structure"` - - // What WAF should do if the body is larger than WAF can inspect. WAF does not - // support inspecting the entire contents of the body of a web request when - // the body exceeds 8 KB (8192 bytes). Only the first 8 KB of the request body - // are forwarded to WAF by the underlying host service. - // - // The options for oversize handling are the following: - // - // * CONTINUE - Inspect the body normally, according to the rule inspection - // criteria. - // - // * MATCH - Treat the web request as matching the rule statement. WAF applies - // the rule action to the request. - // - // * NO_MATCH - Treat the web request as not matching the rule statement. - // - // You can combine the MATCH or NO_MATCH settings for oversize handling with - // your rule and web ACL action settings, so that you block any request whose - // body is over 8 KB. - // - // Default: CONTINUE - OversizeHandling *string `type:"string" enum:"OversizeHandling"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Body) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Body) GoString() string { - return s.String() -} - -// SetOversizeHandling sets the OversizeHandling field's value. -func (s *Body) SetOversizeHandling(v string) *Body { - s.OversizeHandling = &v - return s -} - -// A rule statement that defines a string match search for WAF to apply to web -// requests. The byte match statement provides the bytes to search for, the -// location in requests that you want WAF to search, and other settings. The -// bytes to search for are typically a string that corresponds with ASCII characters. -// In the WAF console and the developer guide, this is called a string match -// statement. -type ByteMatchStatement struct { - _ struct{} `type:"structure"` - - // The part of the web request that you want WAF to inspect. - // - // FieldToMatch is a required field - FieldToMatch *FieldToMatch `type:"structure" required:"true"` - - // The area within the portion of the web request that you want WAF to search - // for SearchString. Valid values include the following: - // - // CONTAINS - // - // The specified part of the web request must include the value of SearchString, - // but the location doesn't matter. - // - // CONTAINS_WORD - // - // The specified part of the web request must include the value of SearchString, - // and SearchString must contain only alphanumeric characters or underscore - // (A-Z, a-z, 0-9, or _). In addition, SearchString must be a word, which means - // that both of the following are true: - // - // * SearchString is at the beginning of the specified part of the web request - // or is preceded by a character other than an alphanumeric character or - // underscore (_). Examples include the value of a header and ;BadBot. - // - // * SearchString is at the end of the specified part of the web request - // or is followed by a character other than an alphanumeric character or - // underscore (_), for example, BadBot; and -BadBot;. - // - // EXACTLY - // - // The value of the specified part of the web request must exactly match the - // value of SearchString. - // - // STARTS_WITH - // - // The value of SearchString must appear at the beginning of the specified part - // of the web request. - // - // ENDS_WITH - // - // The value of SearchString must appear at the end of the specified part of - // the web request. - // - // PositionalConstraint is a required field - PositionalConstraint *string `type:"string" required:"true" enum:"PositionalConstraint"` - - // A string value that you want WAF to search for. WAF searches only in the - // part of web requests that you designate for inspection in FieldToMatch. The - // maximum length of the value is 50 bytes. - // - // Valid values depend on the component that you specify for inspection in FieldToMatch: - // - // * Method: The HTTP method that you want WAF to search for. This indicates - // the type of operation specified in the request. - // - // * UriPath: The value that you want WAF to search for in the URI path, - // for example, /images/daily-ad.jpg. - // - // If SearchString includes alphabetic characters A-Z and a-z, note that the - // value is case sensitive. - // - // If you're using the WAF API - // - // Specify a base64-encoded version of the value. The maximum length of the - // value before you base64-encode it is 50 bytes. - // - // For example, suppose the value of Type is HEADER and the value of Data is - // User-Agent. If you want to search the User-Agent header for the value BadBot, - // you base64-encode BadBot using MIME base64-encoding and include the resulting - // value, QmFkQm90, in the value of SearchString. - // - // If you're using the CLI or one of the Amazon Web Services SDKs - // - // The value that you want WAF to search for. The SDK automatically base64 encodes - // the value. - // SearchString is automatically base64 encoded/decoded by the SDK. - // - // SearchString is a required field - SearchString []byte `type:"blob" required:"true"` - - // Text transformations eliminate some of the unusual formatting that attackers - // use in web requests in an effort to bypass detection. If you specify one - // or more transformations in a rule statement, WAF performs all transformations - // on the content of the request component identified by FieldToMatch, starting - // from the lowest priority setting, before inspecting the content for a match. - // - // TextTransformations is a required field - TextTransformations []*TextTransformation `min:"1" type:"list" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ByteMatchStatement) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ByteMatchStatement) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ByteMatchStatement) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ByteMatchStatement"} - if s.FieldToMatch == nil { - invalidParams.Add(request.NewErrParamRequired("FieldToMatch")) - } - if s.PositionalConstraint == nil { - invalidParams.Add(request.NewErrParamRequired("PositionalConstraint")) - } - if s.SearchString == nil { - invalidParams.Add(request.NewErrParamRequired("SearchString")) - } - if s.TextTransformations == nil { - invalidParams.Add(request.NewErrParamRequired("TextTransformations")) - } - if s.TextTransformations != nil && len(s.TextTransformations) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TextTransformations", 1)) - } - if s.FieldToMatch != nil { - if err := s.FieldToMatch.Validate(); err != nil { - invalidParams.AddNested("FieldToMatch", err.(request.ErrInvalidParams)) - } - } - if s.TextTransformations != nil { - for i, v := range s.TextTransformations { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "TextTransformations", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetFieldToMatch sets the FieldToMatch field's value. -func (s *ByteMatchStatement) SetFieldToMatch(v *FieldToMatch) *ByteMatchStatement { - s.FieldToMatch = v - return s -} - -// SetPositionalConstraint sets the PositionalConstraint field's value. -func (s *ByteMatchStatement) SetPositionalConstraint(v string) *ByteMatchStatement { - s.PositionalConstraint = &v - return s -} - -// SetSearchString sets the SearchString field's value. -func (s *ByteMatchStatement) SetSearchString(v []byte) *ByteMatchStatement { - s.SearchString = v - return s -} - -// SetTextTransformations sets the TextTransformations field's value. -func (s *ByteMatchStatement) SetTextTransformations(v []*TextTransformation) *ByteMatchStatement { - s.TextTransformations = v - return s -} - -// Specifies that WAF should run a CAPTCHA check against the request: -// -// - If the request includes a valid, unexpired CAPTCHA token, WAF applies -// any custom request handling and labels that you've configured and then -// allows the web request inspection to proceed to the next rule, similar -// to a CountAction. -// -// - If the request doesn't include a valid, unexpired token, WAF discontinues -// the web ACL evaluation of the request and blocks it from going to its -// intended destination. WAF generates a response that it sends back to the -// client, which includes the following: The header x-amzn-waf-action with -// a value of captcha. The HTTP status code 405 Method Not Allowed. If the -// request contains an Accept header with a value of text/html, the response -// includes a CAPTCHA JavaScript page interstitial. -// -// You can configure the expiration time in the CaptchaConfig ImmunityTimeProperty -// setting at the rule and web ACL level. The rule setting overrides the web -// ACL setting. -// -// This action option is available for rules. It isn't available for web ACL -// default actions. -type CaptchaAction struct { - _ struct{} `type:"structure"` - - // Defines custom handling for the web request, used when the CAPTCHA inspection - // determines that the request's token is valid and unexpired. - // - // For information about customizing web requests and responses, see Customizing - // web requests and responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html) - // in the WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). - CustomRequestHandling *CustomRequestHandling `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CaptchaAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CaptchaAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CaptchaAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CaptchaAction"} - if s.CustomRequestHandling != nil { - if err := s.CustomRequestHandling.Validate(); err != nil { - invalidParams.AddNested("CustomRequestHandling", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCustomRequestHandling sets the CustomRequestHandling field's value. -func (s *CaptchaAction) SetCustomRequestHandling(v *CustomRequestHandling) *CaptchaAction { - s.CustomRequestHandling = v - return s -} - -// Specifies how WAF should handle CAPTCHA evaluations. This is available at -// the web ACL level and in each rule. -type CaptchaConfig struct { - _ struct{} `type:"structure"` - - // Determines how long a CAPTCHA timestamp in the token remains valid after - // the client successfully solves a CAPTCHA puzzle. - ImmunityTimeProperty *ImmunityTimeProperty `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CaptchaConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CaptchaConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CaptchaConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CaptchaConfig"} - if s.ImmunityTimeProperty != nil { - if err := s.ImmunityTimeProperty.Validate(); err != nil { - invalidParams.AddNested("ImmunityTimeProperty", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetImmunityTimeProperty sets the ImmunityTimeProperty field's value. -func (s *CaptchaConfig) SetImmunityTimeProperty(v *ImmunityTimeProperty) *CaptchaConfig { - s.ImmunityTimeProperty = v - return s -} - -// The result from the inspection of the web request for a valid CAPTCHA token. -type CaptchaResponse struct { - _ struct{} `type:"structure"` - - // The reason for failure, populated when the evaluation of the token fails. - FailureReason *string `type:"string" enum:"FailureReason"` - - // The HTTP response code indicating the status of the CAPTCHA token in the - // web request. If the token is missing, invalid, or expired, this code is 405 - // Method Not Allowed. - ResponseCode *int64 `type:"integer"` - - // The time that the CAPTCHA was last solved for the supplied token. - SolveTimestamp *int64 `type:"long"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CaptchaResponse) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CaptchaResponse) GoString() string { - return s.String() -} - -// SetFailureReason sets the FailureReason field's value. -func (s *CaptchaResponse) SetFailureReason(v string) *CaptchaResponse { - s.FailureReason = &v - return s -} - -// SetResponseCode sets the ResponseCode field's value. -func (s *CaptchaResponse) SetResponseCode(v int64) *CaptchaResponse { - s.ResponseCode = &v - return s -} - -// SetSolveTimestamp sets the SolveTimestamp field's value. -func (s *CaptchaResponse) SetSolveTimestamp(v int64) *CaptchaResponse { - s.SolveTimestamp = &v - return s -} - -// Specifies that WAF should run a Challenge check against the request to verify -// that the request is coming from a legitimate client session: -// -// - If the request includes a valid, unexpired challenge token, WAF applies -// any custom request handling and labels that you've configured and then -// allows the web request inspection to proceed to the next rule, similar -// to a CountAction. -// -// - If the request doesn't include a valid, unexpired challenge token, WAF -// discontinues the web ACL evaluation of the request and blocks it from -// going to its intended destination. WAF then generates a challenge response -// that it sends back to the client, which includes the following: The header -// x-amzn-waf-action with a value of challenge. The HTTP status code 202 -// Request Accepted. If the request contains an Accept header with a value -// of text/html, the response includes a JavaScript page interstitial with -// a challenge script. Challenges run silent browser interrogations in the -// background, and don't generally affect the end user experience. A challenge -// enforces token acquisition using an interstitial JavaScript challenge -// that inspects the client session for legitimate behavior. The challenge -// blocks bots or at least increases the cost of operating sophisticated -// bots. After the client session successfully responds to the challenge, -// it receives a new token from WAF, which the challenge script uses to resubmit -// the original request. -// -// You can configure the expiration time in the ChallengeConfig ImmunityTimeProperty -// setting at the rule and web ACL level. The rule setting overrides the web -// ACL setting. -// -// This action option is available for rules. It isn't available for web ACL -// default actions. -type ChallengeAction struct { - _ struct{} `type:"structure"` - - // Defines custom handling for the web request, used when the challenge inspection - // determines that the request's token is valid and unexpired. - // - // For information about customizing web requests and responses, see Customizing - // web requests and responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html) - // in the WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). - CustomRequestHandling *CustomRequestHandling `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ChallengeAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ChallengeAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ChallengeAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ChallengeAction"} - if s.CustomRequestHandling != nil { - if err := s.CustomRequestHandling.Validate(); err != nil { - invalidParams.AddNested("CustomRequestHandling", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCustomRequestHandling sets the CustomRequestHandling field's value. -func (s *ChallengeAction) SetCustomRequestHandling(v *CustomRequestHandling) *ChallengeAction { - s.CustomRequestHandling = v - return s -} - -// Specifies how WAF should handle Challenge evaluations. This is available -// at the web ACL level and in each rule. -type ChallengeConfig struct { - _ struct{} `type:"structure"` - - // Determines how long a challenge timestamp in the token remains valid after - // the client successfully responds to a challenge. - ImmunityTimeProperty *ImmunityTimeProperty `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ChallengeConfig) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ChallengeConfig) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *ChallengeConfig) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "ChallengeConfig"} - if s.ImmunityTimeProperty != nil { - if err := s.ImmunityTimeProperty.Validate(); err != nil { - invalidParams.AddNested("ImmunityTimeProperty", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetImmunityTimeProperty sets the ImmunityTimeProperty field's value. -func (s *ChallengeConfig) SetImmunityTimeProperty(v *ImmunityTimeProperty) *ChallengeConfig { - s.ImmunityTimeProperty = v - return s -} - -// The result from the inspection of the web request for a valid challenge token. -type ChallengeResponse struct { - _ struct{} `type:"structure"` - - // The reason for failure, populated when the evaluation of the token fails. - FailureReason *string `type:"string" enum:"FailureReason"` - - // The HTTP response code indicating the status of the challenge token in the - // web request. If the token is missing, invalid, or expired, this code is 202 - // Request Accepted. - ResponseCode *int64 `type:"integer"` - - // The time that the challenge was last solved for the supplied token. - SolveTimestamp *int64 `type:"long"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ChallengeResponse) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s ChallengeResponse) GoString() string { - return s.String() -} - -// SetFailureReason sets the FailureReason field's value. -func (s *ChallengeResponse) SetFailureReason(v string) *ChallengeResponse { - s.FailureReason = &v - return s -} - -// SetResponseCode sets the ResponseCode field's value. -func (s *ChallengeResponse) SetResponseCode(v int64) *ChallengeResponse { - s.ResponseCode = &v - return s -} - -// SetSolveTimestamp sets the SolveTimestamp field's value. -func (s *ChallengeResponse) SetSolveTimestamp(v int64) *ChallengeResponse { - s.SolveTimestamp = &v - return s -} - -type CheckCapacityInput struct { - _ struct{} `type:"structure"` - - // An array of Rule that you're configuring to use in a rule group or web ACL. - // - // Rules is a required field - Rules []*Rule `type:"list" required:"true"` - - // Specifies whether this is for an Amazon CloudFront distribution or for a - // regional application. A regional application can be an Application Load Balancer - // (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, or an Amazon - // Cognito user pool. - // - // To work with CloudFront, you must also specify the Region US East (N. Virginia) - // as follows: - // - // * CLI - Specify the Region when you use the CloudFront scope: --scope=CLOUDFRONT - // --region=us-east-1. - // - // * API and SDKs - For all calls, use the Region endpoint us-east-1. - // - // Scope is a required field - Scope *string `type:"string" required:"true" enum:"Scope"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CheckCapacityInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CheckCapacityInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CheckCapacityInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CheckCapacityInput"} - if s.Rules == nil { - invalidParams.Add(request.NewErrParamRequired("Rules")) - } - if s.Scope == nil { - invalidParams.Add(request.NewErrParamRequired("Scope")) - } - if s.Rules != nil { - for i, v := range s.Rules { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetRules sets the Rules field's value. -func (s *CheckCapacityInput) SetRules(v []*Rule) *CheckCapacityInput { - s.Rules = v - return s -} - -// SetScope sets the Scope field's value. -func (s *CheckCapacityInput) SetScope(v string) *CheckCapacityInput { - s.Scope = &v - return s -} - -type CheckCapacityOutput struct { - _ struct{} `type:"structure"` - - // The capacity required by the rules and scope. - Capacity *int64 `type:"long"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CheckCapacityOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CheckCapacityOutput) GoString() string { - return s.String() -} - -// SetCapacity sets the Capacity field's value. -func (s *CheckCapacityOutput) SetCapacity(v int64) *CheckCapacityOutput { - s.Capacity = &v - return s -} - -// A single match condition for a Filter. -type Condition struct { - _ struct{} `type:"structure"` - - // A single action condition. This is the action setting that a log record must - // contain in order to meet the condition. - ActionCondition *ActionCondition `type:"structure"` - - // A single label name condition. This is the fully qualified label name that - // a log record must contain in order to meet the condition. Fully qualified - // labels have a prefix, optional namespaces, and label name. The prefix identifies - // the rule group or web ACL context of the rule that added the label. - LabelNameCondition *LabelNameCondition `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Condition) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Condition) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Condition) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Condition"} - if s.ActionCondition != nil { - if err := s.ActionCondition.Validate(); err != nil { - invalidParams.AddNested("ActionCondition", err.(request.ErrInvalidParams)) - } - } - if s.LabelNameCondition != nil { - if err := s.LabelNameCondition.Validate(); err != nil { - invalidParams.AddNested("LabelNameCondition", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetActionCondition sets the ActionCondition field's value. -func (s *Condition) SetActionCondition(v *ActionCondition) *Condition { - s.ActionCondition = v - return s -} - -// SetLabelNameCondition sets the LabelNameCondition field's value. -func (s *Condition) SetLabelNameCondition(v *LabelNameCondition) *Condition { - s.LabelNameCondition = v - return s -} - -// The filter to use to identify the subset of cookies to inspect in a web request. -// -// You must specify exactly one setting: either All, IncludedCookies, or ExcludedCookies. -// -// Example JSON: "MatchPattern": { "IncludedCookies": {"KeyToInclude1", "KeyToInclude2", -// "KeyToInclude3"} } -type CookieMatchPattern struct { - _ struct{} `type:"structure"` - - // Inspect all cookies. - All *All `type:"structure"` - - // Inspect only the cookies whose keys don't match any of the strings specified - // here. - ExcludedCookies []*string `min:"1" type:"list"` - - // Inspect only the cookies that have a key that matches one of the strings - // specified here. - IncludedCookies []*string `min:"1" type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CookieMatchPattern) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CookieMatchPattern) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CookieMatchPattern) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CookieMatchPattern"} - if s.ExcludedCookies != nil && len(s.ExcludedCookies) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ExcludedCookies", 1)) - } - if s.IncludedCookies != nil && len(s.IncludedCookies) < 1 { - invalidParams.Add(request.NewErrParamMinLen("IncludedCookies", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAll sets the All field's value. -func (s *CookieMatchPattern) SetAll(v *All) *CookieMatchPattern { - s.All = v - return s -} - -// SetExcludedCookies sets the ExcludedCookies field's value. -func (s *CookieMatchPattern) SetExcludedCookies(v []*string) *CookieMatchPattern { - s.ExcludedCookies = v - return s -} - -// SetIncludedCookies sets the IncludedCookies field's value. -func (s *CookieMatchPattern) SetIncludedCookies(v []*string) *CookieMatchPattern { - s.IncludedCookies = v - return s -} - -// Inspect the cookies in the web request. You can specify the parts of the -// cookies to inspect and you can narrow the set of cookies to inspect by including -// or excluding specific keys. -// -// This is used to indicate the web request component to inspect, in the FieldToMatch -// specification. -// -// Example JSON: "Cookies": { "MatchPattern": { "All": {} }, "MatchScope": "KEY", -// "OversizeHandling": "MATCH" } -type Cookies struct { - _ struct{} `type:"structure"` - - // The filter to use to identify the subset of cookies to inspect in a web request. - // - // You must specify exactly one setting: either All, IncludedCookies, or ExcludedCookies. - // - // Example JSON: "MatchPattern": { "IncludedCookies": {"KeyToInclude1", "KeyToInclude2", - // "KeyToInclude3"} } - // - // MatchPattern is a required field - MatchPattern *CookieMatchPattern `type:"structure" required:"true"` - - // The parts of the cookies to inspect with the rule inspection criteria. If - // you specify All, WAF inspects both keys and values. - // - // MatchScope is a required field - MatchScope *string `type:"string" required:"true" enum:"MapMatchScope"` - - // What WAF should do if the cookies of the request are larger than WAF can - // inspect. WAF does not support inspecting the entire contents of request cookies - // when they exceed 8 KB (8192 bytes) or 200 total cookies. The underlying host - // service forwards a maximum of 200 cookies and at most 8 KB of cookie contents - // to WAF. - // - // The options for oversize handling are the following: - // - // * CONTINUE - Inspect the cookies normally, according to the rule inspection - // criteria. - // - // * MATCH - Treat the web request as matching the rule statement. WAF applies - // the rule action to the request. - // - // * NO_MATCH - Treat the web request as not matching the rule statement. - // - // OversizeHandling is a required field - OversizeHandling *string `type:"string" required:"true" enum:"OversizeHandling"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Cookies) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s Cookies) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *Cookies) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "Cookies"} - if s.MatchPattern == nil { - invalidParams.Add(request.NewErrParamRequired("MatchPattern")) - } - if s.MatchScope == nil { - invalidParams.Add(request.NewErrParamRequired("MatchScope")) - } - if s.OversizeHandling == nil { - invalidParams.Add(request.NewErrParamRequired("OversizeHandling")) - } - if s.MatchPattern != nil { - if err := s.MatchPattern.Validate(); err != nil { - invalidParams.AddNested("MatchPattern", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetMatchPattern sets the MatchPattern field's value. -func (s *Cookies) SetMatchPattern(v *CookieMatchPattern) *Cookies { - s.MatchPattern = v - return s -} - -// SetMatchScope sets the MatchScope field's value. -func (s *Cookies) SetMatchScope(v string) *Cookies { - s.MatchScope = &v - return s -} - -// SetOversizeHandling sets the OversizeHandling field's value. -func (s *Cookies) SetOversizeHandling(v string) *Cookies { - s.OversizeHandling = &v - return s -} - -// Specifies that WAF should count the request. Optionally defines additional -// custom handling for the request. -// -// This is used in the context of other settings, for example to specify values -// for RuleAction and web ACL DefaultAction. -type CountAction struct { - _ struct{} `type:"structure"` - - // Defines custom handling for the web request. - // - // For information about customizing web requests and responses, see Customizing - // web requests and responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html) - // in the WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). - CustomRequestHandling *CustomRequestHandling `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CountAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CountAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CountAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CountAction"} - if s.CustomRequestHandling != nil { - if err := s.CustomRequestHandling.Validate(); err != nil { - invalidParams.AddNested("CustomRequestHandling", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCustomRequestHandling sets the CustomRequestHandling field's value. -func (s *CountAction) SetCustomRequestHandling(v *CustomRequestHandling) *CountAction { - s.CustomRequestHandling = v - return s -} - -type CreateIPSetInput struct { - _ struct{} `type:"structure"` - - // Contains an array of strings that specifies zero or more IP addresses or - // blocks of IP addresses. All addresses must be specified using Classless Inter-Domain - // Routing (CIDR) notation. WAF supports all IPv4 and IPv6 CIDR ranges except - // for /0. - // - // Example address strings: - // - // * To configure WAF to allow, block, or count requests that originated - // from the IP address 192.0.2.44, specify 192.0.2.44/32. - // - // * To configure WAF to allow, block, or count requests that originated - // from IP addresses from 192.0.2.0 to 192.0.2.255, specify 192.0.2.0/24. - // - // * To configure WAF to allow, block, or count requests that originated - // from the IP address 1111:0000:0000:0000:0000:0000:0000:0111, specify 1111:0000:0000:0000:0000:0000:0000:0111/128. - // - // * To configure WAF to allow, block, or count requests that originated - // from IP addresses 1111:0000:0000:0000:0000:0000:0000:0000 to 1111:0000:0000:0000:ffff:ffff:ffff:ffff, - // specify 1111:0000:0000:0000:0000:0000:0000:0000/64. - // - // For more information about CIDR notation, see the Wikipedia entry Classless - // Inter-Domain Routing (https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing). - // - // Example JSON Addresses specifications: - // - // * Empty array: "Addresses": [] - // - // * Array with one address: "Addresses": ["192.0.2.44/32"] - // - // * Array with three addresses: "Addresses": ["192.0.2.44/32", "192.0.2.0/24", - // "192.0.0.0/16"] - // - // * INVALID specification: "Addresses": [""] INVALID - // - // Addresses is a required field - Addresses []*string `type:"list" required:"true"` - - // A description of the IP set that helps with identification. - Description *string `min:"1" type:"string"` - - // The version of the IP addresses, either IPV4 or IPV6. - // - // IPAddressVersion is a required field - IPAddressVersion *string `type:"string" required:"true" enum:"IPAddressVersion"` - - // The name of the IP set. You cannot change the name of an IPSet after you - // create it. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // Specifies whether this is for an Amazon CloudFront distribution or for a - // regional application. A regional application can be an Application Load Balancer - // (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, or an Amazon - // Cognito user pool. - // - // To work with CloudFront, you must also specify the Region US East (N. Virginia) - // as follows: - // - // * CLI - Specify the Region when you use the CloudFront scope: --scope=CLOUDFRONT - // --region=us-east-1. - // - // * API and SDKs - For all calls, use the Region endpoint us-east-1. - // - // Scope is a required field - Scope *string `type:"string" required:"true" enum:"Scope"` - - // An array of key:value pairs to associate with the resource. - Tags []*Tag `min:"1" type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateIPSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateIPSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateIPSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateIPSetInput"} - if s.Addresses == nil { - invalidParams.Add(request.NewErrParamRequired("Addresses")) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.IPAddressVersion == nil { - invalidParams.Add(request.NewErrParamRequired("IPAddressVersion")) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Scope == nil { - invalidParams.Add(request.NewErrParamRequired("Scope")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAddresses sets the Addresses field's value. -func (s *CreateIPSetInput) SetAddresses(v []*string) *CreateIPSetInput { - s.Addresses = v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateIPSetInput) SetDescription(v string) *CreateIPSetInput { - s.Description = &v - return s -} - -// SetIPAddressVersion sets the IPAddressVersion field's value. -func (s *CreateIPSetInput) SetIPAddressVersion(v string) *CreateIPSetInput { - s.IPAddressVersion = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateIPSetInput) SetName(v string) *CreateIPSetInput { - s.Name = &v - return s -} - -// SetScope sets the Scope field's value. -func (s *CreateIPSetInput) SetScope(v string) *CreateIPSetInput { - s.Scope = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateIPSetInput) SetTags(v []*Tag) *CreateIPSetInput { - s.Tags = v - return s -} - -type CreateIPSetOutput struct { - _ struct{} `type:"structure"` - - // High-level information about an IPSet, returned by operations like create - // and list. This provides information like the ID, that you can use to retrieve - // and manage an IPSet, and the ARN, that you provide to the IPSetReferenceStatement - // to use the address set in a Rule. - Summary *IPSetSummary `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateIPSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateIPSetOutput) GoString() string { - return s.String() -} - -// SetSummary sets the Summary field's value. -func (s *CreateIPSetOutput) SetSummary(v *IPSetSummary) *CreateIPSetOutput { - s.Summary = v - return s -} - -type CreateRegexPatternSetInput struct { - _ struct{} `type:"structure"` - - // A description of the set that helps with identification. - Description *string `min:"1" type:"string"` - - // The name of the set. You cannot change the name after you create the set. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // Array of regular expression strings. - // - // RegularExpressionList is a required field - RegularExpressionList []*Regex `type:"list" required:"true"` - - // Specifies whether this is for an Amazon CloudFront distribution or for a - // regional application. A regional application can be an Application Load Balancer - // (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, or an Amazon - // Cognito user pool. - // - // To work with CloudFront, you must also specify the Region US East (N. Virginia) - // as follows: - // - // * CLI - Specify the Region when you use the CloudFront scope: --scope=CLOUDFRONT - // --region=us-east-1. - // - // * API and SDKs - For all calls, use the Region endpoint us-east-1. - // - // Scope is a required field - Scope *string `type:"string" required:"true" enum:"Scope"` - - // An array of key:value pairs to associate with the resource. - Tags []*Tag `min:"1" type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateRegexPatternSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateRegexPatternSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateRegexPatternSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateRegexPatternSetInput"} - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.RegularExpressionList == nil { - invalidParams.Add(request.NewErrParamRequired("RegularExpressionList")) - } - if s.Scope == nil { - invalidParams.Add(request.NewErrParamRequired("Scope")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - if s.RegularExpressionList != nil { - for i, v := range s.RegularExpressionList { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "RegularExpressionList", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetDescription sets the Description field's value. -func (s *CreateRegexPatternSetInput) SetDescription(v string) *CreateRegexPatternSetInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateRegexPatternSetInput) SetName(v string) *CreateRegexPatternSetInput { - s.Name = &v - return s -} - -// SetRegularExpressionList sets the RegularExpressionList field's value. -func (s *CreateRegexPatternSetInput) SetRegularExpressionList(v []*Regex) *CreateRegexPatternSetInput { - s.RegularExpressionList = v - return s -} - -// SetScope sets the Scope field's value. -func (s *CreateRegexPatternSetInput) SetScope(v string) *CreateRegexPatternSetInput { - s.Scope = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateRegexPatternSetInput) SetTags(v []*Tag) *CreateRegexPatternSetInput { - s.Tags = v - return s -} - -type CreateRegexPatternSetOutput struct { - _ struct{} `type:"structure"` - - // High-level information about a RegexPatternSet, returned by operations like - // create and list. This provides information like the ID, that you can use - // to retrieve and manage a RegexPatternSet, and the ARN, that you provide to - // the RegexPatternSetReferenceStatement to use the pattern set in a Rule. - Summary *RegexPatternSetSummary `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateRegexPatternSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateRegexPatternSetOutput) GoString() string { - return s.String() -} - -// SetSummary sets the Summary field's value. -func (s *CreateRegexPatternSetOutput) SetSummary(v *RegexPatternSetSummary) *CreateRegexPatternSetOutput { - s.Summary = v - return s -} - -type CreateRuleGroupInput struct { - _ struct{} `type:"structure"` - - // The web ACL capacity units (WCUs) required for this rule group. - // - // When you create your own rule group, you define this, and you cannot change - // it after creation. When you add or modify the rules in a rule group, WAF - // enforces this limit. You can check the capacity for a set of rules using - // CheckCapacity. - // - // WAF uses WCUs to calculate and control the operating resources that are used - // to run your rules, rule groups, and web ACLs. WAF calculates capacity differently - // for each rule type, to reflect the relative cost of each rule. Simple rules - // that cost little to run use fewer WCUs than more complex rules that use more - // processing power. Rule group capacity is fixed at creation, which helps users - // plan their web ACL WCU usage when they use a rule group. The WCU limit for - // web ACLs is 1,500. - // - // Capacity is a required field - Capacity *int64 `min:"1" type:"long" required:"true"` - - // A map of custom response keys and content bodies. When you create a rule - // with a block action, you can send a custom response to the web request. You - // define these for the rule group, and then use them in the rules that you - // define in the rule group. - // - // For information about customizing web requests and responses, see Customizing - // web requests and responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html) - // in the WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). - // - // For information about the limits on count and size for custom request and - // response settings, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) - // in the WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). - CustomResponseBodies map[string]*CustomResponseBody `min:"1" type:"map"` - - // A description of the rule group that helps with identification. - Description *string `min:"1" type:"string"` - - // The name of the rule group. You cannot change the name of a rule group after - // you create it. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // The Rule statements used to identify the web requests that you want to allow, - // block, or count. Each rule includes one top-level statement that WAF uses - // to identify matching web requests, and parameters that govern how WAF handles - // them. - Rules []*Rule `type:"list"` - - // Specifies whether this is for an Amazon CloudFront distribution or for a - // regional application. A regional application can be an Application Load Balancer - // (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, or an Amazon - // Cognito user pool. - // - // To work with CloudFront, you must also specify the Region US East (N. Virginia) - // as follows: - // - // * CLI - Specify the Region when you use the CloudFront scope: --scope=CLOUDFRONT - // --region=us-east-1. - // - // * API and SDKs - For all calls, use the Region endpoint us-east-1. - // - // Scope is a required field - Scope *string `type:"string" required:"true" enum:"Scope"` - - // An array of key:value pairs to associate with the resource. - Tags []*Tag `min:"1" type:"list"` - - // Defines and enables Amazon CloudWatch metrics and web request sample collection. - // - // VisibilityConfig is a required field - VisibilityConfig *VisibilityConfig `type:"structure" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateRuleGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateRuleGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateRuleGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateRuleGroupInput"} - if s.Capacity == nil { - invalidParams.Add(request.NewErrParamRequired("Capacity")) - } - if s.Capacity != nil && *s.Capacity < 1 { - invalidParams.Add(request.NewErrParamMinValue("Capacity", 1)) - } - if s.CustomResponseBodies != nil && len(s.CustomResponseBodies) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CustomResponseBodies", 1)) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Scope == nil { - invalidParams.Add(request.NewErrParamRequired("Scope")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - if s.VisibilityConfig == nil { - invalidParams.Add(request.NewErrParamRequired("VisibilityConfig")) - } - if s.CustomResponseBodies != nil { - for i, v := range s.CustomResponseBodies { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CustomResponseBodies", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Rules != nil { - for i, v := range s.Rules { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - if s.VisibilityConfig != nil { - if err := s.VisibilityConfig.Validate(); err != nil { - invalidParams.AddNested("VisibilityConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCapacity sets the Capacity field's value. -func (s *CreateRuleGroupInput) SetCapacity(v int64) *CreateRuleGroupInput { - s.Capacity = &v - return s -} - -// SetCustomResponseBodies sets the CustomResponseBodies field's value. -func (s *CreateRuleGroupInput) SetCustomResponseBodies(v map[string]*CustomResponseBody) *CreateRuleGroupInput { - s.CustomResponseBodies = v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateRuleGroupInput) SetDescription(v string) *CreateRuleGroupInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateRuleGroupInput) SetName(v string) *CreateRuleGroupInput { - s.Name = &v - return s -} - -// SetRules sets the Rules field's value. -func (s *CreateRuleGroupInput) SetRules(v []*Rule) *CreateRuleGroupInput { - s.Rules = v - return s -} - -// SetScope sets the Scope field's value. -func (s *CreateRuleGroupInput) SetScope(v string) *CreateRuleGroupInput { - s.Scope = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateRuleGroupInput) SetTags(v []*Tag) *CreateRuleGroupInput { - s.Tags = v - return s -} - -// SetVisibilityConfig sets the VisibilityConfig field's value. -func (s *CreateRuleGroupInput) SetVisibilityConfig(v *VisibilityConfig) *CreateRuleGroupInput { - s.VisibilityConfig = v - return s -} - -type CreateRuleGroupOutput struct { - _ struct{} `type:"structure"` - - // High-level information about a RuleGroup, returned by operations like create - // and list. This provides information like the ID, that you can use to retrieve - // and manage a RuleGroup, and the ARN, that you provide to the RuleGroupReferenceStatement - // to use the rule group in a Rule. - Summary *RuleGroupSummary `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateRuleGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateRuleGroupOutput) GoString() string { - return s.String() -} - -// SetSummary sets the Summary field's value. -func (s *CreateRuleGroupOutput) SetSummary(v *RuleGroupSummary) *CreateRuleGroupOutput { - s.Summary = v - return s -} - -type CreateWebACLInput struct { - _ struct{} `type:"structure"` - - // Specifies how WAF should handle CAPTCHA evaluations for rules that don't - // have their own CaptchaConfig settings. If you don't specify this, WAF uses - // its default settings for CaptchaConfig. - CaptchaConfig *CaptchaConfig `type:"structure"` - - // Specifies how WAF should handle challenge evaluations for rules that don't - // have their own ChallengeConfig settings. If you don't specify this, WAF uses - // its default settings for ChallengeConfig. - ChallengeConfig *ChallengeConfig `type:"structure"` - - // A map of custom response keys and content bodies. When you create a rule - // with a block action, you can send a custom response to the web request. You - // define these for the web ACL, and then use them in the rules and default - // actions that you define in the web ACL. - // - // For information about customizing web requests and responses, see Customizing - // web requests and responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html) - // in the WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). - // - // For information about the limits on count and size for custom request and - // response settings, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) - // in the WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). - CustomResponseBodies map[string]*CustomResponseBody `min:"1" type:"map"` - - // The action to perform if none of the Rules contained in the WebACL match. - // - // DefaultAction is a required field - DefaultAction *DefaultAction `type:"structure" required:"true"` - - // A description of the web ACL that helps with identification. - Description *string `min:"1" type:"string"` - - // The name of the web ACL. You cannot change the name of a web ACL after you - // create it. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // The Rule statements used to identify the web requests that you want to allow, - // block, or count. Each rule includes one top-level statement that WAF uses - // to identify matching web requests, and parameters that govern how WAF handles - // them. - Rules []*Rule `type:"list"` - - // Specifies whether this is for an Amazon CloudFront distribution or for a - // regional application. A regional application can be an Application Load Balancer - // (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, or an Amazon - // Cognito user pool. - // - // To work with CloudFront, you must also specify the Region US East (N. Virginia) - // as follows: - // - // * CLI - Specify the Region when you use the CloudFront scope: --scope=CLOUDFRONT - // --region=us-east-1. - // - // * API and SDKs - For all calls, use the Region endpoint us-east-1. - // - // Scope is a required field - Scope *string `type:"string" required:"true" enum:"Scope"` - - // An array of key:value pairs to associate with the resource. - Tags []*Tag `min:"1" type:"list"` - - // Specifies the domains that WAF should accept in a web request token. This - // enables the use of tokens across multiple protected websites. When WAF provides - // a token, it uses the domain of the Amazon Web Services resource that the - // web ACL is protecting. If you don't specify a list of token domains, WAF - // accepts tokens only for the domain of the protected resource. With a token - // domain list, WAF accepts the resource's host domain plus all domains in the - // token domain list, including their prefixed subdomains. - // - // Example JSON: "TokenDomains": { "mywebsite.com", "myotherwebsite.com" } - // - // Public suffixes aren't allowed. For example, you can't use usa.gov or co.uk - // as token domains. - TokenDomains []*string `min:"1" type:"list"` - - // Defines and enables Amazon CloudWatch metrics and web request sample collection. - // - // VisibilityConfig is a required field - VisibilityConfig *VisibilityConfig `type:"structure" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateWebACLInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateWebACLInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CreateWebACLInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CreateWebACLInput"} - if s.CustomResponseBodies != nil && len(s.CustomResponseBodies) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CustomResponseBodies", 1)) - } - if s.DefaultAction == nil { - invalidParams.Add(request.NewErrParamRequired("DefaultAction")) - } - if s.Description != nil && len(*s.Description) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Description", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Scope == nil { - invalidParams.Add(request.NewErrParamRequired("Scope")) - } - if s.Tags != nil && len(s.Tags) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Tags", 1)) - } - if s.TokenDomains != nil && len(s.TokenDomains) < 1 { - invalidParams.Add(request.NewErrParamMinLen("TokenDomains", 1)) - } - if s.VisibilityConfig == nil { - invalidParams.Add(request.NewErrParamRequired("VisibilityConfig")) - } - if s.CaptchaConfig != nil { - if err := s.CaptchaConfig.Validate(); err != nil { - invalidParams.AddNested("CaptchaConfig", err.(request.ErrInvalidParams)) - } - } - if s.ChallengeConfig != nil { - if err := s.ChallengeConfig.Validate(); err != nil { - invalidParams.AddNested("ChallengeConfig", err.(request.ErrInvalidParams)) - } - } - if s.CustomResponseBodies != nil { - for i, v := range s.CustomResponseBodies { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "CustomResponseBodies", i), err.(request.ErrInvalidParams)) - } - } - } - if s.DefaultAction != nil { - if err := s.DefaultAction.Validate(); err != nil { - invalidParams.AddNested("DefaultAction", err.(request.ErrInvalidParams)) - } - } - if s.Rules != nil { - for i, v := range s.Rules { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Rules", i), err.(request.ErrInvalidParams)) - } - } - } - if s.Tags != nil { - for i, v := range s.Tags { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "Tags", i), err.(request.ErrInvalidParams)) - } - } - } - if s.VisibilityConfig != nil { - if err := s.VisibilityConfig.Validate(); err != nil { - invalidParams.AddNested("VisibilityConfig", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCaptchaConfig sets the CaptchaConfig field's value. -func (s *CreateWebACLInput) SetCaptchaConfig(v *CaptchaConfig) *CreateWebACLInput { - s.CaptchaConfig = v - return s -} - -// SetChallengeConfig sets the ChallengeConfig field's value. -func (s *CreateWebACLInput) SetChallengeConfig(v *ChallengeConfig) *CreateWebACLInput { - s.ChallengeConfig = v - return s -} - -// SetCustomResponseBodies sets the CustomResponseBodies field's value. -func (s *CreateWebACLInput) SetCustomResponseBodies(v map[string]*CustomResponseBody) *CreateWebACLInput { - s.CustomResponseBodies = v - return s -} - -// SetDefaultAction sets the DefaultAction field's value. -func (s *CreateWebACLInput) SetDefaultAction(v *DefaultAction) *CreateWebACLInput { - s.DefaultAction = v - return s -} - -// SetDescription sets the Description field's value. -func (s *CreateWebACLInput) SetDescription(v string) *CreateWebACLInput { - s.Description = &v - return s -} - -// SetName sets the Name field's value. -func (s *CreateWebACLInput) SetName(v string) *CreateWebACLInput { - s.Name = &v - return s -} - -// SetRules sets the Rules field's value. -func (s *CreateWebACLInput) SetRules(v []*Rule) *CreateWebACLInput { - s.Rules = v - return s -} - -// SetScope sets the Scope field's value. -func (s *CreateWebACLInput) SetScope(v string) *CreateWebACLInput { - s.Scope = &v - return s -} - -// SetTags sets the Tags field's value. -func (s *CreateWebACLInput) SetTags(v []*Tag) *CreateWebACLInput { - s.Tags = v - return s -} - -// SetTokenDomains sets the TokenDomains field's value. -func (s *CreateWebACLInput) SetTokenDomains(v []*string) *CreateWebACLInput { - s.TokenDomains = v - return s -} - -// SetVisibilityConfig sets the VisibilityConfig field's value. -func (s *CreateWebACLInput) SetVisibilityConfig(v *VisibilityConfig) *CreateWebACLInput { - s.VisibilityConfig = v - return s -} - -type CreateWebACLOutput struct { - _ struct{} `type:"structure"` - - // High-level information about a WebACL, returned by operations like create - // and list. This provides information like the ID, that you can use to retrieve - // and manage a WebACL, and the ARN, that you provide to operations like AssociateWebACL. - Summary *WebACLSummary `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateWebACLOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CreateWebACLOutput) GoString() string { - return s.String() -} - -// SetSummary sets the Summary field's value. -func (s *CreateWebACLOutput) SetSummary(v *WebACLSummary) *CreateWebACLOutput { - s.Summary = v - return s -} - -// A custom header for custom request and response handling. This is used in -// CustomResponse and CustomRequestHandling. -type CustomHTTPHeader struct { - _ struct{} `type:"structure"` - - // The name of the custom header. - // - // For custom request header insertion, when WAF inserts the header into the - // request, it prefixes this name x-amzn-waf-, to avoid confusion with the headers - // that are already in the request. For example, for the header name sample, - // WAF inserts the header x-amzn-waf-sample. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // The value of the custom header. - // - // Value is a required field - Value *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CustomHTTPHeader) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CustomHTTPHeader) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CustomHTTPHeader) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CustomHTTPHeader"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Value == nil { - invalidParams.Add(request.NewErrParamRequired("Value")) - } - if s.Value != nil && len(*s.Value) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Value", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *CustomHTTPHeader) SetName(v string) *CustomHTTPHeader { - s.Name = &v - return s -} - -// SetValue sets the Value field's value. -func (s *CustomHTTPHeader) SetValue(v string) *CustomHTTPHeader { - s.Value = &v - return s -} - -// Custom request handling behavior that inserts custom headers into a web request. -// You can add custom request handling for WAF to use when the rule action doesn't -// block the request. For example, CaptchaAction for requests with valid t okens, -// and AllowAction. -// -// For information about customizing web requests and responses, see Customizing -// web requests and responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html) -// in the WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). -type CustomRequestHandling struct { - _ struct{} `type:"structure"` - - // The HTTP headers to insert into the request. Duplicate header names are not - // allowed. - // - // For information about the limits on count and size for custom request and - // response settings, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) - // in the WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). - // - // InsertHeaders is a required field - InsertHeaders []*CustomHTTPHeader `min:"1" type:"list" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CustomRequestHandling) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CustomRequestHandling) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CustomRequestHandling) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CustomRequestHandling"} - if s.InsertHeaders == nil { - invalidParams.Add(request.NewErrParamRequired("InsertHeaders")) - } - if s.InsertHeaders != nil && len(s.InsertHeaders) < 1 { - invalidParams.Add(request.NewErrParamMinLen("InsertHeaders", 1)) - } - if s.InsertHeaders != nil { - for i, v := range s.InsertHeaders { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "InsertHeaders", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetInsertHeaders sets the InsertHeaders field's value. -func (s *CustomRequestHandling) SetInsertHeaders(v []*CustomHTTPHeader) *CustomRequestHandling { - s.InsertHeaders = v - return s -} - -// A custom response to send to the client. You can define a custom response -// for rule actions and default web ACL actions that are set to BlockAction. -// -// For information about customizing web requests and responses, see Customizing -// web requests and responses in WAF (https://docs.aws.amazon.com/waf/latest/developerguide/waf-custom-request-response.html) -// in the WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). -type CustomResponse struct { - _ struct{} `type:"structure"` - - // References the response body that you want WAF to return to the web request - // client. You can define a custom response for a rule action or a default web - // ACL action that is set to block. To do this, you first define the response - // body key and value in the CustomResponseBodies setting for the WebACL or - // RuleGroup where you want to use it. Then, in the rule action or web ACL default - // action BlockAction setting, you reference the response body using this key. - CustomResponseBodyKey *string `min:"1" type:"string"` - - // The HTTP status code to return to the client. - // - // For a list of status codes that you can use in your custom responses, see - // Supported status codes for custom response (https://docs.aws.amazon.com/waf/latest/developerguide/customizing-the-response-status-codes.html) - // in the WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). - // - // ResponseCode is a required field - ResponseCode *int64 `min:"200" type:"integer" required:"true"` - - // The HTTP headers to use in the response. Duplicate header names are not allowed. - // - // For information about the limits on count and size for custom request and - // response settings, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) - // in the WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). - ResponseHeaders []*CustomHTTPHeader `min:"1" type:"list"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CustomResponse) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CustomResponse) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CustomResponse) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CustomResponse"} - if s.CustomResponseBodyKey != nil && len(*s.CustomResponseBodyKey) < 1 { - invalidParams.Add(request.NewErrParamMinLen("CustomResponseBodyKey", 1)) - } - if s.ResponseCode == nil { - invalidParams.Add(request.NewErrParamRequired("ResponseCode")) - } - if s.ResponseCode != nil && *s.ResponseCode < 200 { - invalidParams.Add(request.NewErrParamMinValue("ResponseCode", 200)) - } - if s.ResponseHeaders != nil && len(s.ResponseHeaders) < 1 { - invalidParams.Add(request.NewErrParamMinLen("ResponseHeaders", 1)) - } - if s.ResponseHeaders != nil { - for i, v := range s.ResponseHeaders { - if v == nil { - continue - } - if err := v.Validate(); err != nil { - invalidParams.AddNested(fmt.Sprintf("%s[%v]", "ResponseHeaders", i), err.(request.ErrInvalidParams)) - } - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetCustomResponseBodyKey sets the CustomResponseBodyKey field's value. -func (s *CustomResponse) SetCustomResponseBodyKey(v string) *CustomResponse { - s.CustomResponseBodyKey = &v - return s -} - -// SetResponseCode sets the ResponseCode field's value. -func (s *CustomResponse) SetResponseCode(v int64) *CustomResponse { - s.ResponseCode = &v - return s -} - -// SetResponseHeaders sets the ResponseHeaders field's value. -func (s *CustomResponse) SetResponseHeaders(v []*CustomHTTPHeader) *CustomResponse { - s.ResponseHeaders = v - return s -} - -// The response body to use in a custom response to a web request. This is referenced -// by key from CustomResponse CustomResponseBodyKey. -type CustomResponseBody struct { - _ struct{} `type:"structure"` - - // The payload of the custom response. - // - // You can use JSON escape strings in JSON content. To do this, you must specify - // JSON content in the ContentType setting. - // - // For information about the limits on count and size for custom request and - // response settings, see WAF quotas (https://docs.aws.amazon.com/waf/latest/developerguide/limits.html) - // in the WAF Developer Guide (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). - // - // Content is a required field - Content *string `min:"1" type:"string" required:"true"` - - // The type of content in the payload that you are defining in the Content string. - // - // ContentType is a required field - ContentType *string `type:"string" required:"true" enum:"ResponseContentType"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CustomResponseBody) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s CustomResponseBody) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *CustomResponseBody) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "CustomResponseBody"} - if s.Content == nil { - invalidParams.Add(request.NewErrParamRequired("Content")) - } - if s.Content != nil && len(*s.Content) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Content", 1)) - } - if s.ContentType == nil { - invalidParams.Add(request.NewErrParamRequired("ContentType")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetContent sets the Content field's value. -func (s *CustomResponseBody) SetContent(v string) *CustomResponseBody { - s.Content = &v - return s -} - -// SetContentType sets the ContentType field's value. -func (s *CustomResponseBody) SetContentType(v string) *CustomResponseBody { - s.ContentType = &v - return s -} - -// In a WebACL, this is the action that you want WAF to perform when a web request -// doesn't match any of the rules in the WebACL. The default action must be -// a terminating action. -type DefaultAction struct { - _ struct{} `type:"structure"` - - // Specifies that WAF should allow requests by default. - Allow *AllowAction `type:"structure"` - - // Specifies that WAF should block requests by default. - Block *BlockAction `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DefaultAction) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DefaultAction) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DefaultAction) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DefaultAction"} - if s.Allow != nil { - if err := s.Allow.Validate(); err != nil { - invalidParams.AddNested("Allow", err.(request.ErrInvalidParams)) - } - } - if s.Block != nil { - if err := s.Block.Validate(); err != nil { - invalidParams.AddNested("Block", err.(request.ErrInvalidParams)) - } - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetAllow sets the Allow field's value. -func (s *DefaultAction) SetAllow(v *AllowAction) *DefaultAction { - s.Allow = v - return s -} - -// SetBlock sets the Block field's value. -func (s *DefaultAction) SetBlock(v *BlockAction) *DefaultAction { - s.Block = v - return s -} - -type DeleteFirewallManagerRuleGroupsInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the web ACL. - // - // WebACLArn is a required field - WebACLArn *string `min:"20" type:"string" required:"true"` - - // A token used for optimistic locking. WAF returns a token to your get and - // list requests, to mark the state of the entity at the time of the request. - // To make changes to the entity associated with the token, you provide the - // token to operations like update and delete. WAF uses the token to ensure - // that no changes have been made to the entity since you last retrieved it. - // If a change has been made, the update fails with a WAFOptimisticLockException. - // If this happens, perform another get, and use the new token returned by that - // operation. - // - // WebACLLockToken is a required field - WebACLLockToken *string `min:"1" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteFirewallManagerRuleGroupsInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteFirewallManagerRuleGroupsInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteFirewallManagerRuleGroupsInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteFirewallManagerRuleGroupsInput"} - if s.WebACLArn == nil { - invalidParams.Add(request.NewErrParamRequired("WebACLArn")) - } - if s.WebACLArn != nil && len(*s.WebACLArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("WebACLArn", 20)) - } - if s.WebACLLockToken == nil { - invalidParams.Add(request.NewErrParamRequired("WebACLLockToken")) - } - if s.WebACLLockToken != nil && len(*s.WebACLLockToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("WebACLLockToken", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetWebACLArn sets the WebACLArn field's value. -func (s *DeleteFirewallManagerRuleGroupsInput) SetWebACLArn(v string) *DeleteFirewallManagerRuleGroupsInput { - s.WebACLArn = &v - return s -} - -// SetWebACLLockToken sets the WebACLLockToken field's value. -func (s *DeleteFirewallManagerRuleGroupsInput) SetWebACLLockToken(v string) *DeleteFirewallManagerRuleGroupsInput { - s.WebACLLockToken = &v - return s -} - -type DeleteFirewallManagerRuleGroupsOutput struct { - _ struct{} `type:"structure"` - - // A token used for optimistic locking. WAF returns a token to your get and - // list requests, to mark the state of the entity at the time of the request. - // To make changes to the entity associated with the token, you provide the - // token to operations like update and delete. WAF uses the token to ensure - // that no changes have been made to the entity since you last retrieved it. - // If a change has been made, the update fails with a WAFOptimisticLockException. - // If this happens, perform another get, and use the new token returned by that - // operation. - NextWebACLLockToken *string `min:"1" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteFirewallManagerRuleGroupsOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteFirewallManagerRuleGroupsOutput) GoString() string { - return s.String() -} - -// SetNextWebACLLockToken sets the NextWebACLLockToken field's value. -func (s *DeleteFirewallManagerRuleGroupsOutput) SetNextWebACLLockToken(v string) *DeleteFirewallManagerRuleGroupsOutput { - s.NextWebACLLockToken = &v - return s -} - -type DeleteIPSetInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for the set. This ID is returned in the responses to - // create and list commands. You provide it to operations like update and delete. - // - // Id is a required field - Id *string `min:"1" type:"string" required:"true"` - - // A token used for optimistic locking. WAF returns a token to your get and - // list requests, to mark the state of the entity at the time of the request. - // To make changes to the entity associated with the token, you provide the - // token to operations like update and delete. WAF uses the token to ensure - // that no changes have been made to the entity since you last retrieved it. - // If a change has been made, the update fails with a WAFOptimisticLockException. - // If this happens, perform another get, and use the new token returned by that - // operation. - // - // LockToken is a required field - LockToken *string `min:"1" type:"string" required:"true"` - - // The name of the IP set. You cannot change the name of an IPSet after you - // create it. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // Specifies whether this is for an Amazon CloudFront distribution or for a - // regional application. A regional application can be an Application Load Balancer - // (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, or an Amazon - // Cognito user pool. - // - // To work with CloudFront, you must also specify the Region US East (N. Virginia) - // as follows: - // - // * CLI - Specify the Region when you use the CloudFront scope: --scope=CLOUDFRONT - // --region=us-east-1. - // - // * API and SDKs - For all calls, use the Region endpoint us-east-1. - // - // Scope is a required field - Scope *string `type:"string" required:"true" enum:"Scope"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteIPSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteIPSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteIPSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteIPSetInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.LockToken == nil { - invalidParams.Add(request.NewErrParamRequired("LockToken")) - } - if s.LockToken != nil && len(*s.LockToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LockToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Scope == nil { - invalidParams.Add(request.NewErrParamRequired("Scope")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteIPSetInput) SetId(v string) *DeleteIPSetInput { - s.Id = &v - return s -} - -// SetLockToken sets the LockToken field's value. -func (s *DeleteIPSetInput) SetLockToken(v string) *DeleteIPSetInput { - s.LockToken = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteIPSetInput) SetName(v string) *DeleteIPSetInput { - s.Name = &v - return s -} - -// SetScope sets the Scope field's value. -func (s *DeleteIPSetInput) SetScope(v string) *DeleteIPSetInput { - s.Scope = &v - return s -} - -type DeleteIPSetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteIPSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteIPSetOutput) GoString() string { - return s.String() -} - -type DeleteLoggingConfigurationInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the web ACL from which you want to delete - // the LoggingConfiguration. - // - // ResourceArn is a required field - ResourceArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteLoggingConfigurationInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteLoggingConfigurationInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteLoggingConfigurationInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteLoggingConfigurationInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *DeleteLoggingConfigurationInput) SetResourceArn(v string) *DeleteLoggingConfigurationInput { - s.ResourceArn = &v - return s -} - -type DeleteLoggingConfigurationOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteLoggingConfigurationOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteLoggingConfigurationOutput) GoString() string { - return s.String() -} - -type DeletePermissionPolicyInput struct { - _ struct{} `type:"structure"` - - // The Amazon Resource Name (ARN) of the rule group from which you want to delete - // the policy. - // - // You must be the owner of the rule group to perform this operation. - // - // ResourceArn is a required field - ResourceArn *string `min:"20" type:"string" required:"true"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeletePermissionPolicyInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeletePermissionPolicyInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeletePermissionPolicyInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeletePermissionPolicyInput"} - if s.ResourceArn == nil { - invalidParams.Add(request.NewErrParamRequired("ResourceArn")) - } - if s.ResourceArn != nil && len(*s.ResourceArn) < 20 { - invalidParams.Add(request.NewErrParamMinLen("ResourceArn", 20)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetResourceArn sets the ResourceArn field's value. -func (s *DeletePermissionPolicyInput) SetResourceArn(v string) *DeletePermissionPolicyInput { - s.ResourceArn = &v - return s -} - -type DeletePermissionPolicyOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeletePermissionPolicyOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeletePermissionPolicyOutput) GoString() string { - return s.String() -} - -type DeleteRegexPatternSetInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for the set. This ID is returned in the responses to - // create and list commands. You provide it to operations like update and delete. - // - // Id is a required field - Id *string `min:"1" type:"string" required:"true"` - - // A token used for optimistic locking. WAF returns a token to your get and - // list requests, to mark the state of the entity at the time of the request. - // To make changes to the entity associated with the token, you provide the - // token to operations like update and delete. WAF uses the token to ensure - // that no changes have been made to the entity since you last retrieved it. - // If a change has been made, the update fails with a WAFOptimisticLockException. - // If this happens, perform another get, and use the new token returned by that - // operation. - // - // LockToken is a required field - LockToken *string `min:"1" type:"string" required:"true"` - - // The name of the set. You cannot change the name after you create the set. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // Specifies whether this is for an Amazon CloudFront distribution or for a - // regional application. A regional application can be an Application Load Balancer - // (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, or an Amazon - // Cognito user pool. - // - // To work with CloudFront, you must also specify the Region US East (N. Virginia) - // as follows: - // - // * CLI - Specify the Region when you use the CloudFront scope: --scope=CLOUDFRONT - // --region=us-east-1. - // - // * API and SDKs - For all calls, use the Region endpoint us-east-1. - // - // Scope is a required field - Scope *string `type:"string" required:"true" enum:"Scope"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteRegexPatternSetInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteRegexPatternSetInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRegexPatternSetInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRegexPatternSetInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.LockToken == nil { - invalidParams.Add(request.NewErrParamRequired("LockToken")) - } - if s.LockToken != nil && len(*s.LockToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LockToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Scope == nil { - invalidParams.Add(request.NewErrParamRequired("Scope")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteRegexPatternSetInput) SetId(v string) *DeleteRegexPatternSetInput { - s.Id = &v - return s -} - -// SetLockToken sets the LockToken field's value. -func (s *DeleteRegexPatternSetInput) SetLockToken(v string) *DeleteRegexPatternSetInput { - s.LockToken = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteRegexPatternSetInput) SetName(v string) *DeleteRegexPatternSetInput { - s.Name = &v - return s -} - -// SetScope sets the Scope field's value. -func (s *DeleteRegexPatternSetInput) SetScope(v string) *DeleteRegexPatternSetInput { - s.Scope = &v - return s -} - -type DeleteRegexPatternSetOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteRegexPatternSetOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteRegexPatternSetOutput) GoString() string { - return s.String() -} - -type DeleteRuleGroupInput struct { - _ struct{} `type:"structure"` - - // A unique identifier for the rule group. This ID is returned in the responses - // to create and list commands. You provide it to operations like update and - // delete. - // - // Id is a required field - Id *string `min:"1" type:"string" required:"true"` - - // A token used for optimistic locking. WAF returns a token to your get and - // list requests, to mark the state of the entity at the time of the request. - // To make changes to the entity associated with the token, you provide the - // token to operations like update and delete. WAF uses the token to ensure - // that no changes have been made to the entity since you last retrieved it. - // If a change has been made, the update fails with a WAFOptimisticLockException. - // If this happens, perform another get, and use the new token returned by that - // operation. - // - // LockToken is a required field - LockToken *string `min:"1" type:"string" required:"true"` - - // The name of the rule group. You cannot change the name of a rule group after - // you create it. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // Specifies whether this is for an Amazon CloudFront distribution or for a - // regional application. A regional application can be an Application Load Balancer - // (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, or an Amazon - // Cognito user pool. - // - // To work with CloudFront, you must also specify the Region US East (N. Virginia) - // as follows: - // - // * CLI - Specify the Region when you use the CloudFront scope: --scope=CLOUDFRONT - // --region=us-east-1. - // - // * API and SDKs - For all calls, use the Region endpoint us-east-1. - // - // Scope is a required field - Scope *string `type:"string" required:"true" enum:"Scope"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteRuleGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteRuleGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteRuleGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteRuleGroupInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.LockToken == nil { - invalidParams.Add(request.NewErrParamRequired("LockToken")) - } - if s.LockToken != nil && len(*s.LockToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LockToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Scope == nil { - invalidParams.Add(request.NewErrParamRequired("Scope")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteRuleGroupInput) SetId(v string) *DeleteRuleGroupInput { - s.Id = &v - return s -} - -// SetLockToken sets the LockToken field's value. -func (s *DeleteRuleGroupInput) SetLockToken(v string) *DeleteRuleGroupInput { - s.LockToken = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteRuleGroupInput) SetName(v string) *DeleteRuleGroupInput { - s.Name = &v - return s -} - -// SetScope sets the Scope field's value. -func (s *DeleteRuleGroupInput) SetScope(v string) *DeleteRuleGroupInput { - s.Scope = &v - return s -} - -type DeleteRuleGroupOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteRuleGroupOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteRuleGroupOutput) GoString() string { - return s.String() -} - -type DeleteWebACLInput struct { - _ struct{} `type:"structure"` - - // The unique identifier for the web ACL. This ID is returned in the responses - // to create and list commands. You provide it to operations like update and - // delete. - // - // Id is a required field - Id *string `min:"1" type:"string" required:"true"` - - // A token used for optimistic locking. WAF returns a token to your get and - // list requests, to mark the state of the entity at the time of the request. - // To make changes to the entity associated with the token, you provide the - // token to operations like update and delete. WAF uses the token to ensure - // that no changes have been made to the entity since you last retrieved it. - // If a change has been made, the update fails with a WAFOptimisticLockException. - // If this happens, perform another get, and use the new token returned by that - // operation. - // - // LockToken is a required field - LockToken *string `min:"1" type:"string" required:"true"` - - // The name of the web ACL. You cannot change the name of a web ACL after you - // create it. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // Specifies whether this is for an Amazon CloudFront distribution or for a - // regional application. A regional application can be an Application Load Balancer - // (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, or an Amazon - // Cognito user pool. - // - // To work with CloudFront, you must also specify the Region US East (N. Virginia) - // as follows: - // - // * CLI - Specify the Region when you use the CloudFront scope: --scope=CLOUDFRONT - // --region=us-east-1. - // - // * API and SDKs - For all calls, use the Region endpoint us-east-1. - // - // Scope is a required field - Scope *string `type:"string" required:"true" enum:"Scope"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteWebACLInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteWebACLInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DeleteWebACLInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DeleteWebACLInput"} - if s.Id == nil { - invalidParams.Add(request.NewErrParamRequired("Id")) - } - if s.Id != nil && len(*s.Id) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Id", 1)) - } - if s.LockToken == nil { - invalidParams.Add(request.NewErrParamRequired("LockToken")) - } - if s.LockToken != nil && len(*s.LockToken) < 1 { - invalidParams.Add(request.NewErrParamMinLen("LockToken", 1)) - } - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Scope == nil { - invalidParams.Add(request.NewErrParamRequired("Scope")) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetId sets the Id field's value. -func (s *DeleteWebACLInput) SetId(v string) *DeleteWebACLInput { - s.Id = &v - return s -} - -// SetLockToken sets the LockToken field's value. -func (s *DeleteWebACLInput) SetLockToken(v string) *DeleteWebACLInput { - s.LockToken = &v - return s -} - -// SetName sets the Name field's value. -func (s *DeleteWebACLInput) SetName(v string) *DeleteWebACLInput { - s.Name = &v - return s -} - -// SetScope sets the Scope field's value. -func (s *DeleteWebACLInput) SetScope(v string) *DeleteWebACLInput { - s.Scope = &v - return s -} - -type DeleteWebACLOutput struct { - _ struct{} `type:"structure"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteWebACLOutput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DeleteWebACLOutput) GoString() string { - return s.String() -} - -type DescribeManagedRuleGroupInput struct { - _ struct{} `type:"structure"` - - // The name of the managed rule group. You use this, along with the vendor name, - // to identify the rule group. - // - // Name is a required field - Name *string `min:"1" type:"string" required:"true"` - - // Specifies whether this is for an Amazon CloudFront distribution or for a - // regional application. A regional application can be an Application Load Balancer - // (ALB), an Amazon API Gateway REST API, an AppSync GraphQL API, or an Amazon - // Cognito user pool. - // - // To work with CloudFront, you must also specify the Region US East (N. Virginia) - // as follows: - // - // * CLI - Specify the Region when you use the CloudFront scope: --scope=CLOUDFRONT - // --region=us-east-1. - // - // * API and SDKs - For all calls, use the Region endpoint us-east-1. - // - // Scope is a required field - Scope *string `type:"string" required:"true" enum:"Scope"` - - // The name of the managed rule group vendor. You use this, along with the rule - // group name, to identify the rule group. - // - // VendorName is a required field - VendorName *string `min:"1" type:"string" required:"true"` - - // The version of the rule group. You can only use a version that is not scheduled - // for expiration. If you don't provide this, WAF uses the vendor's default - // version. - VersionName *string `min:"1" type:"string"` -} - -// String returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeManagedRuleGroupInput) String() string { - return awsutil.Prettify(s) -} - -// GoString returns the string representation. -// -// API parameter values that are decorated as "sensitive" in the API will not -// be included in the string output. The member name will be present, but the -// value will be replaced with "sensitive". -func (s DescribeManagedRuleGroupInput) GoString() string { - return s.String() -} - -// Validate inspects the fields of the type to determine if they are valid. -func (s *DescribeManagedRuleGroupInput) Validate() error { - invalidParams := request.ErrInvalidParams{Context: "DescribeManagedRuleGroupInput"} - if s.Name == nil { - invalidParams.Add(request.NewErrParamRequired("Name")) - } - if s.Name != nil && len(*s.Name) < 1 { - invalidParams.Add(request.NewErrParamMinLen("Name", 1)) - } - if s.Scope == nil { - invalidParams.Add(request.NewErrParamRequired("Scope")) - } - if s.VendorName == nil { - invalidParams.Add(request.NewErrParamRequired("VendorName")) - } - if s.VendorName != nil && len(*s.VendorName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VendorName", 1)) - } - if s.VersionName != nil && len(*s.VersionName) < 1 { - invalidParams.Add(request.NewErrParamMinLen("VersionName", 1)) - } - - if invalidParams.Len() > 0 { - return invalidParams - } - return nil -} - -// SetName sets the Name field's value. -func (s *DescribeManagedRuleGroupInput) SetName(v string) *DescribeManagedRuleGroupInput { - s.Name = &v - return s -} - -// SetScope sets the Scope field's value. -func (s *DescribeManagedRuleGroupInput) SetScope(v string) *DescribeManagedRuleGroupInput { - s.Scope = &v - return s -} - -// SetVendorName sets the VendorName field's value. -func (s *DescribeManagedRuleGroupInput) SetVendorName(v string) *DescribeManagedRuleGroupInput { - s.VendorName = &v - return s -} - -// SetVersionName sets the VersionName field's value. -func (s *DescribeManagedRuleGroupInput) SetVersionName(v string) *DescribeManagedRuleGroupInput { - s.VersionName = &v - return s -} - -type DescribeManagedRuleGroupOutput struct { - _ struct{} `type:"structure"` - - // The labels that one or more rules in this rule group add to matching web - // requests. These labels are defined in the RuleLabels for a Rule. - AvailableLabels []*LabelSummary `type:"list"` - - // The web ACL capacity units (WCUs) required for this rule group. WAF uses - // web ACL capacity units (WCU) to calculate and control the operating resources - // that are used to run your rules, rule groups, and web ACLs. WAF calculates - // capacity differently for each rule type, to reflect each rule's relative - // cost. Rule group capacity is fixed at creation, so users can plan their web - // ACL WCU usage when they use a rule group. The WCU limit for web ACLs is 1,500. - Capacity *int64 `min:"1" type:"long"` - - // The labels that one or more rules in this rule group match against in label - // match statements. These labels are defined in a LabelMatchStatement specification, - // in the Statement definition of a rule. - ConsumedLabels []*LabelSummary `type:"list"` - - // The label namespace prefix for this rule group. All labels added by rules - // in this rule group have this prefix. - // - // * The syntax for the label namespace prefix for a managed rule group is - // the following: awswaf:managed::: - // - // * When a rule with a label matches a web request, WAF adds the fully qualified - // label to the request. A fully qualified label is made up of the label - // namespace from the rule group or web ACL where the rule is defined and - // the label from the rule, separated by a colon: